/* Custom styles for Mercados Campesinos Dosquebradas */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --primary: #15803d;
  --primary-dark: #166534;
  --primary-light: #dcfce7;
  --accent: #eab308;
  --accent-hover: #ca8a04;
  --surface: #ffffff;
  --bg-soft: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  background-color: #f7faf7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--safe-bottom);
}

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

/* Glassmorphism navbar */
.glass-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(22, 101, 52, 0.08);
}

/* Responsive horizontal category scroller on mobile */
.category-scroll {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
.category-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Product Card touch & hover animations */
.product-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -10px rgba(22, 101, 52, 0.12);
  }
}
.product-card:active {
  transform: scale(0.99);
}

/* Floating cart button animations */
@keyframes cart-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.cart-updated {
  animation: cart-bounce 0.35s ease-in-out;
}

/* Safe areas for mobile notches and gesture bars */
.safe-pb {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* Mobile Bottom Sheet Modal Transitions */
@media (max-width: 640px) {
  .modal-sheet-enter {
    animation: slideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
      opacity: 0.8;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@media (min-width: 641px) {
  .modal-sheet-enter {
    animation: modalInDesktop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes modalInDesktop {
    from {
      opacity: 0;
      transform: scale(0.96) translateY(12px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Floating WhatsApp Button Animation */
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.btn-wa-float {
  animation: wa-pulse 2s infinite;
}

/* Prevent iOS input auto-zoom by enforcing 16px font-size */
input, select, textarea {
  font-size: 16px !important;
}
@media (min-width: 640px) {
  input, select, textarea {
    font-size: 14px !important;
  }
}

/* ===================================================
   Estilos de Impresión / PDF para Documento de Remisión
   =================================================== */
@media print {
  /* Ocultar todo el sitio web excepto el modal de remisión */
  body * {
    visibility: hidden;
  }
  
  #modalRemision,
  #modalRemision * {
    visibility: visible;
  }

  #modalRemision {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  /* Ocultar botones de navegación al imprimir */
  .no-print,
  #modalRemision .no-print {
    display: none !important;
  }

  #contenedorRemisionImprimible {
    box-shadow: none !important;
    border: 1px solid #1f2937 !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 24px !important;
    background: white !important;
  }

  /* Asegurar que las tablas salgan con bordes claros y texto nítido */
  table, th, td {
    border-color: #cbd5e1 !important;
    color: #111827 !important;
  }
}
