/* ==========================================================
   Brewed Roots Coffee - Luxury Editorial Specialty Theme
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-espresso: #160F0A;
  --color-roast-dark: #241810;
  --color-cream: #FAF7F2;
  --color-cream-card: #F4EFEA;
  --color-caramel: #C87D32;
  --color-amber: #E29547;
  --color-forest: #2E4A3E;
  --color-terracotta: #C85A32;
  --color-border: #E8DFC5;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
  font-family: var(--font-sans);
  background-color: var(--color-cream);
  color: var(--color-espresso);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Safe Area Inset Support */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

.pb-safe {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.pt-safe {
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
}

/* Prevent iOS Safari auto-zoom on input focus (minimum 16px on mobile) */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
}

/* Glassmorphism & Header */
.glass-header {
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 223, 197, 0.7);
}

.glass-dark {
  background: rgba(22, 15, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #FAF7F2;
}
::-webkit-scrollbar-thumb {
  background: #C87D32;
  border-radius: 4px;
}

/* Product Card Hover Zoom & Mobile Elevation */
.product-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  touch-action: manipulation;
}
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-6px);
  }
  .product-card .img-zoom {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .product-card:hover .img-zoom {
    transform: scale(1.06);
  }
}

/* Flavor Tag Pills */
.flavor-pill {
  transition: all 0.2s ease;
}
.flavor-pill:hover, .flavor-pill:active {
  background-color: var(--color-caramel);
  color: #FFFFFF;
}

/* Taste Quiz Animation */
.quiz-option {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
}
.quiz-option.active {
  border-color: var(--color-caramel);
  background-color: #F3EAE0;
  box-shadow: 0 0 0 2px var(--color-caramel);
}

/* Cart Drawer */
#cart-drawer {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
}
#cart-drawer.open {
  transform: translateX(0);
}
#cart-backdrop {
  transition: opacity 0.3s ease;
}
#cart-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Progress bar fill */
.progress-bar-fill {
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Toast Notifications (Positioned at Top to never block checkout buttons or bottom actions) */
#toast-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
@media (max-width: 640px) {
  #toast-container {
    left: 16px;
    right: 16px;
    top: calc(14px + env(safe-area-inset-top, 0px));
    bottom: auto;
    align-items: center;
  }
  .toast-msg {
    width: 100%;
    max-width: 380px;
  }
}
.toast-msg {
  pointer-events: auto;
  animation: slideDownToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@keyframes slideDownToast {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Menu Animation */
#mobile-menu-dropdown {
  animation: slideDownMenu 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideDownMenu {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge Pulse */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.animate-pulse-subtle {
  animation: pulse-subtle 2.5s infinite;
}

/* Modal Animations */
.modal-backdrop-animate {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-content-animate {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.tasting-pattern-bg {
  background-color: #261A13;
  background-image: radial-gradient(rgba(200, 125, 50, 0.08) 1px, transparent 0), radial-gradient(rgba(200, 125, 50, 0.04) 1px, #1c130e 0);
  background-size: 24px 24px, 12px 12px;
  background-position: 0 0, 12px 12px;
}

/* Mobile Scroll & Touch Smoothness */
.touch-scroll {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.touch-scroll::-webkit-scrollbar {
  display: none;
}

/* Tap Target Optimization */
button, a, input, select, textarea {
  touch-action: manipulation;
}

/* ==========================================
   HERO CAROUSEL STYLES
   ========================================== */
.hero-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: #160F0A;
  touch-action: pan-y pinch-zoom;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-nav-btn {
  transition: all 0.25s ease;
}

.hero-nav-btn:hover {
  transform: scale(1.08);
}

.hero-dot {
  transition: all 0.35s ease;
}

.hero-dot.active {
  width: 1.75rem;
  background-color: var(--color-caramel);
}

/* Chip Scroll Fade Mask for Horizontal Tabs on Mobile */
.chip-scroll-container {
  position: relative;
}
.chip-scroll-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.9));
  pointer-events: none;
}

/* Mobile Friendly Table Utilities */
.mobile-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Admin Dashboard Table Enhancements */
.admin-table th {
  letter-spacing: 0.05em;
  font-weight: 700;
}

.admin-table td {
  vertical-align: middle;
}
