@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;900&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f5f6fa; color: #222; font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif; }

/* HEADER */
.site-header { background: #1a3c6b; color: #fff; padding: 0; }
.header { background: #1a3c6b; color: #fff; padding: 0; }
.header-top { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-logo { font-size: 22px; font-weight: 900; letter-spacing: 1px; color: #fff; text-decoration: none; }
.header-logo span { color: #d4af37; }
.header-sub { font-size: 11px; color: rgba(255,255,255,0.7); }
.header-trust { background: #0f2a4e; }
.header-trust-inner { max-width: 1200px; margin: 0 auto; padding: 8px 24px; display: flex; gap: 20px; flex-wrap: wrap; }
.trust-badge { font-size: 11px; color: #a8d4ff; }
.trust-badge::before { content: '✓ '; color: #4caf50; font-weight: 900; }
.back { color: #1a3c6b; text-decoration: none; font-size: 14px; font-weight: 800; background: #d4af37; border: none; padding: 10px 20px; border-radius: 8px; transition: all 0.15s; letter-spacing: 0.5px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap; }
.back:hover { background: #f0c842; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
@media(max-width:600px) { .header-sub { display: none; } .header-top { padding: 12px 16px; } .header-trust-inner { padding: 6px 16px; } }

/* BANNER */
.banner { background: #fff; padding: 28px 24px 20px; border-bottom: 2px solid #e8edf5; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.banner-inner { max-width: 1200px; margin: 0 auto; }
.breadcrumb { color: #888; font-size: 12px; margin-bottom: 10px; }
.breadcrumb a { color: #1a3c6b; text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.banner h1 { font-size: 26px; font-weight: 900; color: #1a3c6b; letter-spacing: 1px; text-transform: uppercase; }
.banner p { color: #777; margin-top: 6px; font-size: 13px; }



/* CATEGORY CARDS (sub-nav) */
.cat-card { background: #fff; border: 2px solid #e0e8f4; border-radius: 12px; padding: 24px 16px; text-align: center; text-decoration: none; transition: all 0.15s; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.cat-card:hover { transform: translateY(-3px); border-color: #1a3c6b; box-shadow: 0 6px 16px rgba(26,60,107,0.15); }
.emoji { font-size: 36px; margin-bottom: 10px; }
.cat-name { font-size: 16px; font-weight: 800; color: #1a3c6b; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.cat-desc { font-size: 12px; color: #888; line-height: 1.5; }


.card-sku { font-size: 10px; color: #1a3c6b; font-weight: 800; letter-spacing: 1.5px; background: #e8f0fb; display: inline-block; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; }
.card-name { font-size: 13px; font-weight: 700; color: #111; line-height: 1.4; margin-bottom: 10px; flex: 1; }
.card-prices { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.price-rt { font-size: 11px; color: #aaa; text-decoration: line-through; }
.price-ws { font-size: 16px; color: #2e7d32; font-weight: 900; }
.quick-add-btn { width: 100%; padding: 10px; background: #ff6600; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 900; cursor: pointer; font-family: 'Poppins', sans-serif; transition: background 0.15s; }
.quick-add-btn:hover { background: #e55a00; }

/* FOOTER */
.footer { text-align: center; padding: 28px; border-top: 1px solid #e0e8f0; color: #aaa; font-size: 12px; margin-top: 20px; background: #f0f4fa; }

/* TARGET HIGHLIGHT */
.card:target { outline: 3px solid #1a3c6b; box-shadow: 0 0 20px rgba(26,60,107,0.4); animation: targetPulse 1.5s ease-out; }
@keyframes targetPulse { 0% { box-shadow: 0 0 30px rgba(26,60,107,0.8); } 100% { box-shadow: 0 0 20px rgba(26,60,107,0.3); } }

/* RESPONSIVE */
@media(max-width: 600px) {
  .header-inner, .banner, .trust-bar { padding-left: 16px; padding-right: 16px; }
  .grid { padding: 16px; grid-template-columns: 1fr 1fr; gap: 12px; }
  .banner h1 { font-size: 20px; }
}

/* ── TOOLBAR ── */
.toolbar { max-width: 1200px; margin: 0 auto; padding: 16px 24px 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 180px; padding: 11px 16px 11px 38px; border: 2px solid #dde4f0; border-radius: 8px; font-size: 14px; font-family: 'Poppins', sans-serif; background: #fff; color: #222; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231a3c6b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.toolbar input:focus { border-color: #1a3c6b; }
.count { font-size: 13px; color: #888; font-weight: 600; white-space: nowrap; }

/* ── PRODUCT INFO (inside cards) ── */
.info { padding: 12px; }
.sku { font-size: 10px; color: #1a3c6b; font-weight: 800; letter-spacing: 1.5px; background: #e8f0fb; display: inline-block; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; }
.pname { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 8px; line-height: 1.4; }
.price-ws { font-size: 15px; color: #2e7d32; font-weight: 900; margin-bottom: 2px; }
.price-ws b { font-size: 16px; }
.price-rt { font-size: 11px; color: #aaa; text-decoration: line-through; margin-bottom: 4px; }
.col-count { font-size: 11px; color: #888; line-height: 1.5; }

/* ── MODAL OVERLAY ── */
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.overlay.active { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 24px 20px; width: 100%; max-width: 440px; max-height: 95vh; overflow-y: auto; position: relative; box-shadow: 0 8px 40px rgba(0,0,0,0.25); font-family: 'Poppins', sans-serif; }
.modal-close { position: absolute; top: 14px; right: 14px; background: #f0f4ff; border: none; color: #1a3c6b; font-size: 18px; font-weight: 900; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; z-index: 10; line-height: 32px; text-align: center; padding: 0; }
.modal-close:hover { background: #1a3c6b; color: #fff; }
.modal-title { font-size: 15px; font-weight: 900; color: #1a3c6b; margin-bottom: 12px; padding-right: 40px; line-height: 1.4; }
.modal-main { width: 100%; border-radius: 10px; object-fit: contain; max-height: 250px; background: #f5f6fa; display: block; margin: 0 auto; }
.thumb-grid { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 8px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
.thumb-grid::-webkit-scrollbar { height: 4px; }
.thumb-grid::-webkit-scrollbar-thumb { background: #1a3c6b; border-radius: 4px; }
.thumb-grid img { width: 50px; height: 50px; flex: 0 0 50px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid #eee; transition: all 0.1s; }
.thumb-grid img.active { border-color: #1a3c6b; transform: scale(1.05); }
#modalSkuAction { margin-top: 16px; }

@media(max-width: 600px) {
  .grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding: 10px !important; }
  .card img { min-height: 150px !important; }
}


/* ── AGGRESSIVE GRID & CARD FIX ── */
.grid { 
  display: grid !important; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; 
  gap: 20px !important; 
  padding: 24px !important; 
  align-items: start !important;
}

.card { 
  background: #fff !important; 
  border: 1px solid #e0e8f0 !important; 
  border-radius: 12px !important; 
  overflow: hidden !important; 
  display: flex !important; 
  flex-direction: column !important; 
  height: 420px !important; /* Fixed total height for all cards */
  width: 100% !important;
  position: relative !important;
}

.card img { 
  width: 100% !important; 
  height: 250px !important; /* Fixed height for image area */
  object-fit: contain !important; 
  background: #fff !important; 
  display: block !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.card-body { 
  padding: 12px !important; 
  flex: 1 !important; 
  display: flex !important; 
  flex-direction: column !important; 
  justify-content: space-between !important;
  overflow: hidden !important;
}

@media(max-width: 600px) {
  .grid { 
    grid-template-columns: 1fr 1fr !important; 
    gap: 10px !important; 
    padding: 10px !important; 
  }
  .card { 
    height: 350px !important; /* Smaller fixed height for mobile */
  }
  .card img { 
    height: 180px !important; 
  }
}

/* MODAL GALLERY FIX */
.modal-gallery { position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #f5f6fa; }
.modal-gallery .modal-main,
.modal-gallery img#modalMain { width: 100% !important; height: auto !important; max-height: 300px !important; object-fit: contain !important; display: block !important; border-radius: 10px; background: #f5f6fa; }
.modal-main-wrap { position: relative; width: 100%; }
.gal-nav { background: rgba(26,60,107,0.8); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 18px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; }
.gal-nav:disabled { opacity: 0.3; }
.gal-counter { font-size: 11px; color: #888; text-align: center; margin-top: 4px; }

/* THUMB GRID FORCE SMALL */
.thumb-grid img, #thumbGrid img {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  border: 2px solid #eee !important;
}
