/* ===============================
SW Graphix — Site Styles (revised, clean)
Path: /assets/css/style.css
================================= */

/* ----- Default Colors (kept) ----- */
:root {
  --primary-color: #0000FF; /* Blue */
  --secondary-color: #FF0000; /* Red */
  --tertiary-color: #808080;  /* Grey */
  --border: #eaeaea;
  --text: #333;
}

/* ===============================
   HEADER (v3 — unified, no conflicts)
   =============================== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: saturate(180%) blur(6px);
}

/* Grid layout: logo (left), nav (center), cart (right) */
.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 96px;
}

/* Logo */
.brand { display: inline-flex; align-items: center; min-width: 0; }
.brand__logo {
  height: 88px; width: auto; display: block;
  object-fit: contain;
}

/* Primary nav */
.nav {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Uniform pill buttons */
.btn-nav {
  --btn-h: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-h); line-height: 1; padding: 0 16px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  color: #111; background: #f7f7f9;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-nav:hover { background: #fff; border-color: rgba(0,0,0,0.14); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.btn-nav:active { transform: translateY(1px); }
.btn-nav:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.btn-nav.is-placeholder {
  opacity: .55; cursor: not-allowed;
  background: #f1f1f4; border-style: dashed;
}

/* Actions (cart) */
.header-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* Cart link — styled to match buttons, highlighted with primary color */
.sw-cart-link {
  --btn-h: 44px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--btn-h); padding: 0 14px;
  border-radius: 999px; text-decoration: none;
  background: var(--primary-color, #0000FF);
  color: #fff; font-weight: 700; letter-spacing: .2px;
  transition: transform .08s ease, filter .2s ease, box-shadow .2s ease;
}
.sw-cart-link:hover { filter: brightness(1.06); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.sw-cart-link:active { transform: translateY(1px); }
.sw-cart-icon { font-size: 18px; line-height: 1; }
.sw-cart-text { display: inline-block; }
.sw-cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; min-width: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--secondary-color, #FF0000); color: #fff; font-size: 12px; font-weight: 800;
}

/* Container breathing room in header */
.site-header .container { padding-top: 8px; padding-bottom: 8px; }

/* Active/current page style (optional) */
.btn-nav[aria-current="page"] {
  background: #fff; border-color: rgba(0,0,0,0.18);
  box-shadow: inset 0 0 0 2px var(--primary-color, #0000FF);
}

/* Responsive tweaks */
@media (max-width: 992px) {
  .brand__logo { height: 76px; }
  .header-grid { min-height: 88px; }
}
@media (max-width: 768px) {
  .header-grid { grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand__logo { height: 64px; }
  .nav { gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .btn-nav, .sw-cart-link { --btn-h: 40px; font-size: 14px; padding: 0 14px; }
}
@media (max-width: 420px) {
  .brand__logo { height: 56px; }
  .btn-nav, .sw-cart-link { --btn-h: 38px; font-size: 13.5px; }
}

/* ===============================
   GLOBAL (kept, with header fix)
   =============================== */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: var(--text);
}

/* Remove generic header styling that conflicted with .site-header */
/* (If you need a dark footer/header elsewhere, target that element specifically) */

/* Footer */
footer {
  background-color: var(--tertiary-color);
  color: white;
  padding: 20px;
  text-align: center;
}

/* ===============================================
   LOGO SAFEGUARDS — keep other logos sane
   (do NOT cap .brand__logo used in header)
   =============================================== */
img[class*="logo"], .logo, .brand-logo {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
}
.brand__logo { max-width: 100%; } /* no max-height here — header controls it */

/* ====== PRODUCT CARDS (kept) ====== */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  justify-content: center;
  align-items: start;
}
.product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
  min-height: 210px;
}
.product:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: #bbb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}
.product img {
  display: block;
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0;
  border-radius: 6px;
}
.product-name {
  font-weight: 600;
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  color: #333;
  word-break: break-word;
}
.product-sub {
  font-size: 12px;
  color: #666;
}

/* ====== MODAL (kept) ====== */
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); justify-content: center; align-items: center; z-index: 1000;
}
.modal-content {
  background: #fff; padding: 20px; max-width: 950px; width: 90%; max-height: 90%;
  overflow: auto; position: relative; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.close {
  position: absolute; top: 12px; right: 18px; font-size: 28px; font-weight: bold; cursor: pointer; color: #666; transition: 0.2s;
}
.close:hover { color: #000; }

/* ====== IMAGE GALLERY (kept) ====== */
.image-gallery { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; margin-top: 15px; }
.image-gallery img { max-width: 200px; border-radius: 6px; border: 1px solid #ccc; cursor: pointer; transition: 0.2s; }
.image-gallery img:hover { border-color: #007bff; }

/* ====== COLOR SWATCHES (kept) ====== */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; border: 2px solid #ddd; cursor: pointer; transition: border 0.2s, transform 0.2s; }
.color-swatch img { width: 100%; height: 100%; object-fit: cover; }
.color-swatch:hover { border-color: #007bff; transform: scale(1.1); }
.color-swatch.active { border-color: #007bff; box-shadow: 0 0 5px rgba(0,123,255,0.5); }

/* ====== SMALL SCREENS (product tweaks) ====== */
@media (max-width: 420px) {
  .product-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .product img { max-width: 100px; max-height: 100px; }
}
