/* pop-grid.css — Grid navigation + modal overlay (adapted from Tooplate Pop) */

/* Full-screen wrapper with two-tone split background */
#tm-wrap {
  display: flex;
  align-items: center;
  min-height: 100vh;
  background: transparent;
}

/* Main content area */
.tm-main-content {
  display: flex;
  align-items: center;
  padding: 50px 15px;
  position: relative;
  width: 100%;
  min-height: 100vh;
}

.tm-main-content > .container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.tm-main-content > .container > .row {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Left column: brand + tagline */
.col-left {
  flex: 1;
  min-width: 0;
}

.tm-site-header {
  text-align: right;
  padding: 20px;
}

.tm-site-header .site-logo {
  max-width: 120px;
  height: auto;
  margin-bottom: 20px;
  border: 0.5px solid #fff;
}

.tm-site-header h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.tm-site-header .intro-line {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.tm-site-header .intro-tagline {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px;
}

.tm-site-header .intro-text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 12px;
  text-align: justify;
}

/* Right column: grid */
.col-right {
  flex: 0 0 auto;
}

/* Grid of navigation boxes — 2x2 layout */
.content {
  max-width: 460px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Navigation box */
.product {
  position: relative;
  cursor: pointer;
  background: rgba(11, 13, 18, 0.7);
  border: 1px solid var(--border-strong);
  transition: background 0.2s, border-color 0.2s;
}

.product:hover {
  background: var(--brand-bg);
  border-color: var(--brand);
}

.tm-nav-link {
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 220px;
  height: 220px;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.tm-nav-icon {
  display: block;
  margin-bottom: 25px;
  color: var(--brand);
}

.fa-3x {
  font-size: 2.5em;
}

.tm-nav-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text);
}

/* Hidden elements for animation */
.product__bg {
  width: 100%;
  height: 100%;
  top: 0;
  position: absolute;
  opacity: 0;
  background: var(--bg);
}

.product__description {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: none;
}

/* Cloned content inside modal must override hidden styles */
.details__description .product__description {
  display: block;
  opacity: 1;
  position: static;
  width: auto;
  height: auto;
}

/* Modal overlay */
.details {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  padding: 15px;
  overflow: hidden;
}

.details > * {
  position: relative;
  opacity: 0;
}

.details--open {
  pointer-events: auto;
}

/* Modal content box */
.details__bg {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  transform-origin: 0 0;
}

.details__bg--down {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 20px 30px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* Close button */
.details__close {
  position: fixed;
  top: 20px;
  right: 20px;
  border: 0;
  background: none;
  margin: 12px;
  cursor: pointer;
  font-size: 0.85em;
  color: var(--muted);
  z-index: 1001;
  transition: color 0.2s;
}

.details__close:hover {
  color: var(--text);
}

.tm-fa-close {
  font-size: 28px;
}

/* Modal content area */
.details__description {
  overflow-y: visible;
}

/* Page title inside modal */
.tm-page-title {
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 10px;
}

/* Modal backdrop overlay */
.details-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 999;
  display: none;
}

.details-backdrop.active {
  display: block;
}

/* App cards inside Apps modal */
.modal-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Permanent row: 3 cards centered above 4-col grid */
.modal-app-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 75%;
  margin: 0 auto;
}

/* 5-app permanent row */
.modal-app-grid.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.modal-app-card {
  display: block;
  border: 2px solid var(--brand);
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s;
}

.modal-app-card:hover {
  background: var(--brand-bg);
  color: var(--text);
}

.modal-app-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
}

.modal-app-card h3 {
  color: var(--brand);
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.modal-app-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Apps Carousel ─────────────────────────────────────── */
.apps-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.apps-carousel-track-outer {
  overflow: hidden;
  flex: 1;
}

.apps-carousel-track {
  display: flex;
  gap: 14px;
  will-change: transform;
}

.carousel-app-card {
  flex-shrink: 0;
  width: calc(25% - 11px);
  border: 2px solid var(--brand);
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, transform 0.2s;
  position: relative;
}

.carousel-app-card:hover {
  background: var(--brand-bg);
  transform: translateY(-3px);
}

.carousel-app-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  display: block;
}

.carousel-app-card h3 {
  color: var(--brand);
  margin: 0 0 6px;
  font-size: 1rem;
}

.carousel-app-card p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.app-licence-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.app-licence-tag.annual {
  background: rgba(125,211,33,0.12);
  color: var(--brand);
  border: 1px solid rgba(125,211,33,0.3);
}

.app-licence-tag.permanent {
  background: rgba(80,160,255,0.12);
  color: #6ab0ff;
  border: 1px solid rgba(80,160,255,0.3);
}

.app-licence-tag.free {
  background: rgba(125,211,33,0.2);
  color: var(--brand);
  border: 1px solid rgba(125,211,33,0.5);
}

.carousel-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--brand);
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  line-height: 1;
}

