*{ box-sizing:border-box; }
body{ margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; background:#faf8f9; color:#2a2a2a; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

.store-header{ background:#fff; border-bottom:1px solid #eee; position:sticky; top:0; z-index:10; }
.store-header-inner{ max-width:1000px; margin:0 auto; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.store-brand{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:18px; color: var(--store-theme, #6b2d5c); }
.store-brand img{ width:36px; height:36px; object-fit:cover; border-radius:8px; }
.store-brand-ico{ font-size:24px; }
.store-nav{ display:flex; align-items:center; gap:16px; font-size:14px; }
.store-cart-link{ display:flex; align-items:center; gap:4px; font-weight:600; }
.store-cart-count{ background: var(--store-theme, #6b2d5c); color:#fff; border-radius:999px; padding:1px 7px; font-size:12px; }

.store-main{ max-width:1000px; margin:0 auto; padding:20px 16px 60px; min-height:60vh; }
.store-loading{ text-align:center; padding:60px 0; color:#999; }
.store-empty{ text-align:center; padding:60px 20px; color:#888; }
.store-empty a{ color: var(--store-theme, #6b2d5c); font-weight:600; }

.store-banner{ text-align:center; padding:24px 0; background-size:cover; background-position:center; border-radius:10px; }
.store-banner[style*="background-image"]{ padding:56px 20px; }
.store-banner[style*="background-image"] h1{ color:#fff; text-shadow:0 1px 4px rgba(0,0,0,.5); }
.store-banner[style*="background-image"] p{ color:#f2f2f2; text-shadow:0 1px 4px rgba(0,0,0,.5); }
.store-banner h1{ margin:0 0 6px; font-size:26px; }
.store-banner p{ margin:0; color:#777; }

/* Sliding banner carousel */
.store-carousel{ position:relative; border-radius:12px; overflow:hidden; margin-bottom:14px; background:#f3eef0; }
.store-carousel-track{ display:flex; transition:transform .4s ease; }
.store-carousel-slide{ flex:0 0 100%; display:block; aspect-ratio:16/6; min-height:120px; }
.store-carousel-slide img{ width:100%; height:100%; object-fit:cover; }
.store-carousel-arrow{ position:absolute; top:50%; transform:translateY(-50%); background:rgba(0,0,0,.35); color:#fff; border:none; width:32px; height:32px; border-radius:50%; font-size:20px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.store-carousel-prev{ left:10px; }
.store-carousel-next{ right:10px; }
.store-carousel-dots{ position:absolute; bottom:10px; left:0; right:0; display:flex; justify-content:center; gap:6px; }
.store-carousel-dot{ width:7px; height:7px; border-radius:50%; border:none; background:rgba(255,255,255,.6); cursor:pointer; padding:0; }
.store-carousel-dot.active{ background:#fff; width:18px; border-radius:4px; }

.store-section{ margin-bottom:22px; }
.store-section-title{ font-size:16px; margin:0 0 10px; }

.store-hotcats{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; }
.store-hotcat-tile{ flex-shrink:0; width:88px; background:#fff; border:1px solid #eee; border-radius:12px; padding:10px 6px; text-align:center; cursor:pointer; font-family:inherit; }
.store-hotcat-ico{ font-size:22px; }
.store-hotcat-name{ font-size:12px; font-weight:600; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.store-hotcat-count{ font-size:10px; color:#999; margin-top:2px; }

.store-rail{ display:flex; gap:12px; overflow-x:auto; padding-bottom:4px; }
.store-rail .store-card{ flex:0 0 130px; }

/* Sits between .store-main and the footer on every page (see the empty
   container in store.php + storeRenderRecentlyViewed in store.js) —
   its own container rather than reusing .store-main, since that class
   carries a large bottom padding and min-height:60vh meant for actual
   page content, both wrong for a small trailing band that collapses
   to nothing when there's no viewing history yet. */
.store-recently-viewed{ max-width:1000px; margin:0 auto; padding:0 16px; }
.store-recently-viewed:empty{ padding:0; }

.store-ad-slot{ margin:0 0 20px; text-align:center; }
.store-ad-slot img{ max-width:100%; border-radius:12px; display:inline-block; }
.store-ad-slot a{ display:inline-block; max-width:100%; }

/* Full-bleed colored band per category (see storeCategoryRowHtml in
   store.js) — negative margin cancels out .store-main's own 16px side
   padding so the color runs edge-to-edge like the reference layout,
   while the header/rail inside stay aligned with the rest of the page
   via their own matching padding. */
.store-cat-row{ margin:0 -16px 18px; padding:18px 16px; }
.store-cat-row-header{ display:flex; align-items:center; justify-content:space-between; cursor:pointer; margin-bottom:12px; }
.store-cat-row-header h2{ margin:0; font-size:20px; line-height:1.2; }
.store-cat-row-header p{ margin:2px 0 0; font-size:13px; opacity:.8; }
.store-cat-row-arrow{ flex-shrink:0; width:40px; height:40px; border-radius:50%; border:none; background:rgba(255,255,255,.9); color:#333; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.store-cat-row-rail{ display:flex; gap:10px; overflow-x:auto; padding-bottom:2px; }
.store-cat-row-rail .store-card{ flex:0 0 130px; }
@media (min-width:640px){ .store-cat-row{ margin:0 0 20px; border-radius:16px; } }

.store-search{ margin-bottom:14px; }
.store-search input{ width:100%; padding:12px 14px; border:1px solid #ddd; border-radius:10px; font-size:15px; }

.store-cats{ display:flex; gap:8px; overflow-x:auto; padding:8px 0; margin-bottom:14px; position:sticky; z-index:9; background:#faf8f9; }
.store-cat-pill{ flex-shrink:0; padding:7px 14px; border-radius:999px; border:1px solid #ddd; background:#fff; font-size:13px; cursor:pointer; }
.store-cat-pill.active{ background: var(--store-theme, #6b2d5c); border-color: var(--store-theme, #6b2d5c); color:#fff; }

.store-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:14px; }
.store-card{ background:#fff; border:1px solid #eee; border-radius:12px; padding:10px; display:block; }
.store-card img, .store-card-ph{ width:100%; aspect-ratio:1; object-fit:cover; border-radius:8px; background:#f3eef0; }
.store-card-ph{ display:flex; align-items:center; justify-content:center; font-size:28px; }
.store-card-name{ font-size:13px; margin-top:8px; line-height:1.3; min-height:34px; }
.store-card-price{ font-weight:700; color: var(--store-theme, #6b2d5c); margin-top:4px; }
.store-card-was-row, .store-product-was-row{ display:flex; align-items:center; gap:6px; margin-top:2px; }
.store-was-price{ color:#999; text-decoration:line-through; font-size:12.5px; }
.store-discount-badge{ background:#e9f7ef; color:#1E8449; font-size:11px; font-weight:700; padding:1px 6px; border-radius:4px; }
.store-discount-badge-lg{ font-size:13px; padding:2px 8px; }
.store-card-oos{ font-size:11px; color:#c0392b; margin-top:2px; }

.store-back{ display:inline-block; margin-bottom:14px; color: var(--store-theme, #6b2d5c); font-weight:600; }
.store-product{ display:flex; flex-direction:column; gap:16px; }
.store-product img, .store-product-ph{ width:100%; max-width:320px; aspect-ratio:1; object-fit:cover; border-radius:12px; background:#f3eef0; }
.store-product-ph{ display:flex; align-items:center; justify-content:center; font-size:48px; }
.store-gallery{ width:100%; max-width:320px; }
.store-gallery .store-gallery-main{ width:100%; max-width:none; }
.store-thumbs{ display:flex; gap:8px; margin-top:8px; }
.store-product .store-thumbs .store-thumb{ width:64px; max-width:64px; height:64px; aspect-ratio:1; border-radius:8px; cursor:pointer; opacity:.65; border:2px solid transparent; flex-shrink:0; }
.store-product .store-thumbs .store-thumb.active{ opacity:1; border-color: var(--store-theme, #6b2d5c); }
.store-product-info h2{ margin:0 0 8px; }
.store-product-price{ font-size:22px; font-weight:700; color: var(--store-theme, #6b2d5c); }
.store-product-stock{ color:#777; font-size:13px; margin:6px 0 14px; }
.store-product-desc p{ line-height:1.6; color:#444; white-space:pre-line; }
.store-qty-row{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.store-qty-row input{ width:70px; padding:8px; border:1px solid #ddd; border-radius:8px; }

.store-btn-primary{ background: var(--store-theme, #6b2d5c); color:#fff; border:none; padding:13px 20px; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer; display:inline-block; text-align:center; }
.store-btn-primary:disabled{ opacity:.5; cursor:not-allowed; }

.store-cart-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.store-cart-item{ display:grid; grid-template-columns:50px 1fr 60px 70px 30px; align-items:center; gap:10px; background:#fff; border:1px solid #eee; border-radius:10px; padding:8px; }
.store-cart-item img, .store-cart-item .store-card-ph{ width:50px; height:50px; border-radius:6px; object-fit:cover; }
.store-cart-item-name{ font-size:13px; }
.store-cart-qty{ width:100%; padding:6px; border:1px solid #ddd; border-radius:6px; }
.store-cart-item-price{ font-weight:700; font-size:13px; text-align:right; }
.store-cart-remove{ background:none; border:none; color:#c0392b; font-size:16px; cursor:pointer; }
.store-cart-total{ font-size:18px; margin-bottom:16px; }

.store-checkout-summary{ background:#fff; border:1px solid #eee; border-radius:10px; padding:14px; margin-bottom:16px; font-size:14px; }
.store-checkout-summary > div{ display:flex; justify-content:space-between; padding:4px 0; }
.store-checkout-total{ display:flex; justify-content:space-between; font-size:16px; margin-top:8px; padding-top:8px; border-top:1px solid #eee; }

.store-form{ display:flex; flex-direction:column; gap:14px; max-width:480px; }
.store-form label{ display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color:#555; }
.store-form input, .store-form textarea, .store-form select{ padding:11px 12px; border:1px solid #ddd; border-radius:8px; font-size:15px; font-family:inherit; font-weight:400; color:#222; }
.store-form textarea{ min-height:70px; resize:vertical; }

.store-confirm{ text-align:center; padding:40px 20px; }
.store-confirm-ico{ font-size:48px; margin-bottom:10px; }
.store-confirm p{ color:#666; }

.store-track-result{ background:#fff; border:1px solid #eee; border-radius:10px; padding:16px; margin-top:16px; font-size:14px; }
.store-track-result > div{ padding:4px 0; }

.alert-error{ background:#fdecea; color:#c0392b; padding:10px 12px; border-radius:8px; font-size:13px; }
.alert-success{ background:#eaf7ed; color:#1a7a3c; padding:10px 12px; border-radius:8px; font-size:13px; }
.muted{ color:#888; }

/* Account / auth */
.store-auth-tabs{ display:flex; gap:4px; margin-bottom:18px; border-bottom:1px solid #eee; max-width:480px; }
.store-auth-tab{ flex:1; padding:10px; background:none; border:none; border-bottom:2px solid transparent; font-size:14px; font-weight:600; color:#999; cursor:pointer; font-family:inherit; }
.store-auth-tab.active{ color: var(--store-theme, #6b2d5c); border-bottom-color: var(--store-theme, #6b2d5c); }
.store-account-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.store-account-head h2{ margin:0; }
.btn-link{ background:none; border:none; color: var(--store-theme, #6b2d5c); font-size:13px; font-weight:600; cursor:pointer; padding:0; font-family:inherit; }
.store-order-row{ display:flex; justify-content:space-between; align-items:center; background:#fff; border:1px solid #eee; border-radius:10px; padding:12px 14px; margin-bottom:8px; font-size:14px; }

.store-footer{ max-width:1000px; margin:0 auto; padding:24px 16px 40px; text-align:center; color:#888; font-size:13px; border-top:1px solid #eee; margin-top:30px; }
.store-footer-contact{ display:flex; justify-content:center; gap:16px; flex-wrap:wrap; }
.store-powered-by{ margin-top:10px; opacity:.6; }

@media (min-width: 640px){
  .store-product{ flex-direction:row; }
  .store-product img, .store-product-ph{ width:320px; flex-shrink:0; }
  .store-gallery{ width:320px; flex-shrink:0; }
}


/* ---------- Ratings ---------- */
.store-star{ color:#d0d0d6; }
.store-star.on{ color:#f5a623; }
.store-card-rating{ font-size:12px; margin-top:2px; }
.store-rating-count{ color:#777; font-size:12px; }
.store-rating-none{ color:#888; font-size:13px; }
.store-rating-summary{ margin:2px 0 6px; font-size:15px; }
.store-rate-box textarea{ width:100%; min-height:70px; margin:8px 0; padding:8px; border:1px solid #ddd; border-radius:8px; font:inherit; box-sizing:border-box; }
.store-rate-stars{ display:flex; gap:4px; }
.store-rate-star{ background:none; border:0; padding:0 2px; font-size:32px; line-height:1; color:#d0d0d6; cursor:pointer; }
.store-rate-star.on{ color:#f5a623; }
.store-rate-msg{ min-height:18px; margin-top:6px; font-size:13px; }
.store-rate-msg.ok{ color:#1a7a3c; }
.store-rate-msg.err{ color:#a23931; }
.store-reviews{ margin-top:14px; }
.store-review{ padding:10px 0; border-top:1px solid #eee; font-size:14px; }


/* ==== Mobile polish (Main 113) ==== */
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ overflow-x:hidden; }
/* 16px text so iPhones do not zoom in when a box is tapped */
@media (max-width:1080px){
  .store-search input, .store-form input, .store-form textarea, .store-form select, .store-qty-row input{ font-size:16px; }
}
.store-form input, .store-form textarea, .store-form select{ min-width:0; max-width:100%; }
.store-form input[type="date"]{ -webkit-appearance:none; appearance:none; min-height:46px; text-align:left; }
.store-form input[type="date"]::-webkit-date-and-time-value{ text-align:left; min-height:1.3em; }
