/* Source: mobile-layout-v3.css */
/* Toko Harga Buku — Mobile layout v3
   Header tidak terpotong + etalase 2 produk per baris */
@media (max-width: 720px) {
  html, body { max-width: 100%; overflow-x: hidden !important; }

  .site-header { width: 100%; }
  .site-header .header-shell {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 14px 14px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  .site-header .brand-block {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .site-header .brand-block img {
    width: 54px !important;
    height: 54px !important;
    flex: 0 0 54px !important;
    object-fit: contain !important;
  }
  .site-header .brand-block span { min-width: 0 !important; }
  .site-header .brand-block strong {
    display: block !important;
    font-size: 1.08rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }
  .site-header .brand-block small {
    display: block !important;
    margin-top: 3px !important;
    font-size: .78rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  .site-header .main-nav {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    box-sizing: border-box !important;
  }
  .site-header .main-nav > a {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    border-radius: 14px !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }
  .site-header .main-nav > .nav-cart {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
  }

  /* Dua produk per baris untuk etalase halaman utama dan katalog */
  .catalog .grid,
  #catalog-grid,
  .featured-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .catalog .grid > .card,
  #catalog-grid > .card,
  .featured-grid > * {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .catalog .card,
  #catalog-grid .card {
    border-radius: 16px !important;
    overflow: hidden !important;
  }
  .catalog .card-image,
  #catalog-grid .card-image {
    min-height: 0 !important;
    aspect-ratio: 1 / 1.2 !important;
  }
  .catalog .card-image img,
  #catalog-grid .card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .catalog .card-body,
  #catalog-grid .card-body {
    padding: 10px !important;
  }
  .catalog .card-body > p:first-child,
  #catalog-grid .card-body > p:first-child {
    font-size: .68rem !important;
    line-height: 1.25 !important;
    margin-bottom: 5px !important;
  }
  .catalog .card h3,
  #catalog-grid .card h3 {
    font-size: .9rem !important;
    line-height: 1.25 !important;
    margin: 0 0 6px !important;
  }
  .catalog .product-title,
  #catalog-grid .product-title {
    font-size: inherit !important;
    line-height: inherit !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .catalog .product-desc-preview,
  #catalog-grid .product-desc-preview {
    display: none !important;
  }
  .catalog .card .desc,
  #catalog-grid .card .desc {
    font-size: .72rem !important;
    line-height: 1.3 !important;
    margin: 4px 0 !important;
  }
  .catalog .card-bottom,
  #catalog-grid .card-bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
    margin-top: 8px !important;
  }
  .catalog .card-bottom > strong,
  #catalog-grid .card-bottom > strong {
    font-size: .94rem !important;
  }
  .catalog .card-bottom button,
  #catalog-grid .card-bottom button {
    width: 100% !important;
    min-height: 36px !important;
    padding: 7px 8px !important;
    font-size: .76rem !important;
    line-height: 1.1 !important;
  }
  .catalog .card-bottom form,
  #catalog-grid .card-bottom form { width: 100% !important; }

  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 360px) {
  .site-header .main-nav { gap: 6px !important; }
  .site-header .main-nav > a { font-size: .78rem !important; padding: 8px 6px !important; }
  .catalog .grid, #catalog-grid, .featured-grid { gap: 8px !important; }
  .catalog .card-body, #catalog-grid .card-body { padding: 8px !important; }
}

