/* MI VIEJO CAFÉ - Estilos Globales Premium */

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

:root {
  --primary-dark: #2A1A12;      /* Café muy oscuro */
  --primary: #4A3325;           /* Café tostado */
  --primary-light: #70533E;     /* Café suave */
  --accent-gold: #C5A059;       /* Oro Viejo */
  --accent-gold-dark: #A6823C;  /* Oro Oscuro */
  --bg-creme: #FDFBF7;          /* Crema claro */
  --bg-creme-dark: #F5EFE4;     /* Crema oscuro */
  --text-dark: #1E120C;         /* Texto principal */
  --text-muted: #6B5B52;        /* Texto secundario */
  --shadow-warm: 0 10px 30px rgba(74, 51, 37, 0.08);
  --shadow-gold: 0 10px 20px rgba(197, 160, 89, 0.2);
}

* {
  font-family: 'Poppins', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) var(--bg-creme-dark);
}

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-creme-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold-dark);
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
}

body {
  background-color: var(--bg-creme);
  color: var(--text-dark);
}

.font-serif-header {
  font-family: 'Cinzel', 'Playfair Display', serif;
}

/* Glassmorphism Classes */
.glass-nav {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(253, 251, 247, 0.85);
  border-bottom: 1px solid rgba(74, 51, 37, 0.08);
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 51, 37, 0.05);
}

/* Gold Gradient Button */
.btn-gold-gradient {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-gold);
}

.btn-gold-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(197, 160, 89, 0.35);
}

.btn-gold-gradient:active {
  transform: translateY(0);
}

/* Coffee Gradient Button */
.btn-coffee {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(74, 51, 37, 0.15);
}

.btn-coffee:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(74, 51, 37, 0.25);
}

.btn-coffee:active {
  transform: translateY(0);
}

/* Trapezoid Category Button Styles */
.category-pill-trapezoid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
  flex-shrink: 0;
  width: 100%;       /* Fill parent wrapper width! */
  height: 105px;     /* Taller, easy-to-click on mobile */
}

/* For mobile, active button scales up slightly */
@media (max-width: 767px) {
  .category-pill-trapezoid.active {
    transform: scale(1.08) translateY(-2px); /* Slightly enlarged and lifted */
    z-index: 10;
  }
}

/* For desktop, all buttons have a very large matching size */
@media (min-width: 768px) {
  .category-pill-trapezoid {
    height: 155px;
  }
  /* Active desktop highlight scales and lifts button significantly */
  .category-pill-trapezoid.active {
    transform: scale(1.1) translateY(-4px);
    z-index: 10;
  }
}

/* Tighter gap to let buttons mesh/fit closely together */
#categories-container {
  gap: 0.5rem;
}

@media (max-width: 767px) {
  #categories-container {
    gap: 0.12rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

.category-pill-trapezoid:hover {
  transform: scale(1.06) translateY(-2px);
}

.category-pill-trapezoid:active {
  transform: scale(0.95);
}

/* Image label buttons styling */
.category-pill-trapezoid.image-pill img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0.9) contrast(1.05);
  transition: all 0.3s ease;
}

.category-pill-trapezoid.image-pill.active img {
  filter: brightness(1.12) contrast(1.1) drop-shadow(0 0 10px rgba(197, 160, 89, 0.8));
  transform: scale(1.03);
}

.category-pill-trapezoid.image-pill:hover img {
  filter: brightness(1.08) contrast(1.1);
}

/* Text label buttons styled as physical wooden/chalkboard trapezoids */
.category-pill-trapezoid .trapezoid-card {
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(135deg, #321E14 0%, #1A100B 100%);
  border: 1px solid rgba(197, 160, 89, 0.35);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;   /* Larger text on mobile */
  letter-spacing: 0.05em;
  color: #F5EFE4;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.65);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 10px;
}

@media (min-width: 768px) {
  .category-pill-trapezoid .trapezoid-card {
    font-size: 15px; /* Larger text on desktop */
    padding: 0 16px;
  }
}

.category-pill-trapezoid.text-pill.active .trapezoid-card {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: #1A100B;
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px rgba(197, 160, 89, 0.45), inset 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Premium Card hover effects */
.product-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-warm);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(74, 51, 37, 0.12);
}

.product-card .img-container {
  overflow: hidden;
}

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