.carousel-btn:hover {
  background: var(--brand-hover);
  transform: scale(1.08);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

.pricing-section-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pricing-section-label:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Pricing cards inside Pricing modal */
.modal-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Permanent row: centered, same card width as annual 4-col */
.modal-pricing-grid.grid-3 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.modal-pricing-grid.grid-3 > .modal-pricing-card {
  flex: 0 0 calc(25% - 7.5px);
}

.modal-pricing-card {
  border: 1px solid var(--border);
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.pricing-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pricing-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.modal-pricing-card h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}

.modal-pricing-card p {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 5px 0;
}

.modal-pricing-card ul {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 6px 0;
  padding-left: 16px;
}

.modal-pricing-card .pill {
  margin-top: 8px;
}

.pricing-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.pricing-buttons .pill {
  flex: 1;
  padding: 5px 10px;
  font-size: 0.78rem;
  margin-top: 0;
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.pricing-buttons .pill:hover {
  background: var(--brand);
  color: #000;
}

.discount-badge {
  display: inline-block;
  background: var(--brand);
  color: #000;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Free trial button */
.trial-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: var(--font);
  background: transparent;
  border: 1px dashed var(--brand);
  color: var(--brand);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.trial-btn:hover {
  background: var(--brand);
  color: #000;
}

/* Cart — button groups */
.btn-group {
  display: flex;
  flex: 1;
}
.btn-group .pill {
  flex: 1;
}
.pill-cart {
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.pill-cart:hover {
  background: var(--brand);
  color: #000;
}
.pill-cart.added {
  background: var(--brand);
  color: #000;
}

/* Floating cart button */
.cart-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand);
  color: #000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}
.cart-float:hover {
  transform: scale(1.1);
}
.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cart slide-in panel */
.cart-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.cart-panel.open {
  right: 0;
}
.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart-panel-header h3 {
  margin: 0;
  color: var(--text);
}
.cart-panel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.cart-panel-close:hover {
  color: var(--text);
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.cart-item-info p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
}
.cart-item-remove:hover {
  color: #e53e3e;
}
.cart-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}
.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 1.05rem;
  color: var(--text);
}
.cart-total-note {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}
.cart-footer .pill {
  width: 100%;
  display: block;
}
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1150;
  display: none;
}
.cart-backdrop.open {
  display: block;
}

/* Pricing side-by-side layout */
.pricing-layout {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.pricing-left {
  flex: 1;
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.pricing-right {
  flex: 0 0 210px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
}
.pricing-right .pricing-section-label {
  margin-top: 0;
}
.pricing-right .modal-pricing-grid {
  flex: 1;
  display: flex;
}
/* Bundle pricing card */
.modal-pricing-grid:has(.bundle-highlight) {
  grid-template-columns: 1fr;
}
.modal-pricing-card.bundle-highlight {
  border: 2px solid var(--brand);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bundle-list {
  margin: 6px 0 !important;
  padding-left: 18px !important;
}
.bundle-buy-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.2rem;
}

/* Contact form inside modal */
.modal-contact-form {
  max-width: 480px;
}

.modal-contact-form .form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.modal-contact-form .form-row > * {
  flex: 1;
}

/* Login form inside modal */
.modal-login-form {
  max-width: 400px;
}

/* Footer inside tm-main-content */
.tm-main-content footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.tm-main-content.tm-footer-relative {
  flex-direction: column;
}

.tm-main-content.tm-footer-relative footer {
  position: relative;
  margin-top: 50px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  z-index: 998;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 16px;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 400;
  transition: color 0.2s;
  min-height: 44px;
  min-width: 44px;
}

.bottom-nav-item i {
  font-size: 1.2rem;
  color: var(--brand);
}

.bottom-nav-item:active {
  color: var(--brand);
}

/* Responsive */
@media (min-width: 900px) {
  .tm-main-content > .container {
    max-width: 1100px;
  }
}

@media (max-width: 900px) {
  /* Keep background transparent so body image shows through */
  #tm-wrap {
    background: transparent;
  }
  .tm-main-content > .container > .row {
    flex-direction: column;
    text-align: center;
  }
  .tm-site-header {
    text-align: center;
  }
  /* Hide grid boxes on mobile — replaced by bottom nav */
  .col-right {
    display: none;
  }
  /* Show bottom navigation bar */
  .mobile-bottom-nav {
    display: flex;
  }
  /* Add bottom padding so footer doesn't hide behind nav */
  .tm-main-content {
    padding-bottom: 70px;
  }
  /* Fix modal scroll: allow full-screen scrollable modal on mobile */
  .details {
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .details__bg--down {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    border: none;
  }
  /* Footer must clear bottom nav */
  .tm-main-content footer {
    position: relative;
    margin-top: 30px;
    margin-bottom: 60px;
  }
}

@media (max-width: 900px) {
  .modal-app-grid,
  .modal-app-grid.grid-3,
  .modal-app-grid.grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .carousel-app-card {
    width: calc(50% - 7px);
  }
  .modal-pricing-grid,
  .modal-pricing-grid.grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-layout {
    flex-direction: column;
  }
  .pricing-left {
    padding-right: 0;
    border-right: none;
  }
  .pricing-right {
    flex: none;
    padding-left: 0;
  }
}

@media (max-width: 544px) {
  .tm-main-content {
    flex-direction: column;
    padding: 30px 15px;
  }
  .details__bg--down {
    padding: 30px 20px;
  }
  .modal-app-grid,
  .modal-app-grid.grid-3,
  .modal-app-grid.grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .carousel-app-card {
    width: calc(100% - 0px);
  }
  .modal-pricing-grid,
  .modal-pricing-grid.grid-3 {
    grid-template-columns: 1fr;
  }
  .modal-contact-form .form-row {
    flex-direction: column;
  }
}