/* === Mobile polish v4: katalog + produk terlaris === */
@media (max-width: 720px) {
  /* Page shell */
  .page-shell,
  .store-shell,
  main {
    max-width: 100% !important;
  }

  /* Katalog hero dibuat lebih ringkas dan proporsional */
  .catalog-hero {
    padding: 22px 18px !important;
    margin: 10px 12px 16px !important;
    border-radius: 22px !important;
    gap: 16px !important;
  }
  .catalog-hero .eyebrow {
    font-size: .72rem !important;
    letter-spacing: .16em !important;
    margin-bottom: 10px !important;
  }
  .catalog-hero h1 {
    font-size: clamp(2.05rem, 10.4vw, 3rem) !important;
    line-height: .98 !important;
    letter-spacing: -.045em !important;
    margin: 0 0 14px !important;
    max-width: 9.8ch !important;
  }
  .catalog-hero p {
    font-size: .9rem !important;
    line-height: 1.55 !important;
    margin: 0 !important;
  }
  .catalog-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 12px 15px !important;
    border-radius: 16px !important;
  }
  .catalog-summary strong {
    font-family: Arial,Helvetica,sans-serif !important;
    font-size: 1rem !important;
    letter-spacing: .02em !important;
  }
  .catalog-summary span {
    display: none !important;
  }
  .catalog-summary a {
    margin-left: auto !important;
    font-size: .8rem !important;
  }

  /* Katalog utama: jarak samping dan card lebih rapat */
  .catalog.catalog-modern {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .catalog .grid,
  #catalog-grid {
    gap: 10px !important;
  }
  .catalog .card,
  #catalog-grid .card {
    border-radius: 17px !important;
    box-shadow: 0 7px 18px rgba(22,58,41,.055) !important;
  }
  .catalog .card-image,
  #catalog-grid .card-image {
    aspect-ratio: 4 / 5 !important;
    padding: 8px !important;
    background: #f6f7f3 !important;
  }
  .catalog .card-image img,
  #catalog-grid .card-image img {
    object-fit: contain !important;
  }
  .catalog .card-body,
  #catalog-grid .card-body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 198px !important;
    padding: 11px 10px 10px !important;
  }
  .catalog .card-body > p:first-child,
  #catalog-grid .card-body > p:first-child {
    margin: 0 0 7px !important;
    font-size: .67rem !important;
    letter-spacing: .05em !important;
  }
  .catalog .card h3,
  #catalog-grid .card h3 {
    min-height: 2.5em !important;
    margin: 0 0 8px !important;
    font-size: .9rem !important;
    line-height: 1.22 !important;
  }
  .catalog .card .desc,
  #catalog-grid .card .desc {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 1 !important;
    overflow: hidden !important;
    min-height: 1.35em !important;
    margin: 2px 0 !important;
    font-size: .7rem !important;
  }
  .catalog .product-desc-preview,
  #catalog-grid .product-desc-preview {
    display: none !important;
  }
  .catalog .card-bottom,
  #catalog-grid .card-bottom {
    margin-top: auto !important;
    padding-top: 9px !important;
    gap: 8px !important;
  }
  .catalog .card-bottom > strong,
  #catalog-grid .card-bottom > strong,
  .catalog .price-new,
  #catalog-grid .price-new {
    font-size: .93rem !important;
    line-height: 1.15 !important;
  }
  .catalog .card-bottom button,
  #catalog-grid .card-bottom button {
    min-height: 42px !important;
    border-radius: 12px !important;
    font-size: .78rem !important;
    font-weight: 800 !important;
  }

  /* Homepage: judul produk terlaris dan tombol dibuat tidak sesak */
  #katalog.catalog-modern {
    padding-top: 34px !important;
  }
  #katalog .section-head {
    display: block !important;
    margin-bottom: 18px !important;
  }
  #katalog .section-head .eyebrow {
    margin-bottom: 8px !important;
  }
  #katalog .section-head h2 {
    font-size: clamp(2rem, 10vw, 2.85rem) !important;
    line-height: 1 !important;
    margin: 0 0 12px !important;
  }
  #katalog .section-head p {
    font-size: .9rem !important;
    line-height: 1.55 !important;
    margin: 0 !important;
  }
  #katalog .catalog-head-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 17px !important;
  }
  #katalog .collection-count,
  #katalog .catalog-all-link {
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 14px !important;
    border-radius: 999px !important;
    font-size: .78rem !important;
    white-space: nowrap !important;
  }
  #katalog .catalog-all-link {
    flex: 1 !important;
    max-width: 190px !important;
  }
}

@media (max-width: 390px) {
  .catalog-hero { margin-left: 8px !important; margin-right: 8px !important; }
  .catalog.catalog-modern { padding-left: 8px !important; padding-right: 8px !important; }
  .catalog .grid, #catalog-grid { gap: 8px !important; }
  .catalog .card-body, #catalog-grid .card-body { padding: 9px 8px 9px !important; min-height: 190px !important; }
  .catalog .card h3, #catalog-grid .card h3 { font-size: .84rem !important; }
  .catalog .card-bottom > strong, #catalog-grid .card-bottom > strong { font-size: .88rem !important; }
}

