/* ============================================
   GLOBAL.CSS - Estilos globales del layout
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* NAVBAR - MUY IMPORTANTE */
nav {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Glass effect para cards y navbar */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.search-bar {
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-btn:hover {
    background: #f3f4f6;
}

.category-btn.active {
    background: #2563eb;
    color: white;
}

.cart-sidebar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge {
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.image-wrapper {
    overflow: hidden;
}

.image-zoom {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-wrapper:hover .image-zoom {
    transform: scale(1.08);
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================
   TOAST NOTIFICATIONS - Diseño moderno
   ============================================ */

.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 280px;
    max-width: 400px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.toast.hide {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: checkPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
}

.toast-icon svg {
    width: 14px;
    height: 14px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    opacity: 0.95;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar 2s linear forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
}

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Variantes de toast */
.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .toast {
        right: 16px;
        left: auto;
        min-width: auto;
        max-width: 320px;
        top: 70px;
    }
}

.divider {
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    height: 1px;
}

@media (max-width: 768px) {
    .hero-container {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        border-radius: 0;
    }
}

/* ============================================
   LOGIN SIDEBAR - Estilo carrito
   ============================================ */

#login-sidebar {
    transition: opacity 0.3s ease;
}

#login-sidebar-content {
    transition: transform 0.3s ease-out;
    background: white;
}

#login-sidebar .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#login-sidebar .overflow-y-auto::-webkit-scrollbar-track {
    background: #f3f4f6;
}

#login-sidebar .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#login-sidebar .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================
   FIX: Input de fecha en móviles
   ============================================ */

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

input[type="date"]:invalid {
    color: #9ca3af;
}

input[type="date"]:valid {
    color: #111827;
}

@media (max-width: 640px) {
    input[type="date"] {
        min-height: 48px;
        font-size: 16px;
    }
}

/* ============================================
   PRODUCT CARDS - Diseño moderno
   ============================================ */

.product-card {
    background: white;
    border-radius: 1rem;
    padding: 0.75rem;
    border: 1px solid #f3f4f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #e5e7eb;
}

/* Animación de carga de imágenes */
.product-card img {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.product-card img[src] {
    animation: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Line clamp para texto */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    text-overflow: ellipsis;
}

/* Hover en botón de agregar */
.product-card button:active {
    transform: scale(0.95);
}

/* Responsive ajustes */
@media (max-width: 640px) {
    .product-card {
        padding: 0.5rem;
    }
}

/* ============================================
   WHATSAPP FLOTANTE
   ============================================ */

/* Animación de pulse */
@keyframes ping {

    75%,
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Tooltip del botón de WhatsApp */
@media (max-width: 640px) {
    a[href^="https://wa.me/"] span.absolute.right-full {
        display: none;
    }
}

/* ============================================
   HERO TEXT - Legible sobre cualquier fondo
   ============================================ */

header h1 {
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
}

header p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

header .text-gray-400 {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Stats también con sombra */
header .text-white {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

@keyframes shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.progress-bar {
    transition: width 3s linear;
}