/* =============================================
   GLOBAL STYLES — Bakery & Gifting E-commerce
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary:       #9e3b5c; /* Berry */
  --primary-dark:  #7f2f4a; /* Deep berry */
  --primary-light: #ffd2da; /* Soft pink */
  --accent:        #d4a353; /* Gold */
  --accent-dark:   #b98737; /* Deep gold */
  --accent-light:  #ffe8ec; /* Pale pink */
  --dark:          #2a2226; /* Charcoal (no brown) */
  --medium:        #6e6368;
  --light:         #9a9094;
  --border:        #f0dce2;
  --bg:            #fff8fa;
  --white:         #ffffff;
  --success:       #3aaa6e;
  --warning:       #f0a500;
  --error:         #e04040;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.13);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-full:   999px;
  --font-heading:  'Playfair Display', serif;
  --font-body:     'Poppins', sans-serif;
  --transition:    all 0.25s ease;
  --header-height: 70px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, textarea, select { font-family: var(--font-body); outline: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-family: var(--font-heading); line-height: 1.3; color: var(--dark); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p  { color: var(--medium); font-size: 0.95rem; }

/* ---- Layout ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.section { padding: 4px 0; }
.section-sm { padding: 40px 0; }

/* ---- Section Header ---- */
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { margin-bottom: 10px; }
.section-header p { color: var(--light); max-width: 500px; margin: 0 auto; }
.section-header .divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 14px auto 0; border-radius: var(--radius-full);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.3px;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(158,59,92,0.28);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(158,59,92,0.36); }
.btn-secondary {
  background: var(--primary-light); color: var(--primary);
  border: 2px solid var(--primary-light);
}
.btn-secondary:hover { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-accent {
  background: var(--accent);
  color: var(--dark);
  box-shadow: 0 4px 14px rgba(212,163,83,0.24);
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,163,83,0.32); }
.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.7); }
.btn-outline-white:hover { background: var(--white); color: var(--primary); }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 15px 36px; font-size: 1rem; }

/* ---- Badge ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent   { background: var(--accent);  color: var(--primary);  }
.badge-success  { background: #e6f7ef; color: var(--success); }
.badge-dark     { background: var(--dark); color: var(--white); }

/* ---- Card ---- */
.card {
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* ---- Product Card ---- */
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: var(--transition); position: relative;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.product-card .img-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 1; background: var(--bg);
}
.product-card .img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .img-wrap img { transform: scale(1.06); }
.product-card .wishlist-btn {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--white); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); cursor: pointer; border: none;
  color: var(--light); font-size: 1rem; transition: var(--transition);
}
.product-card .wishlist-btn:hover { color: var(--primary); transform: scale(1.1); }
.product-card .card-body { padding: 14px; background: var(--white); color: var(--dark); }
.product-card .product-name {
  font-size: 0.9rem; font-weight: 600; color: var(--dark);
  margin-bottom: 6px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.product-card .price { font-size: 1rem; font-weight: 700; color: var(--primary); }
.product-card .price-original { font-size: 0.82rem; text-decoration: line-through; color: var(--light); }
.product-card .discount { font-size: 0.78rem; font-weight: 600; color: var(--success); }
.stock-count {
  margin: 6px 0 10px;
  font-size: 0.84rem;
  font-weight: 600;
}
.product-card .stock-count { display: block; padding: 0; background: transparent; }
.stock-count.in-stock { color: #15803d; }
.stock-count.out-of-stock { color: #b42318; }
.product-info .stock-count { margin: 4px 0 14px; font-size: 0.92rem; }
.product-card .card-weight-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px;
  margin: 8px 0 10px;
}
.product-card .card-weight-option {
  min-height: 32px; padding: 6px 4px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--medium);
  font-size: 0.76rem; font-weight: 600; line-height: 1;
  transition: var(--transition);
}
.product-card .card-weight-option:hover,
.product-card .card-weight-option.active {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}
.product-card .add-btn {
  width: 100%; padding: 9px; background: var(--primary); color: var(--white);
  font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-sm);
  transition: var(--transition); border: none; cursor: pointer;
}
.product-card .add-btn:hover { background: var(--primary-dark); color: var(--white); }
.product-card .stars { color: var(--accent); }
.product-card .stars .rating-text { color: var(--light) !important; }
.product-card .add-btn:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}
.product-card .card-badge {
  position: absolute; top: 10px; left: 10px;
}

/* ---- Grid Layouts ---- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ---- Horizontal Scroll Row ---- */
.scroll-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.scroll-row::-webkit-scrollbar { height: 4px; }
.scroll-row::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
.scroll-row > * { scroll-snap-align: start; flex-shrink: 0; }

/* ---- Form Elements ---- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; color: var(--dark); }
.form-control {
  width: 100%; padding: 11px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--dark); background: var(--white);
  transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(158,59,92,0.14); }
.form-control::placeholder { color: #bbb; }
textarea.form-control { resize: vertical; min-height: 110px; }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 16px 0; font-size: 0.84rem; }
.breadcrumb a { color: var(--light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--light); }
.breadcrumb .current { color: var(--dark); font-weight: 500; }

/* ---- Page Banner ---- */
.page-banner {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  padding: 36px 0; text-align: center;
}
.page-banner h1 { margin-bottom: 10px; }
.page-banner p { color: var(--medium); }

/* ---- Rating Stars ---- */
.stars { color: var(--accent); font-size: 0.9rem; letter-spacing: 1px; }
.rating-text { font-size: 0.82rem; color: var(--light); margin-left: 4px; }

/* ---- Announcement Bar ---- */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  color: var(--white); text-align: center; padding: 9px 20px;
  font-size: 0.84rem; font-weight: 500; letter-spacing: 0.3px;
}
.announcement-bar a { color: var(--white); text-decoration: underline; }