/* Source: premium-ui-v1.css */
:root{--thb-green:#174f37;--thb-green2:#287b4c;--thb-cream:#fbfaf6;--thb-line:#dfe9df;--thb-ink:#183026;--thb-muted:#728078;--thb-accent:#b86d39;--thb-shadow:0 18px 50px rgba(23,79,55,.10)}
/* Premium hero */
.hero-split{position:relative;overflow:hidden;border-radius:28px;background:linear-gradient(135deg,#fffefb 0%,#f4f8f2 55%,#edf5ee 100%);border:1px solid var(--thb-line);box-shadow:var(--thb-shadow)}
.hero-split:before{content:"";position:absolute;width:340px;height:340px;border-radius:50%;right:-120px;top:-150px;background:radial-gradient(circle,rgba(40,123,76,.12),rgba(40,123,76,0) 68%);pointer-events:none}
.hero-copy-panel{position:relative;z-index:1}.hero-copy-panel h1{letter-spacing:-.035em}.hero-lead{max-width:640px;color:#5f7066}.primary-cta{box-shadow:0 10px 24px rgba(40,123,76,.20);transition:.2s ease}.primary-cta:hover{transform:translateY(-2px)}
.hero-showcase{background:rgba(255,255,255,.70);backdrop-filter:blur(10px);border-left:1px solid rgba(210,226,214,.9)}
/* Trust/benefit */
.benefit-strip{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px!important;background:transparent!important;border:0!important;padding:14px 0!important}
.benefit-strip>*{background:#fff;border:1px solid var(--thb-line);border-radius:16px;padding:15px 16px;box-shadow:0 8px 24px rgba(23,79,55,.055)}
/* Product cards */
.grid>.card,.catalog-card{border:1px solid #e2e9e1!important;border-radius:18px!important;background:#fff!important;overflow:hidden;box-shadow:0 8px 25px rgba(22,58,41,.055);transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease}
.grid>.card:hover,.catalog-card:hover{transform:translateY(-4px);box-shadow:0 18px 38px rgba(22,58,41,.11);border-color:#c8dbc9!important}
.card-image{background:#f6f5ef!important;overflow:hidden}.card-image img{transition:transform .3s ease}.card:hover .card-image img{transform:scale(1.025)}
.card-body h3{line-height:1.3}.card-body .desc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.card-bottom strong{color:var(--thb-accent);font-size:1.08em}.card-bottom button{border-radius:12px!important}
.bestseller-badge{border-radius:999px!important;box-shadow:0 6px 18px rgba(0,0,0,.08)}
/* Recently viewed */
.thb-recently{margin:42px auto 24px;max-width:1180px;padding:0 18px}.thb-recently[hidden]{display:none!important}.thb-recent-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:16px}.thb-recent-head h2{margin:4px 0 0;font-size:clamp(24px,3vw,38px);color:var(--thb-ink)}.thb-recent-head p{margin:0;color:var(--thb-muted);font-size:13px;letter-spacing:.08em;font-weight:700}.thb-recent-clear{border:0;background:transparent;color:#557266;font-weight:700;cursor:pointer}.thb-recent-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.thb-recent-card{display:grid;grid-template-columns:74px 1fr;gap:12px;align-items:center;padding:12px;border:1px solid var(--thb-line);border-radius:16px;background:#fff;box-shadow:0 8px 22px rgba(22,58,41,.055);cursor:pointer;text-align:left}.thb-recent-card img,.thb-recent-placeholder{width:74px;height:88px;object-fit:cover;border-radius:10px;background:#f3f2ec}.thb-recent-card strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:#1e3328}.thb-recent-card small{display:block;margin-top:7px;color:var(--thb-accent);font-weight:800}
/* Premium trust band injected before footer */
.thb-trust-band{max-width:1180px;margin:34px auto;padding:0 18px}.thb-trust-inner{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--thb-line);background:#f5f9f4;border-radius:20px;overflow:hidden}.thb-trust-item{padding:18px 20px;border-right:1px solid var(--thb-line)}.thb-trust-item:last-child{border-right:0}.thb-trust-item b{display:block;color:var(--thb-ink);margin-bottom:3px}.thb-trust-item span{font-size:13px;color:var(--thb-muted)}
/* Order timeline */
.tracking{max-width:820px!important;border-radius:24px!important;box-shadow:var(--thb-shadow)!important}.tracking h1{letter-spacing:-.03em}.tracking #steps{list-style:none;padding:0;margin:24px 0;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;counter-reset:step}.tracking #steps li{position:relative;margin:0!important;padding:42px 10px 12px!important;text-align:center;background:#f5f7f3!important;border:1px solid #e2e8e0;border-radius:14px!important;color:#718078!important}.tracking #steps li:before{counter-increment:step;content:counter(step);position:absolute;top:10px;left:50%;transform:translateX(-50%);width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#dfe8df;color:#54705d;font-size:12px;font-weight:800}.tracking #steps li.reached{background:#edf7ee!important;border-color:#bdd9c2!important;color:#205a32!important;font-weight:700}.tracking #steps li.reached:before{content:"✓";background:#287b4c;color:#fff}.event-card{box-shadow:0 5px 15px rgba(23,79,55,.045)}
@media(max-width:820px){.benefit-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.thb-recent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.thb-trust-inner{grid-template-columns:repeat(2,1fr)}.thb-trust-item:nth-child(2){border-right:0}.thb-trust-item:nth-child(-n+2){border-bottom:1px solid var(--thb-line)}.tracking #steps{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.hero-split{border-radius:20px}.hero-showcase{border-left:0;border-top:1px solid var(--thb-line)}.benefit-strip{grid-template-columns:1fr 1fr;gap:8px!important}.benefit-strip>*{padding:12px}.thb-recently{padding:0 12px}.thb-recent-grid{grid-template-columns:1fr 1fr;gap:8px}.thb-recent-card{grid-template-columns:1fr;padding:8px}.thb-recent-card img,.thb-recent-placeholder{width:100%;height:120px}.thb-trust-band{padding:0 12px}.thb-trust-inner{grid-template-columns:1fr 1fr}.thb-trust-item{padding:13px}.tracking #steps{grid-template-columns:1fr 1fr}.tracking #steps li{padding-top:38px!important}}

/* Source: cart-initial-hide.css */
/* Prevent cart FOUC/flash before cart.js converts it into a side drawer. */
.cart-section:not(.cart-drawer-ready){
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}
/* Once JS prepares the drawer, existing side-drawer CSS takes over. */
.cart-section.cart-drawer-ready{
  visibility:visible !important;
  opacity:1 !important;
}

/* Source: discount-ui.css */
.discount-price{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;line-height:1.2}.discount-price .discount-old{font-size:.78em;font-weight:600;color:#8a958d;text-decoration:line-through;text-decoration-thickness:1.5px}.discount-price .discount-new{font-weight:850;color:#17663c}.discount-price .discount-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#eef7ef;color:#17663c;font-size:11px;font-weight:850;letter-spacing:.02em;white-space:nowrap}.card-bottom>.discount-price,.featured-foot>.discount-price{max-width:70%}.card-bottom>.discount-price{align-items:flex-start;flex-direction:column;gap:4px}.featured-foot>.discount-price{gap:6px}.product-discount-tag{position:absolute;z-index:5;top:12px;left:12px;padding:7px 10px;border-radius:999px;background:#17663c;color:#fff;font-size:11px;font-weight:900;box-shadow:0 5px 18px rgba(23,102,60,.18)}
#detail-price .discount-old{display:block;font-size:13px;color:#8a958d;text-decoration:line-through;margin-bottom:3px}#detail-price .discount-new{display:inline-block;font-size:24px;color:#17663c;font-weight:900}#detail-price .discount-badge{margin-left:8px;vertical-align:middle}
@media(max-width:640px){.discount-price{gap:5px}.discount-price .discount-badge{font-size:9px;padding:3px 6px}.card-bottom>.discount-price{max-width:58%}.discount-price .discount-new{font-size:.96em}}

/* Source: discount-storefront-v2.css */
.discount-price{display:flex;align-items:center;gap:8px;flex-wrap:wrap;line-height:1.15}.discount-price .discount-old{text-decoration:line-through;color:#909a93;font-size:.78em;font-weight:600}.discount-price .discount-new{color:#17663c;font-weight:900}.discount-price .discount-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#e9f6ed;color:#17663c;font-size:.68rem;font-weight:900;white-space:nowrap}.card-bottom .discount-price{max-width:65%}.card-bottom .discount-new{font-size:1rem}.hero-discount-price{margin-top:6px}.hero-discount-price .discount-new{font-size:1.1rem}.detail-copy #detail-price{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.detail-copy #detail-price .discount-old{text-decoration:line-through;color:#8d978f;font-size:.85rem}.detail-copy #detail-price .discount-new{font-size:1.35rem;color:#17663c;font-weight:900}@media(max-width:640px){.card-bottom .discount-price{max-width:60%;gap:4px}.discount-price .discount-badge{font-size:.6rem;padding:3px 5px}.card-bottom .discount-old{font-size:.65rem}.card-bottom .discount-new{font-size:.88rem}}

/* Source: discount-storefront-v3.css */
.discount-price{display:inline-flex;align-items:baseline;gap:10px;flex-wrap:wrap;line-height:1.15}
.discount-price .discount-old{text-decoration:line-through;color:#929b95;font-size:.78em;font-weight:600;white-space:nowrap}
.discount-price .discount-new{color:#17663c;font-weight:900;white-space:nowrap}
.discount-price .discount-badge{display:none!important}
.card-bottom .discount-price{max-width:70%}
.card-bottom .discount-new{font-size:1rem}
.hero-discount-price{margin-top:6px}
.hero-discount-price .discount-new{font-size:1.1rem}
.detail-copy #detail-price{display:flex!important;align-items:baseline!important;gap:12px!important;flex-wrap:wrap!important}
.detail-copy #detail-price .discount-old{text-decoration:line-through;color:#8d978f;font-size:.92rem;font-weight:600;white-space:nowrap}
.detail-copy #detail-price .discount-new{font-size:1.35rem;color:#17663c;font-weight:900;white-space:nowrap}
.detail-copy #detail-price .discount-badge{display:none!important}
@media(max-width:640px){
  .card-bottom .discount-price{max-width:64%;gap:6px}
  .card-bottom .discount-old{font-size:.66rem}
  .card-bottom .discount-new{font-size:.9rem}
  .detail-copy #detail-price{gap:8px!important}
  .detail-copy #detail-price .discount-old{font-size:.8rem}
  .detail-copy #detail-price .discount-new{font-size:1.15rem}
}

/* Source: discount-photo-badge.css */
/* THB compact discount badge on product photos (home + catalog) */
#thb-new .n-card .n-card-img .thb-photo-discount-badge,
#catalog-grid .catalog-card .card-image .thb-photo-discount-badge {
  position: absolute !important;
  z-index: 8 !important;
  top: 8px !important;
  left: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  max-width: 74% !important;
  padding: 4px 7px !important;
  border: 1px solid rgba(255,255,255,.82) !important;
  border-radius: 7px !important;
  background: linear-gradient(135deg, #cf4842 0%, #b82f32 100%) !important;
  color: #fff !important;
  font-family: Figtree, system-ui, -apple-system, sans-serif !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: .015em !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  box-shadow: 0 3px 9px rgba(91, 31, 29, .18) !important;
  pointer-events: none !important;
}

/* The discount is presented over the image, not repeated beside the price. */
#thb-new .n-card .thb-home-card-price .discount-label,
#catalog-grid .catalog-card .catalog-card-price .discount-label {
  display: none !important;
}

/* Avoid overlap with the sales-count chip when a product has a discount badge. */
#thb-new .n-card .n-card-img .n-sold.thb-n-sold-with-discount {
  top: 36px !important;
}

@media (max-width: 640px) {
  #thb-new .n-card .n-card-img .thb-photo-discount-badge,
  #catalog-grid .catalog-card .card-image .thb-photo-discount-badge {
    top: 6px !important;
    left: 6px !important;
    max-width: 76% !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
    font-size: 8px !important;
  }
  #thb-new .n-card .n-card-img .n-sold.thb-n-sold-with-discount {
    top: 31px !important;
  }
}

/* Source: product-card-uniform-v1.css */
/* Samakan posisi dan ukuran tombol aksi pada semua kartu produk */
.grid .card,
#catalog-grid .card{
  height:100%;
  display:flex;
  flex-direction:column;
}
.grid .card-body,
#catalog-grid .card-body{
  flex:1;
  display:flex;
  flex-direction:column;
}
.grid .card-bottom,
#catalog-grid .card-bottom{
  margin-top:auto !important;
  min-height:52px;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 104px;
  align-items:end !important;
  gap:12px !important;
}
.grid .card-bottom > form,
#catalog-grid .card-bottom > form{
  width:104px;
  margin:0;
}
.grid .card-bottom button,
#catalog-grid .card-bottom button,
.grid .card-bottom .product-open,
#catalog-grid .card-bottom .product-open{
  width:104px !important;
  min-width:104px !important;
  height:42px !important;
  min-height:42px !important;
  margin:0 !important;
  padding:0 10px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  white-space:nowrap;
  line-height:1 !important;
  border-radius:12px !important;
  font-size:13px !important;
  font-weight:800 !important;
}
.grid .card-bottom > strong,
#catalog-grid .card-bottom > strong,
.grid .card-bottom > .discount-price,
#catalog-grid .card-bottom > .discount-price{
  align-self:center;
  margin:0 !important;
  min-width:0;
}
.grid .card .desc,
#catalog-grid .card .desc{
  min-height:38px;
}
@media(max-width:640px){
  .grid .card-bottom,
  #catalog-grid .card-bottom{
    grid-template-columns:minmax(0,1fr) 88px !important;
    min-height:46px;
    gap:7px !important;
  }
  .grid .card-bottom > form,
  #catalog-grid .card-bottom > form{
    width:88px;
  }
  .grid .card-bottom button,
  #catalog-grid .card-bottom button,
  .grid .card-bottom .product-open,
  #catalog-grid .card-bottom .product-open{
    width:88px !important;
    min-width:88px !important;
    height:38px !important;
    min-height:38px !important;
    padding:0 7px !important;
    font-size:11px !important;
  }
  .grid .card .desc,
  #catalog-grid .card .desc{
    min-height:34px;
  }
}


