/* ============================================================
   Brinkman’s Bakery Co. - Site Stylesheet
   Updated Cozy Brown & Cream Theme with Background Image
   + Cart UI (button, drawer, variants, checkout)
   ============================================================ */

/* === Global Color Palette === */
:root {
  --dark-brown: #4a2e1a;     /* Deep cocoa for text and accents */
  --medium-brown: #b97a56;   /* Signature bakery brown (header/buttons) */
  --light-brown: #eac8a1;    /* Caramel accent for borders and highlights */
  --soft-cream: #fff5e6;     /* Light cream background */
  --warm-beige: #f2d7b5;     /* Toasted beige for footer and gradients */
  --accent-shadow: rgba(0, 0, 0, 0.08);
}

/* === General Page Styling === */
body {
  font-family: "Poppins", sans-serif;

  /* Full-page background image */
  background: url("../images/Background.png") no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  background-color: var(--soft-cream);

  color: var(--dark-brown);
  margin: 0;
  padding: 0;
  line-height: 1.8;
  font-size: 18px;
  position: relative;
  z-index: 0;
}

/* Soft beige overlay behind content for warmth and readability */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 247, 236, 0.6);
  backdrop-filter: blur(2px);
  z-index: -1; /* keeps the overlay and image behind everything */
}

/* === Sticky Header + Nav === */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(185, 122, 86, 0.95);
  color: #fffdf8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(3px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 {
  font-size: 2em;
  margin: 0;
  letter-spacing: 1px;
}

/* === Navigation Bar === */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

nav li {
  margin-left: 25px;
}

nav a {
  color: #fffdf8;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: color 0.3s, transform 0.2s;
}

nav a:hover,
nav a:focus {
  color: var(--light-brown);
  transform: scale(1.1);
  outline: none;
}

/* === Header Cart Button === */
.cart-button {
  margin-left: 12px;
  background: var(--light-brown);
  color: var(--dark-brown);
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px var(--accent-shadow);
  transition: transform 0.2s, filter 0.2s;
}
.cart-button:hover { transform: translateY(-1px) scale(1.03); filter: brightness(0.98); }
.cart-button:active { transform: translateY(0); }
#cartCount {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fffdf8;
  color: var(--dark-brown);
  font-size: 0.9em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === Hero Section === */
.hero {
  background: linear-gradient(to bottom, var(--soft-cream), var(--warm-beige));
  text-align: center;
  padding: 80px 20px;
  box-shadow: inset 0 0 20px var(--accent-shadow);
}

.hero h2 {
  font-size: 2.2em;
  margin-bottom: 15px;
}

.hero p {
  font-size: 1.3em;
  max-width: 700px;
  margin: 0 auto 20px;
}

.cta-button {
  background-color: var(--medium-brown);
  color: #fffdf8;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 1.1em;
  transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
  background-color: #8b573e;
  transform: scale(1.05);
}

/* === Buttons === */
button,
.btn {
  background-color: var(--medium-brown);
  color: #fffdf8;
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

button:hover,
.btn:hover {
  background-color: #8b573e;
  transform: scale(1.05);
}

/* Primary button variant */
.btn-primary {
  background: var(--dark-brown);
  color: #fffdf8;
}
.btn-primary:hover { background: #3c2415; }

/* === Content Sections (floating over background) === */
section {
  background-color: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(4px);
  margin: 50px auto;
  padding: 50px 40px;
  max-width: 1000px;
  border-radius: 16px;
  box-shadow: 0 6px 15px var(--accent-shadow);
  position: relative;
  z-index: 2; /* ensures it floats above overlay */
}

section h2 {
  font-size: 2em;
  text-align: center;
  margin-bottom: 25px;
  color: var(--dark-brown);
  border-bottom: 3px solid var(--light-brown);
  display: inline-block;
  padding-bottom: 5px;
}

#about-section {
  background-color: rgba(255, 245, 230, 0.9);
  text-align: center;
}

#about-section p {
  color: var(--dark-brown);
  font-size: 1.05em;
  line-height: 1.8;
  max-width: 850px;
  margin: 15px auto;
}

/* === Expandable Sections === */
.expandable {
  text-align: center;
  margin-top: 40px;
}

.expand-btn {
  background-color: var(--medium-brown);
  color: #fffdf8;
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px var(--accent-shadow);
}

