/* ============================================================
   Giftorra — Category Pages Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #F8F6F2;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button, input, select { font-family: inherit; }

:root {
  --navy:     #1B2A4A;
  --navy-dk:  #111e35;
  --gold:     #C9A84C;
  --offwhite: #F8F6F2;
  --gray-bg:  #d5d5d5;
  --gray-100: #f0eeeb;
  --gray-200: #e5e3de;
  --gray-500: #888;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* ════════════════════════════════════════════════════════════
   TOP CONTACT BAR
════════════════════════════════════════════════════════════ */
.top-bar { background: var(--navy); padding: .45rem 0; }
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.75rem;
}
.top-bar-inner a {
  font-size: .78rem;
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: color .2s;
}
.top-bar-inner a:hover { color: #fff; }
.top-bar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  font-size: .62rem;
  font-weight: 700;
}


/* ════════════════════════════════════════════════════════════
   NAVIGATION
════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e8e6e2;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 68px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  margin-right: 2rem;
}
.logo-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a7a40, #4dbf72);
  position: relative;
  flex-shrink: 0;
}
.logo-icon::before {
  content: '';
  position: absolute;
  top: 50%; left: 7px; right: 7px;
  height: 4px;
  background: rgba(255,255,255,.92);
  transform: translateY(-50%);
  border-radius: 2px;
}
.logo-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 7px; bottom: 7px;
  width: 4px;
  background: rgba(255,255,255,.92);
  transform: translateX(-50%);
  border-radius: 2px;
}
.logo-wordmark {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
  justify-content: center;
}
.nav-links li a {
  font-size: .88rem;
  font-weight: 500;
  color: #444;
  padding: .45rem .85rem;
  border-radius: 4px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-links li a:hover { color: var(--navy); background: var(--gray-100); }
.nav-links li a.active {
  color: var(--navy);
  font-weight: 600;
  border-bottom: 2px solid var(--navy);
  border-radius: 0;
  padding-bottom: .35rem;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  margin-left: 1.5rem;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  font-size: .72rem;
  font-weight: 700;
  color: #555;
  transition: border-color .2s, color .2s, background .2s;
}
.social-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--gray-100); }
.cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 6px;
  color: var(--navy);
  transition: background .2s;
}
.cart-btn:hover { background: var(--gray-100); }
.cart-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ════════════════════════════════════════════════════════════
   PAGE WRAPPER — TWO-COLUMN LAYOUT
════════════════════════════════════════════════════════════ */
.page-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}


/* ════════════════════════════════════════════════════════════
   SIDEBAR / FILTER PANEL
════════════════════════════════════════════════════════════ */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1.5rem;
  overflow: hidden;
}
.filter-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a1a;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--navy);
}
.filter-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
}
.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.filter-section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .85rem;
}

/* Price Range */
.price-slider-wrap { padding: .25rem 0 .5rem; }
.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--navy) 0%,
    var(--navy) var(--fill, 100%),
    #ddd var(--fill, 100%),
    #ddd 100%
  );
  outline: none;
  cursor: pointer;
  margin-bottom: .6rem;
}
.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.25);
  cursor: pointer;
}
.price-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.25);
  cursor: pointer;
  border: none;
}
.price-range-text {
  font-size: .82rem;
  font-weight: 600;
  color: #444;
}

/* Checkboxes */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.filter-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  font-size: .88rem;
  color: #444;
  user-select: none;
}
.filter-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 3px;
}
.filter-check:hover { color: var(--navy); }

/* In Stock (standalone) */
.instock-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}
.instock-check input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--navy);
  cursor: pointer;
}

