/* ========== GLOBAL / SITE STYLES ========== */

/* ── CSS custom properties (defaults = Earth theme) ── */
:root {
  --nav-bg: #3d2b1f;
  --nav-icon: #d4a96a;
  --cart-icon: #d4a96a;
  --side-nav-bg: #2a1d13;
  --side-nav-text: #f0e6d3;
  --gallery-bg: #f0ebe3;
  --category-header-color: #3d2b1f;
  --product-name-color: #3d2b1f;
  --product-card-bg: #fffdf9;
  --stage-bg: #e8ddd0;
  --controls-bg: #5c3d2e;
  --controls-text: #f0e6d3;
  --btn-bg: #c4924a;
  --btn-text: #fffdf5;
  --btn-hover-bg: #2a1d13;
  --btn-hover-text: #f0e6d3;
  --btn-cart-bg: #7a4f2d;
  --btn-cart-text: #f0e6d3;
  --btn-cart-hover-bg: #3d2b1f;
  --btn-cart-hover-text: #d4a96a;
  --ctrl-widget-bg: #8a6a52;
  --ctrl-widget-text: #f0e6d3;

  /* per-theme icon colors — overwritten by theme.js at runtime */
  --earth-icon-bg: #3d2b1f; --earth-icon-fg: #d4a96a;
  --air-icon-bg:   #2c3e50; --air-icon-fg:   #87ceeb;
  --water-icon-bg: #1a4a5c; --water-icon-fg: #7ecac3;
  --fire-icon-bg:  #3d1c0a; --fire-icon-fg:  #f4a261;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Space Grotesk", sans-serif;
  background-color: var(--gallery-bg);
}

/* ======== NAVBAR ======== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  padding: 0 10px;
  z-index: 1000;
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

/* ── Navbar logo ── */
#nav-logo {
  order: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}

#nav-logo svg path,
#nav-logo svg circle {
  fill: var(--nav-icon);
}

#nav-logo .logo-globe-water {
  opacity: 0.34;
}

#nav-logo .logo-globe-land {
  opacity: 1;
  fill-rule: evenodd;
}

#nav-logo .logo-globe-outline {
  fill: none;
  stroke: var(--nav-icon);
  opacity: 0.9;
}

#logo-long {
  height: 30px;
  width: auto;
  display: block;
}

#logo-stacked {
  display: none;
}

@media (max-width: 700px) {
  #logo-long {
    display: none;
  }
  #logo-stacked {
    height: 38px;
    width: auto;
    display: block;
  }
}

#nav-left {
  order: 1;
  display: flex;
  align-items: center;
}

#nav-right {
  order: 3;
  display: flex;
  align-items: center;
}

#user-icon {
  margin-right: 20px;
}

#menu-icon,
#user-icon {
  cursor: pointer;
  stroke: var(--nav-icon);
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

#menu-icon:hover,
#user-icon:hover {
  transform: scale(1.1);
}

/* ── Theme switcher buttons ── */
#theme-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

.theme-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-btn:hover {
  transform: scale(1.15);
}

.theme-btn.active {
  box-shadow: 0 0 0 2px var(--nav-bg), 0 0 0 3.5px var(--nav-icon);
}

/* ======== SIDE NAV ======== */
#side-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: auto;
  width: 180px;
  max-width: 60vw;
  background: var(--side-nav-bg);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 999;
  padding-top: 60px;
  padding-bottom: 20px;
  color: var(--side-nav-text);
}

#side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 20px;
}

#side-nav li {
  margin-bottom: 15px;
}

#side-nav a {
  text-decoration: none;
  color: var(--side-nav-text);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

@media (hover: hover) and (pointer: fine) {
  #side-nav a:hover {
    opacity: 0.7;
    transition: opacity 0.2s ease;
  }
}

#side-nav.show {
  transform: translateX(0);
}

.hidden {
  display: none;
}

/* ======== CART ICON ======== */
#cart-icon-wrap {
  position: relative;
  margin-right: 20px;
  cursor: pointer;
}