.expand-btn:hover {
  background-color: #8b573e;
  transform: scale(1.05);
}

.expand-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.5s ease, transform 0.3s ease;
  margin-top: 0;
  padding: 0 20px;
}

.expand-content.show {
  max-height: 80vh;
  opacity: 1;
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  background-color: rgba(255, 253, 248, 0.9);
  box-shadow: inset 0 0 10px var(--accent-shadow);
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 10px;
}

/* === Menu Section === */
.menu-list {
  text-align: left;
  margin-top: 25px;
}

.menu-item {
  margin-bottom: 20px;
}

.menu-toggle {
  background-color: var(--light-brown);
  color: var(--dark-brown);
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.menu-toggle:hover {
  background-color: #f6e4cd;
  transform: scale(1.02);
}

.menu-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.4s ease;
  background-color: rgba(255, 245, 230, 0.9);
  border-radius: 12px;
  margin-top: 10px;
  padding: 0 20px;
  box-shadow: inset 0 0 8px var(--accent-shadow);
}

.menu-details.show {
  max-height: 500px;
  opacity: 1;
  padding: 20px;
}

.menu-details img {
  width: 100%;
  max-width: 300px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 auto 15px;
}

.menu-details h4 {
  text-align: center;
  margin-bottom: 5px;
  color: var(--dark-brown);
}

.menu-details .price {
  text-align: center;
  font-weight: bold;
  color: var(--medium-brown);
  margin-bottom: 10px;
}

.menu-details p {
  text-align: center;
  color: var(--dark-brown);
  margin-bottom: 0;
}

/* --- Add-to-cart rows & variant selectors --- */
.buy-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.buy-row .add-to-cart {
  background: var(--medium-brown);
  color: #fffdf8;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px var(--accent-shadow);
}
.buy-row .add-to-cart:hover { background: #8b573e; }

.variant-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin: 8px 0 2px;
  font-size: 0.98em;
  color: var(--dark-brown);
}
.variant-row input[type="radio"] {
  accent-color: var(--medium-brown);
}

/* === Featured Products === */
.featured {
  text-align: center;
  background-color: rgba(255, 245, 230, 0.9);
  padding: 60px 20px;
  border-radius: 16px;
  box-shadow: 0 6px 15px var(--accent-shadow);
  max-width: 1500px;
  margin: 60px auto;
}

.featured h3 {
  font-size: 2em;
  color: var(--dark-brown);
  margin-bottom: 30px;
}

.product-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 25px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.product-card {
  background-color: #fdf4e3;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 10px var(--accent-shadow);
  flex: 1 1 22%;
  max-width: 320px;
  min-width: 280px;
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: scale(1.03);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
}

.product-card h4 {
  margin: 0;
  font-size: 1.3em;
  color: var(--dark-brown);
}

/* === Responsive Adjustments === */
@media (max-width: 1100px) {
  .product-grid {
    flex-wrap: wrap;
    justify-content: center;
  }

  .product-card {
    flex: 1 1 45%;
  }
}

@media (max-width: 600px) {
  .product-card {
    flex: 1 1 100%;
    max-width: 350px;
  }
}

/* === (Legacy) Order Form Styling — kept for inputs look consistency === */
.order-form,
.checkout-form {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  margin: 0 auto;
  gap: 15px;
  text-align: left;
  padding-bottom: 30px;
}

.order-form label,
.checkout-form label,
.checkout-form legend {
  font-weight: 600;
  color: var(--dark-brown);
}

.order-form input,
.order-form select,
.order-form textarea,
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--light-brown);
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  background: #fffdf8;
}

.order-form button {
  margin-top: 15px;
  background-color: var(--medium-brown);
  color: #fffdf8;
  border: none;
  padding: 12px 25px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1em;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.order-form button:hover {
  background-color: #8b573e;
  transform: scale(1.05);
}

.order-message {
  text-align: center;
  padding: 25px;
  background-color: rgba(255, 253, 248, 0.9);
  border-radius: 12px;
  box-shadow: inset 0 0 10px var(--accent-shadow);
  margin-top: 20px;
  color: var(--dark-brown);
}

/* === Multiple Item Order Fields (legacy) === */
.order-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
  border: 1px solid #f3dfc1;
  border-radius: 10px;
  margin-bottom: 15px;
  background-color: rgba(255, 253, 248, 0.9);
}

