/* Move all :root variables and the styles for the nav, footer, cart-toast, and mailing section into one file. 
/* Link this in the <head> of every page:
/* <link rel="stylesheet" href="assets/css/global.css"> */

/* CORE VARIABLES & RESET */
:root {
  --purple: #4a1060;
  --purple-deep: #2d0a3a;
  --purple-mid: #5e1a7a;
  --purple-light: #7b2fa0;
  --gold: #e4c77f;
  --gold-light: #f0d896;
  --cream: #f7f4ef;
  --offwhite: #fafaf8;
  --ink: #1a1220;
  --mid: #5a4d6a;
  --border: rgba(74,16,96,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', sans-serif;
  background: var(--offwhite);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* SHARED NAVIGATION & DROPDOWN */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #3d1a52;
  border-bottom: 1px solid rgba(228,199,127,0.18);
}

@media (min-width: 860px) {
  nav { padding: 1rem 3rem; }
}

.nav-logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.nav-logo img { width: 36px; height: 36px; object-fit: contain; }
.nav-logo-text {
  font-family: 'Raleway', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}
.nav-links { display: none; gap: 2rem; list-style: none; }
@media (min-width: 860px) { .nav-links { display: flex; } }

.nav-links a { font-size: 0.85rem; letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase; color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition); }
.nav-links a:hover { color: var(--gold-light); }

/* DROPDOWN LOGIC */
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: flex; align-items: center; gap: 0.35rem; }
.nav-dropdown > a::after { content: ''; border: 4px solid transparent; border-top-color: rgba(255,255,255,0.5); margin-top: 3px; transition: var(--transition); }
.nav-dropdown:hover > a::after { transform: rotate(180deg); margin-top: -3px; border-top-color: var(--gold-light); }

.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: #2d1a3e; border: 1px solid rgba(228,199,127,0.15); border-radius: 3px;
  min-width: 160px; list-style: none; padding: 0.75rem 0 0.4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.dropdown-menu::before { content: ''; position: absolute; top: -0.75rem; left: 0; right: 0; height: 0.75rem; background: transparent; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 0.55rem 1.2rem; font-size: 0.72rem; color: rgba(255,255,255,0.65); white-space: nowrap; }

/* BUTTONS & UI ELEMENTS */
.btn-sm {
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--purple-deep); color: white; padding: 0.55rem 1.3rem;
  border-radius: 2px; text-decoration: none; border: none; font-weight: 500; transition: var(--transition);
}
.btn-sm:hover { background: var(--purple-mid); }

.nav-cart-btn {
  position: relative; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.8); padding: 0.4rem; display: flex; align-items: center;
}
.nav-cart-badge {
  display: none; position: absolute; top: -5px; right: -5px;
  background: var(--gold); color: var(--purple-deep);
  border-radius: 50%; width: 16px; height: 16px;
  font-size: 0.58rem; font-weight: 700; align-items: center; justify-content: center;
}

/* Fix for Navigation Overlap */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.2rem; /* Increased gap between Shop Now and Cart */
  flex-shrink: 0; /* Prevents the right side from squishing */
}

.nav-cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  padding: 0.4rem;
  display: flex;
  align-items: center;
  min-width: 32px; /* Ensures a consistent hit area */
}

@media (max-width: 520px) {
  .nav-logo-text { display: none; } /* Hides text on tiny screens to save space */
  .btn-sm { padding: 0.5rem 0.8rem; font-size: 0.65rem; } /* Compact button for mobile */
}

/* Original PDP ATC Button Style */
.btn-atc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gold);
  color: var(--purple-deep);
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 17px 40px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  align-self: flex-start;
  position: relative;
  overflow: hidden; /* Necessary for the slide-up effect */
}

.btn-atc:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

/* The Success Overlay */
.btn-atc::after {
  content: '✓ Added';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5a8a6e;
  color: white;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.btn-atc.added::after {
  transform: translateY(0);
}

/* Global ATC Button - Restore original size and color */
.atc-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--purple-deep);
  color: white;
  padding: 0.68rem 1.2rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  font-weight: 500;
}

/* CART TOAST */
.cart-toast {
  position: fixed; bottom: 2rem; right: 1rem; z-index: 200;
  background: var(--purple-deep); color: white;
  padding: 0.85rem 1.3rem; border-radius: 3px;
  display: flex; align-items: center; gap: 0.8rem; font-size: 0.78rem;
  transform: translateY(150%); transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3); cursor: pointer;
  border: 1px solid rgba(201,168,76,0.2);
}
@media (min-width: 860px) { .cart-toast { right: 2rem; } }
.cart-toast.show { transform: translateY(0); }
.toast-badge { background: var(--gold); color: var(--purple-deep); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; }

/* MAILING LIST */
.mailing { padding: 2rem 1.5rem; background: var(--cream); text-align: center; border-top: 1px solid var(--border); }
@media (min-width: 860px) { .mailing { padding: 3rem 3rem; } }

