/* ============ Category/product page (diekstrak dari product-telkomsel.html) ============ */
/* Di-scope di bawah .category-main agar tidak bentrok dengan home.css */

.category-main {
  /* Token warna didefinisikan global di fix-theme.css (dimuat lebih dulu). */

  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
  color: var(--text-dark);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.category-main a { color: var(--blue); text-decoration: underline; }

/* ===== Shared header ===== */
.category-main .top-banner { background: #111; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.category-main .top-banner svg { width: 14px; height: 14px; }

/* App promo (shared) */
.category-main .app-promo { margin: 16px 20px 0; border-radius: 20px; padding: 24px 20px; position: relative; overflow: hidden; background: linear-gradient(135deg, #6a3fd1, #3f7fe0); color: #fff; }
.category-main .app-promo .close { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; color: #fff; opacity: .8; cursor: pointer; }
.category-main .app-promo .badge { position: absolute; top: 44px; right: 14px; background: #ff5a5f; color: #fff; font-size: 12px; font-weight: 800; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.category-main .app-promo h3 { font-size: 24px; font-weight: 800; margin: 0 0 12px; max-width: 70%; line-height: 1.2; }
.category-main .store-badges { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.category-main .store-badge { display: flex; align-items: center; gap: 8px; background: #000; border-radius: 10px; padding: 8px 12px; width: fit-content; font-size: 12px; }
.category-main .store-badge svg { width: 18px; height: 18px; }

/* Breadcrumb */
.category-main .breadcrumb { display: flex; align-items: center; gap: 6px; padding: 18px 20px 4px; font-size: 14px; font-weight: 600; color: var(--text-dark); }
.category-main .breadcrumb svg { width: 16px; height: 16px; }
.category-main a.breadcrumb { color: var(--text-dark); text-decoration: none; }

/* Product header */
.category-main .product-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px 20px; }
.category-main .product-logo { width: 130px; height: 80px; border-radius: 14px; background: #e2231a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 10px; overflow: hidden; }
.category-main .product-logo svg,
.category-main .product-logo img { width: 100%; height: 100%; object-fit: contain; }
.category-main .product-header .name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.category-main .product-header .country { font-size: 14px; color: var(--text-grey); }

/* Product-list (direct order flow) — shrink operator logo ~60% */
.category-main.jx-product-list .product-header .card-grid-list {
  width: 40%;
  flex: 0 0 auto;
}
.category-main.jx-product-list .product-header .card-grid-list img.product-card-img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

/* Category page (mobile flow) — match product-list operator logo treatment */
.category-main:not(.jx-product-list) .product-header .product-logo {
  width: 40%;
  height: auto;
  aspect-ratio: 8 / 5;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.category-main:not(.jx-product-list) .product-header .product-logo svg,
.category-main:not(.jx-product-list) .product-header .product-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Tabs: Prabayar / Pascabayar */
.category-main .tab-row { display: flex; gap: 10px; padding: 0 20px 20px; }
.category-main .tab-btn {
  flex: 1; text-align: center; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border-grey);
  font-size: 15px; font-weight: 700; color: var(--text-grey); background: #fff; cursor: pointer; font-family: inherit;
}
.category-main .tab-btn.active { border-color: #111; color: #111; background: var(--bg-grey); }

/* Phone input (no country code, plain field) */
.category-main .phone-section { padding: 0 20px 20px; }
.category-main .phone-label { font-size: 14px; font-weight: 600; color: var(--text-grey); margin-bottom: 8px; }
.category-main .phone-input {
  width: 100%; border: 1px solid var(--border-grey); border-radius: 12px; padding: 14px 16px;
  font-size: 16px; font-family: inherit; color: var(--text-dark); background: #fff;
}
.category-main .phone-input::placeholder { color: #9a9a9a; }

/* Product cards (gaya list-card.html: kartu pilih, badge promo, harga coret) */
.category-main .section { padding: 6px 20px 4px; }
.category-main .section-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.category-main .products {
  display: none; flex-direction: column; gap: 10px; padding: 0 20px 8px;
}
.category-main .products.is-visible { display: flex; }
.category-main .product-card {
  border: 1.5px solid var(--border-grey); border-radius: 14px;
  padding: 14px; position: relative; overflow: hidden; cursor: pointer;
  background: #fff; transition: border-color .15s ease, background .15s ease;
}
.category-main .product-card.selected { border-color: var(--brand-red); background: #FFF5F6; }
.category-main .product-card.disabled { cursor: not-allowed; opacity: .5; }
.category-main .product-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.category-main .product-name { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.category-main .product-prices { text-align: right; }
.category-main .product-price { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.category-main .product-price-old { font-size: 12px; color: var(--text-grey); text-decoration: line-through; margin-right: 6px; }
.category-main .promo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-red); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; position: absolute; top: -1px; left: 14px;
  transform: translateY(-50%);
}
.category-main .out-of-stock-tag {
  font-size: 11px; font-weight: 700; color: var(--text-grey); background: var(--bg-grey);
  padding: 4px 10px; border-radius: 20px;
}

/* Sticky CTA (gaya list-card.html) */
.category-main .cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border-top: 1px solid var(--border-grey);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 420px; margin: 0 auto;
}
.category-main .cta-bar.is-visible { display: flex; }
.category-main .cta-total-label { font-size: 11px; color: var(--text-grey); }
.category-main .cta-total-value { font-size: 16px; font-weight: 800; color: var(--text-dark); }
.category-main .cta-btn {
  border: none; background: var(--brand-red); color: #fff; font-size: 14.5px; font-weight: 700;
  padding: 13px 26px; border-radius: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s ease, opacity .15s ease;
}
.category-main .cta-btn:disabled { background: var(--border-grey); color: var(--text-grey); cursor: not-allowed; }
.category-main .cta-btn:not(:disabled):active { background: var(--brand-red-dark); }
.category-main.cta-visible { padding-bottom: 96px; }

/* Payment icons row */
.category-main .payment-icons { display: flex; align-items: center; gap: 8px; padding: 6px 20px 20px; flex-wrap: wrap; }
.category-main .pm-icon { min-width: 38px; width: auto; height: 24px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--border-grey); display: flex; align-items: center; justify-content: center; background: #fff; }
.category-main .pm-icon span { font-size: 10px; font-weight: 800; color: var(--text-dark); letter-spacing: .2px; white-space: nowrap; }
.category-main .payment-icons .more { font-size: 13px; color: var(--text-grey); }

.category-main .badge-row { padding: 0 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.category-main .badge-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.category-main .badge-item svg { width: 20px; height: 20px; color: var(--green-dark); flex-shrink: 0; }

/* About section */
.category-main .about-section { padding: 8px 20px 24px; border-top: 8px solid var(--bg-grey); }
.category-main .about-section h2 { font-size: 22px; font-weight: 800; margin: 24px 0 12px; }
.category-main .about-section p { font-size: 15px; line-height: 1.65; color: var(--text-grey); margin: 0 0 16px; }
.category-main .about-section .consent { font-size: 13px; color: #9a9a9a; }

/* FAQ accordion */
.category-main .faq-section { padding: 8px 20px 8px; }
.category-main .faq-section > .section-title { font-size: 22px; font-weight: 800; margin: 8px 0 16px; }
.category-main .faq-row { border-bottom: 1px solid var(--border-grey); }
.category-main .faq-q {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer;
  font-size: 15px; font-weight: 700; background: none; border: none; width: 100%; text-align: left; font-family: inherit; color: var(--text-dark);
}
.category-main .faq-q svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s ease; }
.category-main .faq-q svg.rotated { transform: rotate(180deg); }
.category-main .faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.category-main .faq-a-inner { padding: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--text-grey); }
.category-main .faq-a-inner ol,
.category-main .faq-a-inner ul { margin: 8px 0 0; padding-left: 18px; }
.category-main .faq-a-inner li { margin-bottom: 4px; }

/* ============================================================
   Category mobile order flow (#mobile-order-flow) — align with
   the product-list page. Uses the CATEGORY's real classes, not
   product-list classes.
   ============================================================ */

/* 1. Operator logo: match product-list treatment (no red box, small, contained) */
#mobile-order-flow .product-header .product-logo {
  width: 40%;
  height: auto;
  aspect-ratio: 8 / 5;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
#mobile-order-flow .product-header .product-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 2. Product list must not touch the left/right device edges */
#mobile-order-flow .category-product-grid {
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
#mobile-order-flow .category-product-grid > * {
  box-sizing: border-box;
}

/* 3. Remove operator logo from inside the product list rows */
#mobile-order-flow .category-product-grid .row-icon,
#mobile-order-flow #flash-sale-products .row-icon,
#mobile-order-flow .category-product-grid .product-logo,
#mobile-order-flow .category-product-grid img.product-card-img,
#mobile-order-flow .category-product-grid .logo-letter {
  display: none !important;
}