#addItem {
  margin: 10px auto 25px;
  display: block;
  font-weight: bold;
}

/* === Footer === */
footer {
  background: rgba(242, 215, 181, 0.95);
  backdrop-filter: blur(3px);
  color: var(--dark-brown);
  text-align: center;
  padding: 30px 24px;
  font-size: 0.9em;
  border-top: 2px solid var(--light-brown);
  box-shadow: 0 -3px 6px var(--accent-shadow);
  margin-top: 60px; /* gives breathing room above footer */
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-note {
  margin-top: 10px;
  font-size: 0.8em;
  color: #6a4b34;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }

  nav ul {
    flex-direction: column;
  }

  nav li {
    margin: 8px 0;
  }

  header h1 {
    margin-bottom: 10px;
    font-size: 2em;
  }

  .hero h2 {
    font-size: 1.8em;
  }

  nav a {
    margin: 8px 0;
    font-size: 1.1em;
  }

  section {
    padding: 35px 20px;
  }

  .cart-drawer__panel {
    width: 100%;
  }
}

/* === What's New Section === */
.whats-new {
  background-color: rgba(255, 250, 243, 0.9);
  padding: 60px 20px;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  max-width: 1200px;
  margin: 60px auto;
  text-align: center;
}

.whats-new h2 {
  font-size: 2em;
  color: #5a3e2b;
  text-align: center;
  margin-bottom: 40px;
  border-bottom: 3px solid #eac8a1;
  display: inline-block;
  padding-bottom: 5px;
}

/* Display cards horizontally */
.whats-new-content {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 25px;
  overflow-x: auto; /* allows scrolling if not enough space */
  padding-bottom: 10px;
}

/* Card Styling */
.news-card {
  flex: 1 1 22%;
  min-width: 260px;
  background-color: #fdf4e3;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.news-card:hover {
  transform: scale(1.03);
}

/* Larger image area */
.news-card img {
  width: 100%;
  height: 320px; /* bigger display area */
  object-fit: contain; /* show full image */
  background-color: #fff3e0; /* slightly warmer backdrop */
  border-bottom: 3px solid #eac8a1;
  padding: 4px; /* tighter spacing */
  box-sizing: border-box;
}

/* Smaller, refined text */
.news-text {
  padding: 15px 18px;
}

.news-text h4 {
  margin-top: 10px;
  margin-bottom: 8px;
  color: #b97a56;
  font-size: 1.1em; /* slightly smaller */
  font-weight: 700;
}

.news-text p {
  color: #5a3e2b;
  margin: 0;
  font-size: 0.9em; /* smaller text for a clean card */
  line-height: 1.5;
}

/* === Responsive Design for What's New === */
@media (max-width: 900px) {
  .whats-new-content {
    flex-wrap: wrap; /* stack when screen too narrow */
    justify-content: center;
  }

  .news-card {
    flex: 1 1 45%;
  }
}

@media (max-width: 600px) {
  .news-card {
    flex: 1 1 100%;
    max-width: 350px;
  }
}

/* === Mailing List Popup === */
.popup-overlay {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: rgba(255, 253, 248, 0.95);
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
  animation: popupFadeIn 0.4s ease;
}

.popup-content h3 {
  color: var(--dark-brown);
  font-size: 1.5em;
  margin-bottom: 10px;
}

.popup-content p {
  color: var(--dark-brown);
  font-size: 1em;
  margin-bottom: 20px;
}

.popup-button {
  display: inline-block;
  background-color: var(--medium-brown);
  color: #fffdf8;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.popup-button:hover {
  background-color: #8b573e;
  transform: scale(1.05);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--dark-brown);
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   Cart Drawer UI
   ============================================================ */
.cart-drawer {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 3000;
}
.cart-drawer[aria-hidden="false"] { display: block; }

.cart-drawer__panel {
  position: absolute; top: 0; right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fffdf8;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  padding: 1rem 1rem 2rem;
  overflow-y: auto;
  border-left: 3px solid var(--light-brown);
}

.cart-drawer__close {
  position: sticky; top: 0; float: right;
  font-size: 1.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--dark-brown);
}

