/* ==========================================================================
   Morning Brew Cafe - Premium Design System & Stylesheet
   ========================================================================== */

/* === 1. Google Fonts & Custom Properties === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  /* Typography */
  --font-sans: 'Poppins', sans-serif;
  --font-serif: 'Playfair Display', serif;

  /* Color Palette (Coffee-Latte HSL Theme) */
  --color-espresso: hsl(24, 34%, 12%);      /* Deep Espresso Brown */
  --color-latte: hsl(24, 25%, 35%);         /* Rich Roasted Bean */
  --color-beige: hsl(30, 52%, 64%);         /* Creamy Honey Highlight */
  --color-cream: hsl(36, 40%, 97%);         /* Soft Warm Background */
  --color-white: hsl(0, 0%, 100%);
  --color-light-gray: hsl(0, 0%, 96%);

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(111, 78, 55, 0.12);
  --glass-shadow: 0 12px 40px rgba(43, 27, 23, 0.08);

  /* Layout Tokens */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* === 2. Global Reset & Base Styles === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-espresso);
  background-color: var(--color-espresso);
  /* Fallback color while image is compressed & loaded */
  background-image: linear-gradient(rgba(28, 14, 11, 0.65), rgba(28, 14, 11, 0.65)), url('../assets/imgs/bg.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

/* === 3. Headings & Typography === */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-espresso);
  line-height: 1.3;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--color-beige);
  border-radius: 2px;
}

p {
  margin-bottom: 1.25rem;
  color: var(--color-latte);
}

.text-center {
  text-align: center;
}

/* === 4. Layout & Containers === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 7rem 0 3rem;
}

/* Premium Glassmorphism Card Base */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 3rem;
  margin-bottom: 4rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  box-shadow: 0 20px 48px rgba(43, 27, 23, 0.12);
  border-color: rgba(111, 78, 55, 0.2);
}

/* === 5. Dynamic Navigation & Header === */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

header.scrolled {
  padding: 0.8rem 5%;
  background: rgba(28, 14, 11, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

header.scrolled h1 {
  font-size: 1.5rem;
  color: var(--color-cream);
}

header h1 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-white);
  transition: var(--transition-smooth);
}

header h1 a {
  color: inherit;
}

nav ul {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

nav a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
}

header.scrolled nav a {
  color: rgba(255, 255, 255, 0.85);
}

nav a:hover, header.scrolled nav a:hover {
  color: var(--color-beige);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-beige);
  transition: var(--transition-smooth);
}

nav a:hover::after {
  width: 100%;
}

/* === 6. Hero / Welcome Section === */
.hero {
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: 0 1rem;
}

.hero-content {
  max-width: 800px;
  animation: fadeIn 1.2s ease-out;
}

.hero h2 {
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 1.5rem;
}

.hero h2::after {
  display: none;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  font-weight: 300;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.95rem 2rem;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 50px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-beige);
  color: var(--color-espresso);
}

.btn-primary:hover {
  background-color: var(--color-cream);
  color: var(--color-espresso);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(212, 163, 115, 0.3);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white);
  margin-left: 1rem;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
  transform: translateY(-3px);
}

/* === 7. About Us Section === */
#about p {
  font-size: 1.05rem;
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

/* === 8. Our Menu Section (Stunning Card Grid) === */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  margin-top: 3.5rem;
}

.menu-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(111, 78, 55, 0.08);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.menu-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(111, 78, 55, 0.15);
}

.menu-img-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.menu-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.menu-card:hover img {
  transform: scale(1.08);
}

.menu-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.menu-info h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-espresso);
  margin-bottom: 0.5rem;
}

.menu-desc {
  font-size: 0.9rem;
  color: var(--color-latte);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--color-light-gray);
}

.menu-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-beige);
  background: rgba(212, 163, 115, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
}

.menu-price {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-espresso);
}

/* === 9. Testimonials Section (Interactive Slider) === */
.testimonial-slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 0;
  overflow: hidden;
}

.slides-container {
  position: relative;
  min-height: 180px; /* robust minimum height */
}

.slide {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  transform: translateY(15px);
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  transform: translateY(0);
}

.testimonial-block {
  text-align: center;
  padding: 1rem 0;
  max-width: 700px;
  margin: 0 auto;
}

.testimonial-block blockquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--color-espresso);
  margin-bottom: 1.5rem;
}

.testimonial-block cite {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  font-style: normal;
  color: var(--color-beige);
  letter-spacing: 0.5px;
}

/* Slider Controls */
.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.slider-btn {
  background: rgba(111, 78, 55, 0.08);
  border: none;
  color: var(--color-espresso);
  font-size: 0.9rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.slider-btn:hover {
  background: var(--color-beige);
  color: var(--color-espresso);
  transform: scale(1.08);
}

.slider-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.3);
}

.slider-dots {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(111, 78, 55, 0.2);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dot.active {
  background: var(--color-beige);
  transform: scale(1.3);
}

/* Split Grid for Opening Hours & Contact */
.contact-split-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

/* Opening Hours Card */
.hours-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
}

.hours-list {
  margin-top: 2rem;
}

.hours-item {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(111, 78, 55, 0.08);
}

.hours-item:last-child {
  border-bottom: none;
}

.hours-day {
  font-weight: 600;
  color: var(--color-espresso);
}

.hours-time {
  color: var(--color-latte);
}

/* === 10. Contact Us Form === */
.contact-card {
  padding: 3rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

form label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-latte);
}

form input[type="text"],
form input[type="email"],
form textarea {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(111, 78, 55, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.65);
  color: var(--color-espresso);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
  outline: none;
  border-color: var(--color-beige);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(212, 163, 115, 0.15);
}

form input[type="submit"] {
  background-color: var(--color-espresso);
  color: var(--color-cream);
  padding: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 1rem;
  letter-spacing: 0.5px;
}

form input[type="submit"]:hover {
  background-color: var(--color-beige);
  color: var(--color-espresso);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(111, 78, 55, 0.15);
}

/* === 11. Footer Styling === */
footer {
  background: var(--color-espresso);
  color: var(--color-cream);
  padding: 4rem 2rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.footer-content p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-beige);
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* === 12. Custom Dynamic Toast (JS Popup) === */
.cafe-toast {
  position: fixed;
  bottom: -100px;
  right: 30px;
  background: var(--color-espresso);
  color: var(--color-cream);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  padding: 1.25rem 2rem;
  z-index: 10000;
  max-width: 400px;
  overflow: hidden;
  transition: var(--transition-smooth);
  opacity: 0;
  transform: translateY(20px);
}

.cafe-toast.visible {
  bottom: 30px;
  opacity: 1;
  transform: translateY(0);
}

.cafe-toast-content p {
  color: var(--color-cream);
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.cafe-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: var(--color-beige);
  animation: shrinkWidth 4s linear forwards;
}

/* === 13. Dynamic Keyframes === */
@keyframes shrinkWidth {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === 14. Responsive Layout Adjustments === */
@media (max-width: 1024px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  .contact-split-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  header {
    padding: 1rem 5%;
    flex-direction: column;
    gap: 1rem;
    background: rgba(28, 14, 11, 0.98);
  }
  
  header.scrolled {
    padding: 1rem 5%;
  }

  nav ul {
    gap: 1.5rem;
  }

  .hero h2 {
    font-size: 2.75rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .btn-secondary {
    margin-left: 0;
    margin-top: 1rem;
    display: block;
  }
  
  .glass-card {
    padding: 2rem 1.5rem;
  }
  
  .hours-card, .contact-card {
    padding: 2rem 1.5rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .cafe-toast {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}