/* THB mobile fix: beri jarak antara harga dan tombol pada kartu produk */
.grid .card-bottom,
#catalog-grid .card-bottom{
  column-gap:14px !important;
}
.grid .card-bottom > .discount-price,
#catalog-grid .card-bottom > .discount-price,
.grid .card-bottom > strong,
#catalog-grid .card-bottom > strong{
  display:block !important;
  min-width:0 !important;
  max-width:100% !important;
  padding-right:2px !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  line-height:1.2 !important;
}
.grid .card-bottom .discount-new,
#catalog-grid .card-bottom .discount-new{
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
@media(max-width:640px){
  .grid .card-bottom,
  #catalog-grid .card-bottom{
    grid-template-columns:minmax(0,1fr) 86px !important;
    column-gap:12px !important;
    align-items:center !important;
  }
  .grid .card-bottom > form,
  #catalog-grid .card-bottom > form{
    width:86px !important;
    min-width:86px !important;
  }
  .grid .card-bottom button,
  #catalog-grid .card-bottom button,
  .grid .card-bottom .product-open,
  #catalog-grid .card-bottom .product-open{
    width:86px !important;
    min-width:86px !important;
    font-size:11px !important;
    padding-inline:5px !important;
  }
  .grid .card-bottom > .discount-price,
  #catalog-grid .card-bottom > .discount-price{
    font-size:clamp(13px,3.8vw,16px) !important;
  }
}

