/* ============================================================
   CARDAPIO DIGITAL - Custom CSS
   Complementary styles for Tailwind CSS
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Custom Properties
   ---------------------------------------------------------- */
:root {
  --primary: #d4a053;
  --primary-dark: #b8862d;
  --primary-light: #f0d48a;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --dark: #1a1a2e;
  --dark-surface: #16213e;
  --dark-card: #1e2a47;
  --light: #fafafa;
  --light-surface: #ffffff;
  --light-card: #ffffff;
  --text-dark: #1a1a2e;
  --text-light: #e8e8e8;
  --text-muted: #6b7280;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.2);
  --gold-glow: rgba(212, 160, 83, 0.35);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------
   2. Dark Mode
   ---------------------------------------------------------- */
body {
  background-color: var(--light);
  color: var(--text-dark);
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

.dark body,
body.dark {
  background-color: var(--dark);
  color: var(--text-light);
}

.dark .bg-surface,
body.dark .bg-surface {
  background-color: var(--dark-surface);
}

.dark .bg-card,
body.dark .bg-card {
  background-color: var(--dark-card);
}

.dark .text-muted,
body.dark .text-muted {
  color: #94a3b8;
}

.dark .border-default,
body.dark .border-default {
  border-color: rgba(255, 255, 255, 0.08);
}

/* ----------------------------------------------------------
   3. Keyframe Animations
   ---------------------------------------------------------- */

/* Fade in from below */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide up entrance */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale entrance */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gentle float for WhatsApp button */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Loading skeleton shimmer */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Soft pulse for badges */
@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.5s var(--transition-slow) both;
}

.animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-scale-in {
  animation: scaleIn 0.35s ease both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .animate-shimmer {
  background: linear-gradient(90deg, var(--dark-card) 25%, var(--dark-surface) 50%, var(--dark-card) 75%);
  background-size: 200% 100%;
}

.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

/* Staggered children animation */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.50s; }

/* ----------------------------------------------------------
   4. Custom Scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

/* Horizontal category scroll - hide scrollbar */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ----------------------------------------------------------
   5. Card Hover Effects
   ---------------------------------------------------------- */
.card {
  background: var(--light-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 24px -8px var(--shadow-heavy),
    0 0 0 1px var(--gold-glow);
  border-color: var(--primary);
}

.dark .card {
  background: var(--dark-card);
  border-color: rgba(255, 255, 255, 0.06);
}

.dark .card:hover {
  box-shadow:
    0 12px 32px -8px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--gold-glow);
  border-color: var(--primary);
}

/* Card image zoom on hover */
.card-img-wrapper {
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-img-wrapper img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ----------------------------------------------------------
   6. Category Pill Active State
   ---------------------------------------------------------- */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--light-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-pill.active,
.category-pill[aria-selected="true"] {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(212, 160, 83, 0.35);
}

.dark .category-pill {
  background: var(--dark-surface);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.dark .category-pill:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.dark .category-pill.active,
.dark .category-pill[aria-selected="true"] {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

/* ----------------------------------------------------------
   7. Image Upload Area
   ---------------------------------------------------------- */
.upload-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(212, 160, 83, 0.06);
}

.upload-area.dragover {
  border-style: solid;
}

.dark .upload-area {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.dark .upload-area:hover,
.dark .upload-area.dragover {
  border-color: var(--primary);
  background: rgba(212, 160, 83, 0.08);
}

/* ----------------------------------------------------------
   8. Form Focus States
   ---------------------------------------------------------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.dark select,
.dark textarea {
  background: var(--dark-surface);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

/* ----------------------------------------------------------
   9. Badge Styles
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1.4;
}

.badge-mais-pedido {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.badge-promocao {
  background: linear-gradient(135deg, var(--accent), #e74c3c);
  color: #fff;
  animation: pulse-soft 2.5s ease-in-out infinite;
}

.badge-novo {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.badge-vegano {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
}

.badge-vegetariano {
  background: linear-gradient(135deg, #65a30d, #4d7c0f);
  color: #fff;
}

.badge-sem-gluten {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

.badge-sem-lactose {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: #fff;
}

.badge-picante {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

.badge-destaque {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--dark);
}

.badge-indisponivel {
  background: #6b7280;
  color: #fff;
  opacity: 0.8;
}

/* ----------------------------------------------------------
   10. WhatsApp Floating Button
   ---------------------------------------------------------- */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 1.5rem;
  box-shadow:
    0 4px 14px rgba(37, 211, 102, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  animation: float 3s ease-in-out infinite;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow:
    0 6px 20px rgba(37, 211, 102, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.whatsapp-float::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.3);
  animation: pulse-soft 2s ease-in-out infinite;
  z-index: -1;
}

/* ----------------------------------------------------------
   11. Spice Level Indicators
   ---------------------------------------------------------- */
.spice-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.spice-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #d1d5db;
  transition: background var(--transition-fast);
}

/* Level 1 - mild */
.spice-level-1 .spice-dot:nth-child(-n+1) {
  background: #facc15;
}

/* Level 2 - medium */
.spice-level-2 .spice-dot:nth-child(-n+2) {
  background: #f97316;
}

/* Level 3 - hot */
.spice-level-3 .spice-dot:nth-child(-n+3) {
  background: #ef4444;
}

/* Level 4 - very hot */
.spice-level-4 .spice-dot:nth-child(-n+4) {
  background: #dc2626;
}

/* Level 5 - extreme */
.spice-level-5 .spice-dot {
  background: #991b1b;
}

.dark .spice-dot {
  background: #374151;
}

/* ----------------------------------------------------------
   12. Price Strikethrough (Promo)
   ---------------------------------------------------------- */
.price-original {
  position: relative;
  color: var(--text-muted);
  font-size: 0.85em;
}

.price-original::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(-8deg);
}

.price-promo {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15em;
}

.price-savings {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(192, 57, 43, 0.1);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ----------------------------------------------------------
   13. Responsive Adjustments
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  .card:hover {
    transform: translateY(-2px);
  }

  .whatsapp-float {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    bottom: 1rem;
    right: 1rem;
  }

  .category-pill {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .badge {
    font-size: 0.625rem;
    padding: 0.15rem 0.5rem;
  }
}

@media (max-width: 380px) {
  .whatsapp-float {
    bottom: 0.75rem;
    right: 0.75rem;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------------------------
   14. Smooth Transitions (Global)
   ---------------------------------------------------------- */
a,
button,
[role="button"] {
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

img {
  transition: opacity var(--transition-base);
}

/* Smooth page-level scrolling */
html {
  scroll-behavior: smooth;
}

/* ----------------------------------------------------------
   15. Hero / Banner Gradient Overlay
   ---------------------------------------------------------- */
.hero-banner {
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 26, 46, 0.2) 0%,
    rgba(26, 26, 46, 0.6) 60%,
    rgba(26, 26, 46, 0.9) 100%
  );
  pointer-events: none;
}

.hero-banner-content {
  position: relative;
  z-index: 1;
}

.hero-gradient-gold {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
}

/* ----------------------------------------------------------
   16. Glass-morphism Effect
   ---------------------------------------------------------- */
.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-light {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
  background: rgba(26, 26, 46, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----------------------------------------------------------
   17. Custom Toggle Switch
   ---------------------------------------------------------- */
.toggle {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.5rem;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d1d5db;
  transition: background var(--transition-fast);
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.toggle input:checked ~ .toggle-thumb {
  transform: translateX(1.25rem);
}

.toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.dark .toggle-track {
  background: #374151;
}

.dark .toggle input:checked + .toggle-track {
  background: var(--primary);
}

/* ----------------------------------------------------------
   Extras - Utility Helpers
   ---------------------------------------------------------- */

/* Golden text */
.text-gold {
  color: var(--primary);
}

.text-gold-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Golden divider */
.divider-gold {
  height: 2px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* Overlay for modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
}

/* Unavailable item overlay */
.item-unavailable {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
}

.item-unavailable::after {
  content: "Indisponivel";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  padding: 0.4rem 1.25rem;
  background: rgba(107, 114, 128, 0.9);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.25rem;
  pointer-events: none;
}

/* Button primary gold */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--gold-glow);
  filter: brightness(1.08);
}

.btn-gold:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
