@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

/* ================================================
   Juel Haus - E-Commerce Platform
   ================================================ */

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

:root {
  --color-obsidian:     #1C1A16;
  --color-gold:         #B8922A;
  --color-gold-light:   #D4A83A;
  --color-ivory:        #F7F4EF;
  --color-stone:        #9A9488;
  --color-stone-dark:   #7A7469;
  --font-display:       'Cormorant Garamond', Georgia, serif;
  --font-body:          'Jost', sans-serif;

  /* Legacy aliases — kept so existing component styles still resolve */
  --primary:      #1C1A16;
  --primary-light: #3a3730;
  --gold:         #B8922A;
  --gold-light:   #D4A83A;
  --cream:        #F7F4EF;
  --white:        #ffffff;
  --black:        #1C1A16;
  --text:         #1C1A16;
  --text-light:   #9A9488;
  --border:       #e6e1d8;
  --success:      #2d8a4e;
  --error:        #c53030;
  --shadow:       0 4px 20px rgba(0,0,0,0.08);
  --radius:       8px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-ivory);
  color: var(--color-obsidian);
  line-height: 1.6;
}

/* ================================================
   Typography
   ================================================ */
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; color: var(--color-obsidian); }
h1 { font-size: 3rem; line-height: 1.2; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; }

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.5px;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-light); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* ================================================
   Navigation
   ================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-bh {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
}
.logo-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--primary);
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }
.nav-cart {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 8px;
}
.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gold);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-login {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-logout {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-light);
}
.hidden { display: none !important; }

/* ================================================
   Hero
   ================================================ */
.hero {
  margin-top: 72px;
  padding: 100px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #3d2a20 100%);
  text-align: center;
  color: var(--white);
}
.hero-content {
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 { color: var(--white); margin-bottom: 20px; }
.hero p { font-size: 1.15rem; opacity: 0.85; margin-bottom: 32px; line-height: 1.7; }

/* ================================================
   Sections
   ================================================ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header p { color: var(--text-light); margin-top: 8px; font-size: 1.05rem; }
.tier-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 24px;
  padding-left: 4px;
}

/* ================================================
   Product Catalog
   ================================================ */
.catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.product-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.product-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.product-info {
  padding: 24px;
}
.product-info h3 { margin-bottom: 8px; font-size: 1.2rem; }
.product-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.product-includes {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--cream);
  border-radius: 6px;
}
.product-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}
.product-actions { display: flex; gap: 8px; }

/* ================================================
   How It Works
   ================================================ */
.how-it-works {
  padding: 80px 24px;
  background: var(--white);
}
.steps-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
}
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { margin-bottom: 8px; font-size: 1.1rem; }
.step p { color: var(--text-light); font-size: 0.9rem; }

/* ================================================
   Footer
   ================================================ */
.footer {
  background: var(--primary);
  color: var(--white);
  padding: 48px 24px 24px;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.footer-brand .logo-bh { color: var(--white); border-color: var(--white); }
.footer-brand .logo-text { color: var(--white); }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin-top: 8px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; text-align: center; }
.footer-bottom p { color: rgba(255,255,255,0.5); font-size: 0.8rem; }

/* ================================================
   Modal
   ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  max-width: 440px;
  width: 100%;
  position: relative;
}
.modal h2 { margin-bottom: 24px; text-align: center; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 0.85rem; color: var(--text-light); }
.auth-switch a { color: var(--gold); cursor: pointer; font-weight: 600; }
.error-msg { color: var(--error); text-align: center; margin-top: 12px; font-size: 0.85rem; }

/* ================================================
   Cart Drawer
   ================================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: var(--white);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cart-header button { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-empty { color: var(--text-light); text-align: center; padding: 40px 0; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-img { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.9rem; font-family: 'Inter', sans-serif; font-weight: 600; }
.cart-item-info p { font-size: 0.82rem; color: var(--text-light); }
.cart-item-price { font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.cart-item-remove { background: none; border: none; color: var(--error); cursor: pointer; font-size: 0.8rem; }
.cart-footer { padding: 20px 24px; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 16px; font-weight: 700; font-size: 1.1rem; }

/* ================================================
   Nav right (cart + hamburger always visible)
   ================================================ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  margin-left: 2px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 998;
}
.mobile-menu.open { display: flex; }
.mobile-menu a,
.mobile-menu button {
  display: block;
  width: 100%;
  padding: 15px 24px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  letter-spacing: 0.2px;
  transition: background 0.15s;
}
.mobile-menu a:last-child,
.mobile-menu button:last-child { border-bottom: none; }
.mobile-menu a:hover,
.mobile-menu button:hover { background: var(--cream); }
#mobile-btn-login { color: var(--gold); font-weight: 600; }
#mobile-btn-logout { color: var(--text-light); }

/* Consistent height for btn on both <a> and <button> */
.btn { line-height: 1.4; }
.nav-right .btn { display: inline-flex; align-items: center; justify-content: center; }

/* Scroll offset so anchors land below fixed navbar */
#catalog, #how-it-works { scroll-margin-top: 80px; }

/* Mobile bottom bar (account page) */
.mobile-account-bar {
  display: none;
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .hero { padding: 60px 20px; }
  .product-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  /* Hide text links — cart (nav-cart) inside nav-links stays visible */
  .nav-links a,
  .nav-links .btn-login,
  .nav-links .btn-logout { display: none !important; }
  .nav-hamburger { display: flex; }
  .footer-content { flex-direction: column; gap: 24px; }
  .cart-drawer { width: 100vw; }
  /* Centre logo on mobile */
  .nav-container { position: relative; }
  .navbar-logo { position: absolute; left: 50%; transform: translateX(-50%); }
  .logo-img { width: 160px; }
  /* Account page: hide nav-right buttons on mobile (bottom bar takes over) */
  .nav-right .btn { display: none !important; }
  /* Mobile bottom bar */
  .mobile-account-bar {
    display: flex;
    gap: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 500;
    justify-content: center;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }
  .mobile-account-bar .btn { flex: 1; max-width: 180px; text-align: center; }
}

/* ================================================
   Juel Haus — Logo
   ================================================ */
.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  width: 200px;
  height: auto;
  display: block;
}

.footer-logo {
  width: 180px;
  height: auto;
  opacity: 0.95;
}