/* Katalog.php: ruang harga dan tombol lebih aman pada kartu dua kolom di HP */
#catalog-grid .catalog-card .card-bottom {
  grid-template-columns: minmax(0, 1fr) 86px !important;
  column-gap: 12px !important;
  align-items: center !important;
}
#catalog-grid .catalog-card .card-bottom > .discount-price,
#catalog-grid .catalog-card .card-bottom > strong {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.2 !important;
}
#catalog-grid .catalog-card .card-bottom > form,
#catalog-grid .catalog-card .card-bottom > .product-open {
  width: 86px !important;
  min-width: 86px !important;
}
@media (max-width: 640px) {
  #catalog-grid .catalog-card .card-bottom > .discount-price,
  #catalog-grid .catalog-card .card-bottom > strong {
    font-size: clamp(12px, 3.5vw, 15px) !important;
  }
  #catalog-grid .catalog-card .card-bottom button,
  #catalog-grid .catalog-card .card-bottom .product-open {
    font-size: 11px !important;
    padding-inline: 4px !important;
  }
}

/* Source: cart-badge-fix-v1.css */

/* Keranjang badge: selalu terlihat dan stabil */
.main-nav .nav-cart .cart-count-badge,
.cart-link .cart-count-badge{
  display:inline-grid!important;
  place-items:center!important;
  min-width:30px!important;
  height:30px!important;
  padding:0 8px!important;
  margin-left:4px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.18)!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1!important;
  opacity:1!important;
  visibility:visible!important;
  text-indent:0!important;
}
@media(max-width:760px){
  .main-nav .nav-cart .cart-count-badge,
  .cart-link .cart-count-badge{
    min-width:25px!important;
    height:25px!important;
    padding:0 6px!important;
    font-size:11px!important;
  }
}