/* Mobile close button inside sidebar drawer */
.sidebar-close {
  display: none;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.sidebar-close-btn {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .82rem;
  cursor: pointer;
  color: #555;
}


/* ════════════════════════════════════════════════════════════
   PRODUCTS MAIN
════════════════════════════════════════════════════════════ */
.products-main { flex: 1; min-width: 0; }

/* Mobile filter button row (hidden on desktop) */
.mobile-filter-row {
  display: none;
  margin-bottom: 1rem;
}
.mobile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.mobile-filter-btn:hover { background: var(--navy-dk); }
.mobile-filter-btn svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--gray-500); transition: color .2s; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.breadcrumb span.sep { color: #bbb; }

/* Page heading */
.page-heading {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .55rem;
  line-height: 1.2;
}
.page-subtitle {
  font-size: .92rem;
  color: #666;
  line-height: 1.65;
  max-width: 700px;
  margin-bottom: 1.75rem;
}

/* Results bar */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.results-count {
  font-size: .85rem;
  color: #555;
  white-space: nowrap;
}
.results-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  background: #fff;
  color: #888;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  padding: 0;
}
.view-btn svg { width: 17px; height: 17px; fill: currentColor; }
.view-btn:hover  { border-color: var(--navy); color: var(--navy); }
.view-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.sort-select {
  padding: .45rem .85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: .84rem;
  color: #444;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  padding-right: 2rem;
}
.sort-select:focus { border-color: var(--navy); }


/* ════════════════════════════════════════════════════════════
   PRODUCT GRID
════════════════════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

/* ── PRODUCT CARD (Grid view) ───────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .22s, transform .22s;
  cursor: pointer;
}
.product-card:hover {
  box-shadow: 0 6px 22px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.card-image {
  aspect-ratio: 1 / 1;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: rgba(0,0,0,.12);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.card-image img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-body {
  padding: .85rem 1rem .95rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.card-name {
  font-size: .83rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
}
.card-price {
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
}

/* ── LIST VIEW ──────────────────────────────────────────── */
.product-grid.list-view {
  grid-template-columns: 1fr;
  gap: .75rem;
}
.product-grid.list-view .product-card {
  flex-direction: row;
  align-items: center;
}
.product-grid.list-view .card-image {
  width: 90px; height: 90px;
  aspect-ratio: unset;
  flex-shrink: 0;
  border-radius: 0;
}
.product-grid.list-view .card-body {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem 1.5rem;
  padding: .85rem 1.25rem;
}
.product-grid.list-view .card-name {
  flex: 1;
  font-size: .9rem;
  min-width: 180px;
}
.product-grid.list-view .card-price {
  font-size: .95rem;
  white-space: nowrap;
  margin-left: auto;
}


/* ════════════════════════════════════════════════════════════
   DRAWER OVERLAY (mobile)
════════════════════════════════════════════════════════════ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1500;
  opacity: 0;
  transition: opacity .3s;
}
.drawer-overlay.open {
  display: block;
  opacity: 1;
}


/* ════════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════════ */
.site-footer {
  background: #eceae6;
  padding: 3rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-col h4 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 1rem;
}
.footer-col p,
.footer-col address {
  font-size: .88rem;
  color: #555;
  font-style: normal;
  line-height: 1.7;
}
.footer-col a { color: #555; transition: color .2s; }
.footer-col a:hover { color: var(--navy); }
.newsletter-row {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}
.newsletter-input {
  flex: 1;
  padding: .65rem .9rem;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  font-size: .84rem;
  outline: none;
  background: #fff;
  transition: border-color .2s;
}
.newsletter-input:focus { border-color: var(--navy); }
.newsletter-btn {
  padding: .65rem 1.25rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.newsletter-btn:hover { background: #000; }
.footer-bottom {
  border-top: 1px solid #d5d3cf;
  padding: 1.1rem 0;
  text-align: center;
  font-size: .78rem;
  color: #888;
}


/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid  { grid-template-columns: 1fr 1fr; }
}

/* ── Tablet nav collapse ─────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    gap: .15rem;
    border-bottom: 1px solid #e8e6e2;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links li a  { padding: .6rem .5rem; width: 100%; }
  .nav-links li a.active { border-bottom: none; border-left: 3px solid var(--navy); padding-left: .85rem; }
  .nav-toggle { display: flex; }
  .nav-right  { margin-left: auto; margin-right: .75rem; }
  .nav-right .social-btn { display: none; }
}

/* ── Mobile sidebar → drawer ─────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 1.25rem 1rem 3rem; gap: 0; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 300px;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    transform: translateX(-110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 1600;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }

  .mobile-filter-row { display: flex; }
}

@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .85rem; }
  .footer-grid  { grid-template-columns: 1fr; gap: 2rem; }
  .product-grid.list-view .card-image { width: 70px; height: 70px; }
  .results-bar { gap: .6rem; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
}