.cart-items {
  display: grid;
  gap: .75rem;
  margin: 1rem 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  align-items: center;
  border-bottom: 1px solid #f1e6d6;
  padding-bottom: .75rem;
}

.cart-item__title { font-weight: 700; color: var(--dark-brown); }
.cart-item__meta { font-size: .92rem; color: #6a4b34; }

.qty-row { display: flex; gap: .5rem; align-items: center; margin-top: 6px; }
.qty-row input[type="number"] {
  width: 68px;
  padding: 6px 8px;
  border: 1px solid var(--light-brown);
  border-radius: 8px;
  background: #fff;
}
.remove-link {
  background: none;
  border: 0;
  color: #9b2c2c;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.remove-link:hover { background: #fde8e8; }

.cart-summary {
  background: #fff8ef;
  border: 1px solid var(--light-brown);
  border-radius: 12px;
  padding: 10px 12px;
}
.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin: .25rem 0;
  font-weight: 700;
  color: var(--dark-brown);
}

/* small success message */
.checkout-message { margin-top: .5rem; color: #2a7; }

/* accessibility focus */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--light-brown);
  outline-offset: 2px;
}

/* ================================
   Menu subsections + add-on rows
   (append to end of site.css)
   ================================ */

/* Section wrappers: Dessert Breads, Regular Breads, Muffins, Cookies, Fudge */
.menu-subsection { 
  margin: 28px 0 12px; 
}

/* Pills for subsection titles */
.subsection-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  color: var(--dark-brown);
  display: inline-block;
  padding: 6px 14px;
  border: 2px solid var(--light-brown);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 3px 8px var(--accent-shadow);
  margin: 0 auto 10px;
}

/* Add-on checkbox rows (Gluten-Free, Chocolate Chips, Walnuts, etc.) */
.addon-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  font-size: 0.98em;
  color: var(--dark-brown);
}
.addon-row input[type="checkbox"] { accent-color: var(--medium-brown); }

/* Slightly roomier opened panels (so variants/add-ons don’t feel cramped) */
.menu-details.show {
  padding-bottom: 22px;
}

/* Tiny tweak so variant radios align nicely on phones */
@media (max-width: 520px) {
  .variant-row { gap: 10px; }
}

/* ================================
   Responsive Header / Hamburger Nav
   ================================ */

/* ====== HAMBURGER: FORCE-VISIBLE, ABSOLUTE BARS ====== */
/* Button hitbox stays the same; we just pin the bars */
.hamburger {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1001; /* above any sliding panel */
}

.hamburger .bar {
  position: absolute !important;
  left: 9px !important;
  right: 9px !important;
  height: 3px !important;
  background: #ffffff !important; /* pure white, super visible */
  border-radius: 2px !important;
  opacity: 1 !important;
  transform: none; /* base state */
}

/* Y positions of the three bars */
.hamburger .bar:nth-child(1) { top: 12px !important; }
.hamburger .bar:nth-child(2) { top: 20px !important; }
.hamburger .bar:nth-child(3) { top: 28px !important; }

/* “X” animation when menu is open */
.hamburger.is-open .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg) !important;
}
.hamburger.is-open .bar:nth-child(2) {
  opacity: 0 !important;
}
.hamburger.is-open .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg) !important;
}

/* Make sure the header sits above all content */
.sticky-header { position: sticky; top: 0; z-index: 1000; }

/* Ensure the hamburger is actually shown on mobile */
@media (max-width: 900px) {
  .hamburger { display: inline-flex !important; }
}

/* ==== MOBILE NAV: start closed, open on .open ==== */
@media (max-width: 900px) {
  /* Hide panel & block clicks by default */
  nav.site-nav {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height .35s ease, opacity .25s ease;
    background: rgba(185,122,86,.95);
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 6px 12px var(--accent-shadow);
    width: 100%;
  }
  /* CRITICAL: override your global nav ul flex on mobile */
  nav.site-nav ul {
    display: none !important;
    list-style: none;
    margin: 10px;
    padding: 10px;
    gap: 8px;
  }
  nav.site-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
  }

  /* When open, reveal panel + list */
  nav.site-nav.open {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
  }
  nav.site-nav.open ul {
    display: grid !important;   /* stacked links */
  }

  /* Ensure the hamburger shows on mobile */
  .hamburger { display: inline-flex !important; }
}