/* ===================================================
   Astoria Delicatessen — Shared Styles
   =================================================== */

/* Custom Properties */
:root {
  --wine:       #7A1E1E;
  --wine-dark:  #5a1515;
  --wine-light: #9a2828;
  --cream:      #F5E6D3;
  --cream-dark: #e8d0b5;
  --gold:       #C8A96A;
  --gold-dark:  #a8894a;
  --dark:       #1C1C1C;
  --dark-muted: #3a3a3a;
  --white:      #FFFFFF;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--dark);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================================================
   TYPOGRAPHY
   =================================================== */
.font-heading { font-family: var(--font-heading); }

.text-wine        { color: var(--wine); }
.text-gold        { color: var(--gold); }
.text-cream       { color: var(--cream); }
.bg-wine          { background-color: var(--wine); }
.bg-wine-dark     { background-color: var(--wine-dark); }
.bg-cream         { background-color: var(--cream); }
.bg-gold          { background-color: var(--gold); }
.bg-dark          { background-color: var(--dark); }
.border-wine      { border-color: var(--wine); }
.border-gold      { border-color: var(--gold); }

/* ===================================================
   NAVIGATION
   =================================================== */
#main-nav {
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

#main-nav.nav-scrolled {
  background-color: var(--dark) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.35);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile menu */
#mobile-menu {
  display: none;
  flex-direction: column;
  background-color: var(--dark);
  padding: 1rem 1.5rem 1.5rem;
}

#mobile-menu.open { display: flex; }

#mobile-menu .nav-link {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1rem;
}

/* ===================================================
   HERO
   =================================================== */
.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(28,28,28,0.82) 0%,
    rgba(122,30,30,0.55) 60%,
    rgba(28,28,28,0.35) 100%
  );
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.1;
  font-weight: 800;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.65;
  font-weight: 300;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--wine);
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--wine-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122,30,30,0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--white);
  padding: 0.72rem 1.7rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid var(--gold);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--gold);
  color: var(--dark);
  transform: translateY(-2px);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--gold);
  color: var(--dark);
  padding: 0.72rem 1.7rem;
  border-radius: 0.375rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-gold:hover {
  background-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200,169,106,0.45);
}

/* ===================================================
   SECTION HEADINGS
   =================================================== */
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
}

.section-title.light { color: var(--white); }

.section-divider {
  width: 3.5rem;
  height: 3px;
  background: linear-gradient(90deg, var(--wine), var(--gold));
  border-radius: 99px;
  margin: 1rem 0 1.5rem;
}

.section-divider.centered { margin-left: auto; margin-right: auto; }

/* ===================================================
   PRODUCT CARDS
   =================================================== */
.product-card {
  background: var(--white);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.14);
}

.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

.product-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--wine);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
}

.product-card-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--wine);
}

/* ===================================================
   CATEGORY CARDS
   =================================================== */
.category-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.category-card:hover { transform: scale(1.025); }

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,28,28,0.85) 0%, rgba(28,28,28,0.15) 60%);
  transition: background 0.3s ease;
}

.category-card:hover .category-card-overlay {
  background: linear-gradient(to top, rgba(122,30,30,0.88) 0%, rgba(122,30,30,0.25) 55%);
}

/* ===================================================
   CART SIDEBAR
   =================================================== */
#cart-sidebar {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--white);
  z-index: 999;
  box-shadow: -6px 0 35px rgba(0,0,0,0.2);
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}

#cart-sidebar.open { right: 0; }

#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#cart-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: border-color 0.2s, background 0.2s;
  background: transparent;
}

.qty-btn:hover {
  border-color: var(--wine);
  background: var(--wine);
  color: var(--white);
}

/* ===================================================
   CART COUNTER BADGE
   =================================================== */
#cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold);
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ===================================================
   BREADCRUMB
   =================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
}

.breadcrumb a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--gold); }

.breadcrumb-sep { color: var(--gold); opacity: 0.6; }

.breadcrumb .current { color: var(--white); font-weight: 500; }

/* ===================================================
   PAGE HERO (inner pages)
   =================================================== */
.page-hero {
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.page-hero-overlay {
  background: linear-gradient(
    160deg,
    rgba(28,28,28,0.88) 0%,
    rgba(122,30,30,0.6) 100%
  );
}

/* ===================================================
   TESTIMONIALS
   =================================================== */
.testimonial-card {
  background: var(--white);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 3px 18px rgba(0,0,0,0.08);
  border-left: 4px solid var(--gold);
  transition: box-shadow 0.3s ease;
}

.testimonial-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
}

/* ===================================================
   FOOTER
   =================================================== */
footer {
  background-color: var(--dark);
  color: rgba(255,255,255,0.7);
}

footer a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--gold); }

.footer-heading {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-divider {
  border-color: rgba(255,255,255,0.1);
}

/* ===================================================
   SOCIAL ICONS
   =================================================== */
.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
  text-decoration: none;
}

.social-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200,169,106,0.1);
}

/* ===================================================
   WHATSAPP FLOATING BUTTON
   =================================================== */
#whatsapp-float {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 900;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  animation: whatsapp-pulse 2.5s infinite;
}

#whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,0.6);
  animation: none;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.5); }
  50%       { box-shadow: 0 4px 32px rgba(37,211,102,0.75); }
}

/* ===================================================
   FORMS
   =================================================== */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(122,30,30,0.12);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.form-error {
  font-size: 0.78rem;
  color: #dc2626;
  margin-top: 0.25rem;
  display: none;
}

.form-error.visible { display: block; }

/* ===================================================
   TOAST / NOTIFICATION
   =================================================== */
#toast-container {
  position: fixed;
  bottom: 5.5rem;
  right: 1.75rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--dark);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in 0.35s ease forwards;
  max-width: 320px;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.info    { border-left: 4px solid var(--gold); }

@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

.toast.removing { animation: toast-out 0.3s ease forwards; }

/* ===================================================
   STARS RATING
   =================================================== */
.stars { color: var(--gold); letter-spacing: 0.05em; }

/* ===================================================
   SCROLL TO TOP
   =================================================== */
#scroll-top {
  position: fixed;
  bottom: 5.5rem;
  left: 1.75rem;
  z-index: 900;
  width: 44px;
  height: 44px;
  background: var(--wine);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 14px rgba(122,30,30,0.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  border: none;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#scroll-top:hover { background: var(--wine-dark); }

/* ===================================================
   ANIMATION HELPERS
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===================================================
   UTILITY
   =================================================== */
.img-cover { width: 100%; height: 100%; object-fit: cover; }

.glass {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .page-hero { min-height: 280px; }
}

@media (max-width: 640px) {
  .page-hero { min-height: 220px; }
  #cart-sidebar { width: 100vw; }
  #whatsapp-float { bottom: 1.25rem; right: 1.25rem; }
  #scroll-top { bottom: 4.5rem; left: 1.25rem; }
}
