/* ============================================================
   OLIVE & OAK BAKERY — style.css
   ============================================================ */

/* ---- Variables ---- */
:root {
  --olive: #4a5c3b;
  --olive-dark: #3a4a2d;
  --olive-light: #6b7c52;
  --cream: #f5f0e6;
  --cream-dark: #ede5d0;
  --brown: #7c5c3a;
  --brown-light: #a07848;
  --text-dark: #2c2416;
  --text-mid: #5a4a35;
  --text-light: #8a7a66;
  --white: #ffffff;
  --shadow: rgba(0,0,0,0.15);
  --shadow-strong: rgba(0,0,0,0.30);
  --header-h: 100px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--olive);
  box-shadow: 0 2px 12px var(--shadow-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Brand */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 2px;
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: var(--cream-dark);
  text-transform: uppercase;
}

/* Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border-radius: 30px;
  overflow: visible;
}
.header-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: inherit;
}
.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.search-btn {
  background: transparent;
  color: var(--cream);
  padding: 8px 14px;
  font-size: 0.95rem;
  transition: color .2s;
}
.search-btn:hover { color: var(--brown-light); }

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-strong);
  max-height: 260px;
  overflow-y: auto;
  display: none;
  z-index: 2000;
}
.search-dropdown.active { display: block; }
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s;
}
.search-item:hover { background: var(--cream); }
.search-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.search-item-info span { display: block; font-size: 0.85rem; font-weight: 700; }
.search-item-info small { color: var(--olive); font-size: 0.78rem; }

/* Cart icon */
.cart-wrapper { position: relative; flex-shrink: 0; }
.cart-icon-btn {
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  font-size: 1.1rem;
  transition: background .2s, transform .2s;
  position: relative;
}
.cart-icon-btn:hover { background: rgba(255,255,255,0.28); transform: scale(1.08); }
.cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--brown-light);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.cart-count.show { display: flex; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Navbar */
.navbar {
  background: var(--cream-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.navbar ul {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
}
.navbar ul li a {
  display: block;
  padding: 10px 28px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color .2s, background .2s;
}
.navbar ul li a:hover {
  color: var(--olive);
  background: rgba(74,92,59,0.08);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: url('https://images.unsplash.com/photo-1509440159596-0249088772ff?w=1400&q=80') center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(42,35,20,0.72) 0%, rgba(74,92,59,0.5) 100%);
}
.hero-content {
  position: relative;
  text-align: center;
  color: var(--white);
  padding: 0 20px;
  animation: fadeUp .8s ease both;
}
.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 28px;
  letter-spacing: 1px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--text-dark);
  color: var(--white);
  padding: 14px 36px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 3px;
  transition: background .25s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.btn-primary:hover {
  background: var(--olive);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* ============================================================
   SHOP / PRODUCTS
   ============================================================ */
.shop-section {
  background: var(--cream);
  padding: 50px 24px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px var(--shadow);
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px var(--shadow-strong);
}

.product-img {
  height: 200px;
  overflow: hidden;
}
.product-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.product-card:hover .product-img img { transform: scale(1.06); }

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.product-info .price {
  color: var(--olive);
  font-weight: 700;
  font-size: 1rem;
}
.add-btn {
  margin-top: auto;
  background: var(--olive);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, transform .15s;
}
.add-btn:hover { background: var(--olive-dark); transform: scale(1.02); }
.add-btn:active { transform: scale(0.97); }

/* ============================================================
   STORY
   ============================================================ */
.story-section {
  background: var(--cream-dark);
  padding: 60px 24px;
}
.story-inner {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.story-img {
  flex: 0 0 340px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow-strong);
}
.story-img img { width: 100%; height: 380px; object-fit: cover; }
.story-text { flex: 1; }
.story-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--text-dark);
  margin-bottom: 18px;
}
.story-text p {
  color: var(--text-mid);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.story-text .btn-primary { margin-top: 10px; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact-section {
  background: var(--olive);
  color: var(--cream);
  padding: 48px 24px 0;
}
.contact-inner {
  display: flex;
  gap: 40px;
  justify-content: space-around;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.contact-col h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--cream);
}
.contact-col p {
  font-size: 0.85rem;
  line-height: 2;
  color: rgba(245,240,230,0.82);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.contact-col p i { margin-top: 3px; color: var(--cream-dark); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  max-width: 900px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: rgba(245,240,230,0.6);
  flex-wrap: wrap;
  gap: 8px;
}
.klor { font-style: italic; }

/* ============================================================
   CART SIDEBAR
   ============================================================ */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.cart-overlay.active { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 360px; max-width: 100vw;
  height: 100vh;
  background: var(--white);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px var(--shadow-strong);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  background: var(--olive);
  color: var(--white);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-header h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; gap: 8px; display: flex; align-items: center; }
.close-cart {
  background: transparent;
  color: var(--white);
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .2s;
}
.close-cart:hover { background: rgba(255,255,255,0.15); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.empty-cart-msg {
  text-align: center;
  color: var(--text-light);
  margin-top: 40px;
  line-height: 1.8;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cream-dark);
}
.cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; }
.cart-item-info span { display: block; font-weight: 700; font-size: 0.9rem; }
.cart-item-info small { color: var(--olive); font-size: 0.83rem; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--text-dark);
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qty-btn:hover { background: var(--cream-dark); }
.qty-num { font-weight: 700; font-size: 0.9rem; min-width: 20px; text-align: center; }
.remove-btn { color: #c0392b; font-size: 1rem; background: transparent; margin-left: 4px; }

.cart-footer {
  padding: 16px 20px;
  border-top: 2px solid var(--cream-dark);
}
.cart-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}
.cart-total span { color: var(--olive); }
.btn-checkout {
  width: 100%;
  background: var(--olive);
  color: var(--white);
  padding: 13px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkout:hover { background: var(--olive-dark); }
.btn-clear {
  width: 100%;
  background: transparent;
  color: #c0392b;
  padding: 10px;
  border: 1px solid #c0392b;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.btn-clear:hover { background: #c0392b; color: #fff; }

/* ============================================================
   CART PAGE (full)
   ============================================================ */
.cart-page {
  position: fixed; inset: 0;
  background: var(--cream);
  z-index: 2000;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.cart-page.open { transform: translateX(0); }

.cart-page-header {
  background: var(--olive);
  color: var(--white);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.back-btn {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background .2s;
  display: flex; align-items: center; gap: 8px;
}
.back-btn:hover { background: rgba(255,255,255,0.28); }
.cart-page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  display: flex; align-items: center; gap: 10px;
}

.cart-page-body {
  display: flex;
  gap: 32px;
  padding: 32px 28px;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.cart-page-items { flex: 1; min-width: 280px; }
.empty-cart-big {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-cart-big i { font-size: 3.5rem; color: var(--cream-dark); margin-bottom: 16px; }
.empty-cart-big p { font-size: 1.1rem; margin-bottom: 24px; }

.cart-page-item {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px var(--shadow);
}
.cart-page-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; }
.cart-page-item-info { flex: 1; }
.cart-page-item-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.cart-page-item-info .unit-price { color: var(--text-light); font-size: 0.83rem; }
.cart-page-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-page-item-controls .qty-btn { width: 32px; height: 32px; font-size: 1rem; }
.cart-page-item-controls .qty-num { font-size: 1rem; min-width: 28px; }
.cart-page-item-price { font-weight: 700; color: var(--olive); font-size: 1rem; min-width: 60px; text-align: right; }

.cart-page-summary {
  width: 300px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 18px var(--shadow);
  align-self: flex-start;
  position: sticky;
  top: 20px;
}
.cart-page-summary h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cream-dark);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text-mid);
}
.summary-row.total-row {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-dark);
  border-top: 2px solid var(--cream-dark);
  margin-top: 8px;
  padding-top: 14px;
}
.btn-checkout.full, .btn-clear.full { margin-top: 14px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--olive-dark);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 3000;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s;
  opacity: 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .story-inner { flex-direction: column; }
  .story-img { flex: unset; width: 100%; }
  .story-img img { height: 260px; }
}

@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; flex: 0 0 100%; max-width: 100%; }
  .hamburger { display: flex; }

  .navbar {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .navbar.open { max-height: 200px; }
  .navbar ul { flex-direction: column; align-items: center; padding: 8px 0; }

  .products-grid { grid-template-columns: 1fr; }
  .hero { height: 380px; }
  .hero-content h1 { font-size: 1.8rem; }

  .cart-sidebar { width: 100vw; }

  .cart-page-body { padding: 20px 16px; }
  .cart-page-summary { width: 100%; position: static; }

  .contact-inner { flex-direction: column; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .brand-name { font-size: 1.05rem; }
  .btn-primary { padding: 11px 24px; font-size: 0.82rem; }
}