.section-eyebrow { font-size: 0.85rem; font-weight:bold; letter-spacing: 0.22em; text-transform: uppercase; color: var(--purple-light); margin-bottom: 0.8rem; display: inline-block; border-bottom: 1.5px solid var(--gold); padding-bottom: 0.2rem; }
h2.section-title { font-family: 'Raleway', sans-serif; font-size: clamp(1.9rem, 3vw, 2.8rem); font-weight: 700; color: var(--purple-deep); margin-bottom: 0.7rem; }

.mailing-form { display: flex; max-width: 400px; margin: 2rem auto 0.8rem; border-radius: 2px; overflow: hidden; box-shadow: 0 4px 20px rgba(74,16,96,0.1); }
.mailing-input { flex: 1; padding: 0.85rem 1.1rem; border: 1px solid var(--border); outline: none; font-family: inherit; }
.mailing-submit { background: var(--gold); color: var(--purple-deep); padding: 0 1.5rem; border: none; cursor: pointer; font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.1em; transition: var(--transition); }
.mailing-submit:hover { background: var(--purple-mid); color: white; }

.mailing-sub {
  font-family: 'Montserrat', sans-serif; /* Standard body font */
  font-size: 0.88rem; /* Matches original size */
  /*font-weight: 300;*/   /* Restores the light, clean look */
  color: var(--mid);  /* Matches original color */
  margin: 0.5rem auto 2rem; /* Matches original spacing */
  max-width: 80ch;    /* Ensures text doesn't span too wide */
}
.mailing-note {
  font-size: 0.65rem; /* Matches the original small size */
  color: var(--mid); /* Uses your defined mid-tone purple */
  opacity: 0.5;      /* Restores the original faded look */
  margin-top: 0.8rem; /* Corrects the spacing */
}

/* UTILITIES (Animations & Footer) */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

footer { background: var(--purple-deep); padding: 2.5rem 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
/* Footer Copyright Text Fix */
footer small { 
  font-size: 0.70rem; 
  color: rgba(255,255,255,0.45); /* Adjusted for better visibility than the original 0.22 */
}
@media (min-width: 860px) { footer { padding: 2.5rem 3rem; flex-direction: row; justify-content: space-between; } }
.footer-logo { display: flex; align-items: center; gap: 0.6rem; }
.footer-logo img { width: 26px; height: 26px; opacity: 0.75; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.68rem; color: rgba(255,255,255,0.28); text-decoration: none; text-transform: uppercase; }

/* =========================================================
   MOBILE NAV — add these rules to assets/css/global.css
   ========================================================= */

/* -- Hamburger button (hidden on desktop) -- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: auto;    /* pushes everything else to the right */
  order: -1;             /* moves hamburger before the logo in flex order */
  z-index: 200;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #e4c77f;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
/* Animate hamburger → X when open */
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -- Chevron toggle inside Products li -- */
.dropdown-toggle {
  display: none;          /* hidden on desktop; shown on mobile below */
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: inherit;
  vertical-align: middle;
  transition: transform 0.2s;
}
.nav-dropdown.dropdown-open .dropdown-toggle {
  transform: rotate(180deg);
}

/* -- Desktop: hover-only dropdown — matches original dark purple styling -- */
@media (min-width: 769px) {
  .nav-dropdown { position: relative; }

  /* Restore original dropdown appearance (overrides nothing — just re-states it clearly) */
  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d1a3e;
    border: 1px solid rgba(228,199,127,0.15);
    border-radius: 3px;
    min-width: 160px;
    list-style: none;
    padding: 0.75rem 0 0.4rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 100;
  }
  /* Hover bridge so menu doesn't close when moving cursor down to it */
  .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.75rem; left: 0; right: 0;
    height: 0.75rem;
    background: transparent;
  }
  .dropdown-menu li a {
    display: block;
    padding: 0.55rem 1.2rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
    text-decoration: none;
    transition: var(--transition);
  }
  .dropdown-menu li a:hover { color: var(--gold-light); }

  /* Show on hover (desktop) */
  .nav-dropdown:hover > .dropdown-menu { display: block; }
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
  /* Show hamburger, hide nav-right Shop Now link (optional) */
  .nav-hamburger { display: flex; }

  /* Collapse nav-links into a slide-down panel — matches nav bar color */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #3d1a52;
    border-top: 1px solid rgba(228,199,127,0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    padding: 12px 0 20px;
    list-style: none;
    margin: 0;
    z-index: 150;
  }
  .nav-links.nav-open { display: flex; }

  /* Products row: link + chevron side by side */
  .nav-dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 20px;
  }
  .nav-dropdown > a {
    flex: 1;
    padding: 12px 0;
    font-size: 1rem;
  }

  /* Show chevron on mobile */
  .dropdown-toggle { display: inline-flex; }

  /* Dropdown items stack below, collapsed by default */
  .dropdown-menu {
    display: none;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0 0 8px 12px;
    border-left: 2px solid rgba(228,199,127,0.25);
  }
  .nav-dropdown.dropdown-open > .dropdown-menu { display: block; }

  .dropdown-menu li a {
    display: block;
    padding: 18px 8px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255,255,255,0.65);
  }
  .dropdown-menu li a:hover { color: var(--gold-light); }

  /* Make sure <nav> is position:relative so the panel can anchor to it */
  nav { position: relative; }

  /* Center logo on mobile */
  .nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}