/* Cart Drawer and Modals */
.drawer-transition {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast Notifications */
.toast {
  animation: slideIn 0.3s forwards, fadeOut 0.3s 2.7s forwards;
}

@keyframes slideIn {
  from { transform: translateY(100px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* Hero Carousel */
.carousel-slide {
  transition: opacity 0.8s ease-in-out;
}

/* Brand Logo Styling and Blend Modes */
.logo-on-light {
  filter: invert(1);
  mix-blend-mode: multiply;
}

.logo-on-dark {
  mix-blend-mode: screen;
}

.dark .logo-on-light {
  filter: none !important;
  mix-blend-mode: screen !important;
}

/* --- PREMIUM DARK MODE SYSTEM --- */
.dark {
  --bg-creme: #150D0A;          /* Fondo base café oscuro */
  --bg-creme-dark: #22140E;     /* Superficies y tarjetas */
  --text-dark: #FAF6F0;         /* Texto claro crema */
  --text-muted: #CCA98E;        /* Subtextos cálidos */
  --shadow-warm: 0 15px 35px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 10px 20px rgba(197, 160, 89, 0.15);
}

.dark body {
  background-color: #150D0A !important;
  color: #FAF6F0 !important;
}

/* Overrides para contenedores y tarjetas */
.dark .bg-white {
  background-color: #22140E !important;
  color: #FAF6F0 !important;
}

.dark .bg-coffee-50 {
  background-color: #1A100B !important;
}

.dark .bg-coffee-100 {
  background-color: #2D1B13 !important;
}

.dark .text-coffee-900,
.dark .text-coffee-800,
.dark .text-coffee-700 {
  color: #FAF6F0 !important;
}

.dark .text-coffee-600,
.dark .text-coffee-500 {
  color: #CCA98E !important;
}

.dark .text-coffee-400 {
  color: #A6826B !important;
}

.dark .border-coffee-50/50,
.dark .border-coffee-100,
.dark .border-coffee-200,
.dark .border-coffee-300 {
  border-color: rgba(197, 160, 89, 0.15) !important;
}

.dark .glass-nav {
  background: rgba(21, 13, 10, 0.85) !important;
  border-bottom: 1px solid rgba(197, 160, 89, 0.15) !important;
}

.dark .glass-card {
  background: rgba(34, 20, 14, 0.7) !important;
  border: 1px solid rgba(197, 160, 89, 0.1) !important;
}

/* Scrollbar en Modo Oscuro */
.dark ::-webkit-scrollbar-track {
  background: #1A100B !important;
}

/* Select, Input y Textarea en Modo Oscuro */
.dark select,
.dark input,
.dark textarea {
  background-color: #1A100B !important;
  color: #FAF6F0 !important;
  border-color: rgba(197, 160, 89, 0.2) !important;
}

.dark select option {
  background-color: #1A100B !important;
  color: #FAF6F0 !important;
}

.dark .category-pill-trapezoid .trapezoid-card {
  background: linear-gradient(135deg, #1A100B 0%, #0D0604 100%) !important;
  border: 1px solid rgba(197, 160, 89, 0.25) !important;
}

.dark .category-pill-trapezoid.text-pill.active .trapezoid-card {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%) !important;
  color: #1A100B !important;
}

/* Modales en Modo Oscuro */
.dark #product-detail-modal > div,
.dark #edit-profile-modal > div,
.dark #auth-modal > div,
.dark #upsell-modal > div,
.dark #order-detail-modal > div {
  background-color: #22140E !important;
  border-color: rgba(197, 160, 89, 0.2) !important;
  color: #FAF6F0 !important;
}

/* Botón de cierre en Modo Oscuro */
.dark button[onclick*="close"] {
  background-color: #1A100B !important;
  border-color: rgba(197, 160, 89, 0.2) !important;
  color: #FAF6F0 !important;
}

/* Elementos administrativos en modo oscuro */
.dark aside,
.dark header {
  background-color: #0D0604 !important;
  border-color: rgba(197, 160, 89, 0.15) !important;
}

.dark .bg-coffee-800 {
  background-color: #150D0A !important;
}

.dark .bg-coffee-900 {
  background-color: #0D0604 !important;
}

.dark table th {
  background-color: #1A100B !important;
  color: #CCA98E !important;
}

.dark table tr {
  border-color: rgba(197, 160, 89, 0.1) !important;
}

.dark table tr:hover {
  background-color: rgba(197, 160, 89, 0.05) !important;
}

/* --- FICHA DE RECOLECCIÓN (BOLETO DE RIFA RETRO) --- */
.raffle-ticket {
  background: #fff;
  border-radius: 24px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(197, 160, 89, 0.25);
  overflow: hidden;
}

.raffle-ticket-stub {
  background: linear-gradient(135deg, #1A100B 0%, #2A1A12 100%);
  color: #fff;
  border-right: 2px dashed rgba(197, 160, 89, 0.4);
  position: relative;
}

.raffle-ticket-main {
  position: relative;
}

/* Muescas circulares de corte de boleto */
.raffle-ticket-notch-top {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: #1a100b; /* Color del overlay del modal */
  border-radius: 50%;
  z-index: 20;
}

.raffle-ticket-notch-bottom {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: #1a100b; /* Color del overlay del modal */
  border-radius: 50%;
  z-index: 20;
}

.dark .raffle-ticket-notch-top,
.dark .raffle-ticket-notch-bottom {
  background-color: #1a100b !important;
}

/* Custom Coffee Cup Video Loader */
.coffee-loader-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.coffee-loader-video-wrapper {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  border-radius: 50%;
}

.coffee-loader-video {
  width: 120px;
  height: 120px;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: contrast(1.5) brightness(1.15);
  transform: scale(1.3);
}

.dark .coffee-loader-video {
  mix-blend-mode: screen;
  filter: invert(1) contrast(1.5) brightness(1.25);
}

/* Animated Coffee Steam SVG Loader */
.coffee-steam {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
  animation: steam-sway 2.5s infinite linear;
  opacity: 0;
  transform-origin: bottom center;
}

.steam-left {
  animation-delay: 0.3s;
}

.steam-center {
  animation-delay: 1.0s;
}

.steam-right {
  animation-delay: 1.7s;
}

@keyframes steam-sway {
  0% {
    stroke-dashoffset: 20;
    opacity: 0;
    transform: translateY(2px) scaleX(0.85);
  }
  30% {
    opacity: 0.65;
  }
  60% {
    opacity: 0.65;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
    transform: translateY(-10px) scaleX(1.15);
  }
}
