/* =========================================================
   DogGearInsider - Global Styles (Light + Dark)
   Path: /assets/css/style.css
   ========================================================= */

/* 1) Theme tokens */
:root {
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1320px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Light theme */
  --bg: #fffaf5;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;

  --text: #1f2937;
  --text-muted: #5b6472;

  --border: rgba(31, 41, 55, 0.12);
  --border-strong: rgba(31, 41, 55, 0.18);

  --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);

  /* Brand */
  --accent: #c96a18;
  --accent-2: #2f7d32;
  --accent-soft: rgba(201, 106, 24, 0.10);
  --accent-soft-2: rgba(47, 125, 50, 0.10);

  --btn-text: #ffffff;

  --header-bg: rgba(255, 250, 245, 0.88);
  --header-border: rgba(31, 41, 55, 0.10);

  --footer-bg: #fffaf5;

  --cookie-bg: rgba(255, 255, 255, 0.96);
  --cookie-border: rgba(31, 41, 55, 0.18);

  --overlay: rgba(15, 23, 42, 0.42);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #101315;
  --bg-alt: #161b1d;
  --surface: rgba(22, 27, 29, 0.92);
  --surface-strong: #1b2124;

  --text: #f5f7f8;
  --text-muted: #b2bcc3;

  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);

  --accent: #e0872f;
  --accent-2: #58a55c;
  --accent-soft: rgba(224, 135, 47, 0.14);
  --accent-soft-2: rgba(88, 165, 92, 0.16);

  --header-bg: rgba(16, 19, 21, 0.90);
  --header-border: rgba(255, 255, 255, 0.08);

  --footer-bg: #121719;

  --cookie-bg: rgba(22, 27, 29, 0.96);
  --cookie-border: rgba(255, 255, 255, 0.16);

  --overlay: rgba(0, 0, 0, 0.60);
}

/* 2) Base reset */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* 3) Typography */
h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0.65rem 0;
  color: var(--text-muted);
}

strong {
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 4) Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 2.4rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

/* 5) Cards */
.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}

.card.soft {
  background: var(--surface);
  box-shadow: none;
}

/* 6) Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: all 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 10px 24px rgba(47, 125, 50, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

.btn-secondary:hover {
  filter: brightness(1.02);
}

.theme-toggle {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  filter: brightness(1.03);
}

/* 7) Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.site-header .container {
  position: relative;
}

.navbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand span {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text);
}

/* Desktop navigation */
.main-nav {
  min-width: 0;
}

.navlinks {
  list-style: none;
  display: flex;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.navlinks > li {
  position: relative;
}

/* Desktop: real category links visible */
.navlinks > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.18s ease;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Desktop: mobile accordion buttons hidden */
.nav-parent-toggle {
  display: none;
}

.navlinks > li > a:hover,
.navlinks > li:hover > a {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-caret {
  font-size: 0.75rem;
  line-height: 1;
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown {
  list-style: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 290px;
  margin: 0;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.18s ease;
  z-index: 80;
}

.dropdown li + li {
  margin-top: 0.2rem;
}

.dropdown a {
  display: block;
  padding: 0.72rem 0.82rem;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: normal;
}

.dropdown a:hover {
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.nav-toggle:hover {
  filter: brightness(1.02);
}

.nav-toggle-lines {
  position: relative;
  width: 20px;
  height: 14px;
}

.nav-toggle-lines span {
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: all 0.2s ease;
}

.nav-toggle-lines span:nth-child(1) {
  top: 0;
}

.nav-toggle-lines span:nth-child(2) {
  top: 6px;
}

.nav-toggle-lines span:nth-child(3) {
  top: 12px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.mobile-nav-overlay {
  display: none;
}

/* 8) Hero */
.hero {
  padding: 2.4rem 0 2.6rem;
}

.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero p {
  max-width: 820px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
  align-items: center;
}

/* 9) Homepage category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 106, 24, 0.30);
  box-shadow: 0 18px 40px rgba(31, 41, 55, 0.12);
  text-decoration: none;
}

.category-card-image {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: var(--accent-soft);
}

.category-card-body {
  padding: 1rem 1rem 1.05rem;
}

.category-card-title {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 1.08rem;
}

.category-card-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 10) Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding: 1.5rem 0 2.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 11) Cookie banner */
.sb-cookie-banner {
  position: fixed !important;
  bottom: 1rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 2rem);
  max-width: 760px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--cookie-border);
  background: var(--cookie-bg);
  box-shadow: var(--shadow);
  z-index: 200;
}

.sb-cookie-text {
  flex: 1 1 320px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.sb-cookie-text strong {
  color: var(--text);
}

.sb-cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sb-cookie-btn {
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.58rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.sb-cookie-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  border-color: transparent;
}

/* 12) Amazon Product Box */
.amz-box {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.amz-box-top {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.amz-box-media {
  width: 120px;
}

.amz-box-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.amz-box-placeholder {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.amz-box-placeholder-icon {
  font-size: 1.35rem;
}

.amz-box-placeholder-text {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.amz-box-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.amz-box-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--text);
}

.amz-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--text);
  white-space: nowrap;
}

.amz-box-bullets {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.amz-box-bullets li {
  margin: 0.2rem 0;
}

.amz-box-note {
  margin: 0.35rem 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.amz-box-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.amz-box-cta {
  white-space: nowrap;
}

.amz-box-disclaimer {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* 13) Utility */
.content-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-strong),
    transparent
  );
  margin: 2.5rem 0;
}

.section-divider {
  padding-top: 0;
  padding-bottom: 0;
}

/* 14) Responsive */
@media (max-width: 1180px) {
  .navbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(92vw, 420px);
    height: 100vh;
    background: var(--surface-strong);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 5.5rem 1rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    z-index: 120;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: all 0.22s ease;
    z-index: 110;
  }

  .mobile-nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-actions {
    gap: 0.6rem;
  }

  .navlinks {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .navlinks > li {
    width: 100%;
  }

  /* Mobile: show accordion buttons */
  .nav-parent-toggle {
    display: inline-flex;
    width: 100%;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    white-space: normal;
    color: var(--text);
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
  }

  /* Mobile: hide duplicated top-level links */
  .navlinks > li > a {
    display: none;
  }

  .nav-parent-toggle:hover {
    background: var(--accent-soft);
  }

  .has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown {
    position: static;
    min-width: 100%;
    margin-top: 0.45rem;
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .has-dropdown.is-open .dropdown {
    display: block;
  }

  .dropdown a {
    padding: 0.75rem 0.8rem;
    font-size: 0.92rem;
  }
}

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

  .grid-3,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  .category-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .amz-box-top {
    grid-template-columns: 1fr;
  }

  .amz-box-media {
    width: 100%;
  }

  .amz-box-img,
  .amz-box-placeholder {
    width: 100%;
    height: 140px;
  }

  .footer-row {
    flex-direction: column;
    gap: 1rem;
  }

  .sb-cookie-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .sb-cookie-actions {
    width: 100%;
  }

  .sb-cookie-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .brand span {
    font-size: 0.88rem;
  }

  .theme-toggle {
    padding: 0.52rem 0.78rem;
    font-size: 0.8rem;
  }

  .main-nav {
    width: 100%;
    border-left: 0;
  }

  .hero-ctas {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}