/* Estilos Personalizados - Catálogo Interactivo de Productos */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #10b981;
    --danger: #ef4444;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

code, .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

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

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Efectos de vidrio (Glassmorphism) */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Transiciones de Carrito y Modales optimizados para móvil */
#cart-drawer-overlay {
    z-index: 60 !important;
}

#cart-drawer {
    z-index: 70 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
}

#cart-drawer.open {
    transform: translateX(0) !important;
}

#cart-drawer:not(.open) {
    transform: translateX(100%) !important;
}

#checkout-modal,
#order-success-modal,
#product-modal,
#image-viewer-modal,
#admin-login-modal {
    z-index: 80 !important;
}

/* Sombras Suaves */
.shadow-2xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.shadow-card {
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
}

/* Quitar flechas por defecto en inputs de cantidad numérica para que sean limpios y fáciles de editar */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Ocultar barra de scroll en barra horizontal de rubros */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Efectos visuales de botones de rubros */
.category-pill {
    white-space: nowrap;
    user-select: none;
}

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

/* Estilos de Impresión */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white !important;
    }
}

/* Experiencia de compra móvil */
html, body { max-width: 100%; overflow-x: clip; }
#store-header > div, #store-header > div > div, #view-client, #catalog-navigation > div { min-width: 0; }
#header-cart { min-height: 44px; }
.purchase-info { padding: 12px 16px; background: #eff6ff; border-bottom: 1px solid #dbeafe; font-size: 13px; }
.purchase-info details { max-width: 1216px; margin: auto; }
.purchase-info summary { cursor: pointer; font-weight: 700; min-height: 24px; }
#purchase-info-content { padding-top: 10px; line-height: 1.8; }
#purchase-info-content a { display: inline-block; color: #1d4ed8; text-decoration: underline; padding: 8px 0; }
.catalog-toolbar { width: 100%; max-width: 1280px; margin: auto; padding: 16px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#catalog-result-count { color: #64748b; font-size: 12px; }
#client-category-pills { min-width: 0; max-width: 100%; }
.category-pill { min-height: 44px; }
.product-unit { max-width: 50%; text-align: right; overflow-wrap: anywhere; padding-left: 8px; }
.product-actions { min-width: 0; flex-wrap: wrap; }
.product-actions button { min-height: 44px; }
.product-actions input { min-height: 44px; font-size: 16px; }
#view-client > footer { padding-bottom: 96px; }
#mobile-bottom-cart-bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
#cart-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
#cart-items-container button { min-width: 44px; min-height: 44px; }
#cart-items-container input { min-height: 44px; font-size: 16px; }
#cart-items-container .truncate { white-space: normal; }
.checkout-guidance { margin: 12px 20px; font-size: 12px; color: #475569; line-height: 1.6; }
@media (max-width: 639px) {
    #store-header > div { height: 60px; padding: 0 12px; gap: 8px; }
    #store-header h1 { font-size: 15px; }
    #store-header .brand-descriptor, #header-admin, #header-share { display: none; }
    #store-header > div > div:first-child { gap: 8px; }
    #catalog-hero { padding: 20px 16px; }
    #catalog-hero h2 { font-size: 23px; }
    #catalog-navigation { top: 60px; }
    #client-search-input, #client-category-select { min-height: 44px; font-size: 16px; }
    #client-search-input { padding-right: 12px; }
    #catalog-navigation > div { padding-left: 12px; padding-right: 12px; }
    #view-client > div:has(> #client-product-grid) { padding: 16px 12px; }
    #cart-drawer { max-width: 100vw; }
    #view-client footer > div > div:first-child { flex-wrap: wrap; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

.inline-offer { color: #be123c; font-size: 10px; font-weight: 800; }
.product-actions button:not([id^="btn-add-"]) { min-width: 44px; }
#checkout-modal input, #checkout-modal textarea { font-size: 16px; }

.hero-purchase-benefits { margin-top: 12px; color: #a7f3d0; font-size: 12px; font-weight: 600; line-height: 1.6; }
#cart-items-container .flex.items-center.gap-2.mt-2 { flex-wrap: wrap; }
#cart-items-container .flex.items-center.gap-2.mt-2 > span { white-space: nowrap; }

/* Dos productos por fila en celular, con fotos medianas. */
#client-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-card, #client-product-grid .product-content { min-width: 0; }
@media (max-width: 639px) {
    #client-product-grid { gap: 12px; align-items: stretch; }
    #client-product-grid .product-photo { height: 145px; padding: 12px; }
    #client-product-grid .product-photo .product-badges, #client-product-grid .product-photo > span { display: none; }
    #client-product-grid .product-content { padding: 10px; }
    #client-product-grid .product-content h3 { font-size: 13px; line-height: 1.45; min-height: 38px; overflow-wrap: anywhere; }
    #client-product-grid .product-content > div:first-child > p { font-size: 11px; line-height: 1.45; min-height: 32px; margin-bottom: 8px; }
    #client-product-grid .product-price { display: block; padding: 9px 7px; margin-bottom: 10px; }
    #client-product-grid .product-price > div > span { font-size: 9px; letter-spacing: 0; }
    #client-product-grid .product-price > div > div { font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
    #client-product-grid .product-unit { display: block; max-width: 100%; text-align: left; padding-left: 0; margin-top: 5px; font-size: 10px; }
    #client-product-grid .product-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
    #client-product-grid .product-actions > div { display: flex; width: 100%; padding: 0; }
    #client-product-grid .product-actions button:not([id^="btn-add-"]) { width: 44px; min-width: 44px; flex-shrink: 0; }
    #client-product-grid .product-actions input { min-width: 0; width: 0; flex: 1; padding: 0; }
    #client-product-grid .product-actions > button { flex: none; width: 100%; min-height: 44px; padding: 10px 6px; font-size: 12px; }
    #client-product-grid .product-actions > button svg { width: 14px; height: 14px; }
    .catalog-toolbar { padding-top: 12px; }
}
@media (min-width: 1024px) { #client-product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1280px) { #client-product-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }


#hero-order-deadline { margin: 16px auto 0; padding: 13px 16px; max-width: 560px; background: #fef3c7; color: #78350f; border: 2px solid #fbbf24; border-radius: 12px; box-shadow: 0 4px 16px #0002; }
#hero-order-deadline strong { display: block; font-size: 19px; line-height: 1.35; font-weight: 800; }
#hero-order-deadline span { display: block; margin-top: 5px; font-size: 13px; line-height: 1.5; font-weight: 600; }
#hero-order-deadline[hidden] { display: none; }

#catalog-hero { padding: 0 0 18px; background: #111c35; color: white; text-align: center; overflow: hidden; }
#catalog-hero .hero-slide { min-height: 240px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#catalog-hero .hero-slide[hidden] { display: none; }
.hero-slide-brand { background: radial-gradient(ellipse at 15% 10%, #4f46e5aa, transparent 65%), linear-gradient(120deg, #111827, #172554); }
.hero-slide-hours { background: radial-gradient(ellipse at 90% 20%, #fcd34d88, transparent 60%), linear-gradient(120deg, #fef3c7, #fffbeb); color: #78350f; }
#catalog-hero h2 { font-size: 30px; font-weight: 850; line-height: 1.2; margin-top: 14px; }
#catalog-hero #catalog-tagline { font-size: 21px; font-weight: 700; line-height: 1.35; margin-top: 10px; max-width: 460px; }
.hero-eyebrow { font-size: 11px; font-weight: 700; border: 1px solid currentColor; border-radius: 999px; padding: 5px 12px; opacity: .85; }
.hero-description { max-width: 420px; font-size: 13px; line-height: 1.5; margin-top: 12px; color: #cbd5e1; }
#catalog-hero #hero-order-deadline { margin: 14px 0 0; padding: 0; background: transparent; border: 0; box-shadow: none; max-width: 480px; }
#catalog-hero #hero-order-deadline strong { font-size: 30px; line-height: 1.2; }
#catalog-hero #hero-order-deadline span { font-size: 15px; margin-top: 15px; }
.hero-carousel-controls { display: flex; justify-content: center; align-items: center; gap: 4px; }
.hero-carousel-controls button[data-hero-dot] { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.hero-carousel-controls button[data-hero-dot]::after { content: ''; width: 9px; height: 9px; background: #64748b; border-radius: 20px; }
.hero-carousel-controls button[aria-pressed="true"]::after { width: 24px; background: #fbbf24; }
#hero-carousel-pause { font-size: 11px; color: #cbd5e1; min-height: 40px; padding: 0 10px; }
#catalog-hero .hero-purchase-benefits { margin: 0 12px 10px; }
#catalog-hero .hero-contact { display: inline-block; background: #10b98125; border: 1px solid #10b98150; padding: 9px 16px; border-radius: 12px; font-size: 12px; font-weight: 700; color: #6ee7b7; }
@media (max-width: 639px) { #catalog-hero { padding: 0 0 16px; } #catalog-hero h2 { font-size: 25px; } #catalog-hero .hero-slide { min-height: 240px; } }

#catalog-hero .hero-slide { min-height: 260px; }