/* ---- Header ---- */
.header {
  background: var(--white); position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  height: var(--header-height);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 100%;
}
.logo { flex-shrink: 0; }
.logo a { display: flex; align-items: center; }
.site-logo { height: 54px; width: auto; display: block; }
.footer-logo { height: 70px; width: auto; display: block; margin-bottom: 14px; }

.search-bar {
  flex: 1; max-width: 480px;
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  overflow: hidden; background: var(--bg);
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(158,59,92,0.14); }
.search-bar input {
  flex: 1; padding: 10px 16px; border: none; background: transparent;
  font-size: 0.88rem; color: var(--dark);
}
.search-bar button {
  padding: 10px 18px; background: var(--primary); color: white;
  border: none; font-size: 1rem; transition: var(--transition);
}
.search-bar button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 10px; border-radius: var(--radius-sm); border: none;
  background: transparent; color: var(--medium); cursor: pointer;
  font-size: 0.7rem; gap: 2px; transition: var(--transition);
  position: relative;
}
.header-btn:hover { color: var(--primary); background: var(--primary-light); }
.header-btn .icon { font-size: 1.2rem; }
.cart-count {
  position: absolute; top: 2px; right: 6px;
  background: var(--primary); color: white;
  border-radius: 50%; width: 17px; height: 17px;
  font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cart-count[hidden] { display: none !important; }

/* ---- Nav Menu ---- */
.nav-menu {
  background: var(--white); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 0; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 13px 16px; font-size: 0.88rem; font-weight: 500;
  color: var(--dark); white-space: nowrap;
  transition: var(--transition); border-bottom: 2px solid transparent;
}
.nav-link:hover, .nav-item:hover .nav-link {
  color: var(--primary); border-bottom-color: var(--primary);
}
.nav-link .arrow { font-size: 0.65rem; transition: var(--transition); }
.nav-item:hover .nav-link .arrow { transform: rotate(180deg); }

/* Mega Menu */
.mega-menu {
  position: absolute; top: 100%; left: 0;
  background: var(--white); border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 600px;
  display: none; padding: 24px; z-index: 999;
  border-top: 3px solid var(--primary);
  grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.nav-item:hover .mega-menu { display: grid; }
.mega-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); margin-bottom: 12px; font-family: var(--font-body); font-weight: 700; }
.mega-col ul li a { display: block; padding: 5px 0; font-size: 0.85rem; color: var(--medium); }
.mega-col ul li a:hover { color: var(--primary); padding-left: 4px; }
.mega-simple {
  position: absolute; top: 100%; left: 0;
  background: var(--white); border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 200px;
  display: none; padding: 12px 0; z-index: 999;
  border-top: 3px solid var(--primary);
}
.nav-item:hover .mega-simple { display: block; }
.mega-simple a { display: block; padding: 9px 20px; font-size: 0.87rem; color: var(--medium); }
.mega-simple a:hover { background: var(--primary-light); color: var(--primary); }

/* ---- WhatsApp Float ---- */
.whatsapp-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25d366; color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  transition: var(--transition);
  text-decoration: none;
}
.whatsapp-float svg { display: block; width: 28px; height: 28px; }
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,0.55); color: white; }

/* ---- Footer ---- */
.footer { background: #2a2226; color: #ccc; padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand .logo-area { margin-bottom: 0; }
.footer-brand p { font-size: 0.87rem; line-height: 1.7; color: #999; margin-bottom: 20px; }
.social-links { display: flex; gap: 10px; }
.social-link {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: #ccc;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: var(--transition);
}
.social-link:hover { background: var(--primary); color: white; }
.footer-col h4 { color: var(--white); font-size: 0.95rem; font-family: var(--font-body); font-weight: 600; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { font-size: 0.86rem; color: #999; transition: var(--transition); }
.footer-col ul li a:hover { color: var(--primary); padding-left: 4px; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.86rem; color: #999; margin-bottom: 12px; }
.footer-contact li .ic { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.newsletter-form { display: flex; margin-top: 12px; }
.newsletter-form input {
  flex: 1; padding: 10px 14px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-full) 0 0 var(--radius-full);
  color: white; font-size: 0.85rem;
}
.newsletter-form input::placeholder { color: #777; }
.newsletter-form button {
  padding: 10px 18px; background: var(--primary); color: white;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  font-size: 0.85rem; font-weight: 600;
}
.newsletter-form button:hover { background: var(--primary-dark); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.footer-bottom p { font-size: 0.82rem; color: #666; }
.footer-bottom .payment-icons { display: flex; gap: 8px; align-items: center; }
.payment-icon {
  background: rgba(255,255,255,0.12); padding: 4px 10px;
  border-radius: 4px; font-size: 0.72rem; color: #ccc; font-weight: 600;
}

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 30px 0; }
.page-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--medium); font-size: 0.88rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); cursor: pointer;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 90px; right: 28px; z-index: 9999;
  background: var(--dark); color: white; padding: 12px 20px;
  border-radius: var(--radius-md); font-size: 0.88rem;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }

/* ---- Sidebar promo banner ---- */
.promo-sidebar {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 850;
  width: 110px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.promo-sidebar-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.promo-sidebar img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.promo-sidebar-title {
  display: block;
  padding: 8px 10px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark);
  text-align: center;
}
.promo-sidebar-cta {
  display: block;
  padding: 0 10px 10px;
  font-size: 0.68rem;
  color: var(--primary);
  text-align: center;
  font-weight: 600;
}
.promo-sidebar-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
@media (max-width: 768px) {
  .promo-sidebar { display: none; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .nav-menu { display: none; }
  .search-bar { display: none; }
  .section { padding: 4px 0; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
}

.product-card .wishlist-btn.wishlisted { color: #e11d48; }