#cart-icon {
  fill: var(--cart-icon);
  display: block;
  transition: transform 0.2s ease;
}

#cart-icon-wrap:hover #cart-icon {
  transform: scale(1.1);
}

#cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  padding: 2px 5px;
}

/* ======== CART MODAL ======== */
#cart-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 70vw;
  background: #fff;
  box-sizing: border-box;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 60px 15px 15px;
  height: 100dvh;
}

#cart-modal.show {
  transform: translateX(0);
}

#cart-items-wrap {
  position: relative;
  max-height: calc(100dvh - 160px);
  overflow: hidden;
}

#cart-items-wrap::before,
#cart-items-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#cart-items-wrap.has-top-fade::before {
  opacity: 1;
}

#cart-items-wrap.has-bottom-fade::after {
  opacity: 1;
}

#cart-items-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, #fff 0%, transparent 100%);
}

#cart-items-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, #fff 0%, transparent 100%);
}

#cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
}

#cart-items li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}


/* --- Cart Item Layout --- */
.cart-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  margin: 0 2px 6px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  border-left: 3px solid var(--btn-bg);
  border-radius: 0 6px 6px 0;
  background: var(--gallery-bg);
  text-align: center;
}

.cart-item img {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.cart-item-info {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--product-name-color);
}

.cart-item-info strong {
  color: var(--category-header-color);
}

.cart-item-info small {
  color: var(--controls-bg);
  opacity: 0.8;
}

.remove-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 30px;
  font-weight: 500;
  color: var(--btn-bg);
  opacity: 0.5;
  cursor: pointer;
  line-height: 1;
}

.remove-btn:hover {
  opacity: 1;
}

/* --- Quantity Controls --- */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  background: #ccc;
  border: none;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
}

.qty-btn:hover {
  background: #aaa;
}

.qty-controls input {
  width: 30px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 0;
  font-family: inherit;
}

.cart-footer {
  width: 100%;
}

#checkout-btn {
  width: 100%;
  display: none;
}

.product_button {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  letter-spacing: 0.03em;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

#page-content {
  min-height: calc(100dvh - 50px);
}

#site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  justify-content: center;
  align-items: center;
  padding: 18px 20px 28px;
  background: linear-gradient(180deg, transparent, rgba(61, 43, 31, 0.08));
  color: var(--category-header-color);
  font-size: 0.92rem;
}

#site-footer a {
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
}

#site-footer a:hover {
  opacity: 1;
}

.legal-shell {
  min-height: calc(100dvh - 120px);
  display: flex;
  justify-content: center;
  padding: 84px 18px 32px;
  box-sizing: border-box;
}

.legal-card {
  width: min(860px, 100%);
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(61, 43, 31, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(42, 29, 19, 0.08);
  padding: 28px 24px 32px;
  color: var(--product-name-color);
}

.legal-eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--btn-bg);
}

.legal-card h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  color: var(--category-header-color);
}

.legal-updated {
  margin: 10px 0 24px;
  color: rgba(61, 43, 31, 0.72);
}

.legal-group + .legal-group {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 2px solid rgba(61, 43, 31, 0.12);
}

.legal-group-title {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  color: var(--category-header-color);
}

.legal-section + .legal-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(61, 43, 31, 0.1);
}

.legal-section h2,
.legal-section h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  color: var(--category-header-color);
}

.legal-section p {
  margin: 0 0 12px;
  line-height: 1.62;
}

/* ======== MOBILE: bigger navbar and icons ======== */
@media (max-width: 700px) {
  #navbar {
    height: 60px;
  }

  #side-nav {
    padding-top: 70px;
  }

  #menu-icon {
    width: 32px;
    height: 32px;
  }

  #cart-icon {
    width: 32px;
    height: 32px;
  }

  .theme-btn svg {
    width: 28px;
    height: 28px;
  }

  .legal-shell {
    padding-top: 92px;
  }

  .legal-card {
    padding: 22px 18px 26px;
    border-radius: 14px;
  }
}
