/* ==========================================
   Don Poncho - Diseño Acordeón
   Divertido, Organizado, Fácil de usar
   ========================================== */

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8559;

    --bg: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-accent: #FFF4F0;

    --text: #1A1A1A;
    --text-soft: #666666;
    --text-muted: #999999;

    --border: #EEEEEE;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 100px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-bottom: 100px;
    -webkit-tap-highlight-color: transparent;
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-badge {
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.logo-badge.closed {
    background: #FFEBEE;
    color: #C62828;
}

.cart-btn {
    position: relative;
    background: var(--bg);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.cart-btn:hover {
    background: var(--bg-accent);
}

.cart-btn svg {
    color: var(--text);
}

.cart-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count:empty,
.cart-count[data-count="0"] {
    display: none;
}

/* === HERO === */
.hero {
    padding: 24px 20px 16px;
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--bg) 100%);
    position: relative;
    overflow: visible;
    min-height: 140px;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 60%;
}

.hero-greeting {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-sub {
    color: var(--text-soft);
    font-size: 0.95rem;
}

/* === MASCOTA DON PONCHO === */
.mascota {
    position: absolute;
    right: -10px;
    bottom: -60px;
    z-index: 10;
    cursor: pointer;
    transform-origin: bottom right;
}

/* Animación de entrada: se asoma desde abajo */
.mascota {
    animation: mascotaAsomar 1.2s ease-out forwards;
}

@keyframes mascotaAsomar {
    0% {
        transform: translateY(100%) rotate(10deg);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px) rotate(-3deg);
        opacity: 1;
    }
    80% {
        transform: translateY(5px) rotate(2deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

.mascota:hover .mascota-img {
    transform: scale(1.05) rotate(-2deg);
}

.mascota:active .mascota-img {
    transform: scale(0.95);
}

/* Imagen normal */
.mascota-img {
    height: 180px;
    width: auto;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

/* Contenedor del sprite (para correr) */
.mascota-runner {
    display: none;
}

/* === ANIMACIÓN PEEK-A-BOO FRAME-BY-FRAME === */
/* Sprite sheet: 6 frames, 119px ancho x 180px altura cada uno */

/* Contenedor del sprite de peek */
.mascota-peek-sprite {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 119px;
    height: 180px;
    background-image: url('/img/mascota/peek/spritesheet-hero.png');
    background-repeat: no-repeat;
    background-position: 0 0;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
    display: none;
    transform-origin: bottom center;
}

/* Cuando está activo el peek, ocultar imagen normal y mostrar sprite */
.mascota.peek-active .mascota-img {
    opacity: 0;
    transition: opacity 0.1s ease;
}

.mascota.peek-active .mascota-peek-sprite {
    display: block;
    animation: peekFrames 1.8s steps(1) forwards;
}

/* Animación frame-by-frame del sprite - suave y consistente */
@keyframes peekFrames {
    0% { background-position: 0 0; }           /* frame 1: 20% visible */
    20% { background-position: -119px 0; }     /* frame 2: 40% visible */
    40% { background-position: -238px 0; }     /* frame 3: 60% visible */
    60% { background-position: -357px 0; }     /* frame 4: 80% visible */
    80% { background-position: -476px 0; }     /* frame 5: 95% visible */
    100% { background-position: -595px 0; }    /* frame 6: 100% visible */
}

/* Animación de salida (esconderse) - en reversa */
.mascota.peek-hide .mascota-img {
    opacity: 0;
}

.mascota.peek-hide .mascota-peek-sprite {
    display: block;
    animation: peekHideFrames 1.2s steps(1) forwards;
}

@keyframes peekHideFrames {
    0% { background-position: -595px 0; }      /* frame 6: completo */
    20% { background-position: -476px 0; }     /* frame 5 */
    40% { background-position: -357px 0; }     /* frame 4 */
    60% { background-position: -238px 0; }     /* frame 3 */
    80% { background-position: -119px 0; }     /* frame 2 */
    100% { background-position: 0 0; opacity: 0; } /* frame 1: se oculta */
}

/* Animación de "mirar nervioso" - solo rotación suave */
.mascota.peek-nervous .mascota-peek-sprite {
    background-position: -595px 0 !important;
    animation: peekNervous 0.6s ease-in-out infinite !important;
}

@keyframes peekNervous {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

/* Speech bubble durante peek */
.mascota.peek-active .mascota-speech {
    animation: speechPeek 2.4s ease-out forwards;
}

@keyframes speechPeek {
    0%, 50% { opacity: 0; transform: scale(0); }
    70% { opacity: 1; transform: scale(1.1); }
    85%, 100% { opacity: 1; transform: scale(1); }
}

/* Fallback para cuando no se usa el sprite (animación CSS simple) */
.mascota.peek .mascota-img {
    animation: mascotaPeekSimple 3s ease-in-out;
}

@keyframes mascotaPeekSimple {
    0% { transform: translateY(0) rotate(0deg); }
    15% { transform: translateY(100%) rotate(5deg); }
    25% { transform: translateY(100%) rotate(5deg); }
    45% { transform: translateY(50%) rotate(-5deg); }
    60% { transform: translateY(20%) rotate(-3deg); }
    75% { transform: translateY(-5%) rotate(2deg); }
    90% { transform: translateY(3%) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* === ANIMACIÓN SALUDO (wave) === */
.mascota.wave .mascota-img {
    animation: mascotaWave 1.5s ease-in-out;
}

@keyframes mascotaWave {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-12deg); }
    30% { transform: rotate(8deg); }
    45% { transform: rotate(-10deg); }
    60% { transform: rotate(6deg); }
    75% { transform: rotate(-4deg); }
}

/* === ANIMACIÓN SUSTO (shake + esconder) === */
.mascota.susto {
    animation: mascotaSusto 2.5s ease-in-out forwards;
}

@keyframes mascotaSusto {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    /* Temblor de susto */
    5% { transform: translateX(-5px) rotate(-2deg); }
    10% { transform: translateX(5px) rotate(2deg); }
    15% { transform: translateX(-5px) rotate(-2deg); }
    20% { transform: translateX(5px) rotate(2deg); }
    /* Se esconde rápido */
    25% {
        transform: translateY(0) rotate(-5deg);
    }
    40% {
        transform: translateY(150%) rotate(15deg);
    }
    /* Pausa escondido */
    60% {
        transform: translateY(150%) rotate(15deg);
    }
    /* Se asoma despacito */
    75% {
        transform: translateY(80%) rotate(-5deg);
    }
    85% {
        transform: translateY(30%) rotate(-3deg);
    }
    95% {
        transform: translateY(-5%) rotate(2deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.mascota.susto .mascota-speech {
    display: none;
}

.mascota-speech {
    position: absolute;
    top: 5px;
    left: auto;
    right: 100%;
    margin-right: 10px;
    background: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    animation: speechBounce 0.5s ease 0.8s backwards;
    z-index: 11;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mascota-speech::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

@keyframes speechBounce {
    from {
        transform: scale(0) translateX(20px);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) translateX(0);
    }
    to {
        transform: scale(1) translateX(0);
        opacity: 1;
    }
}

/* Mascota en carrito vacío */
.empty-mascota {
    height: 120px;
    width: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    animation: mascotaSad 2s ease-in-out infinite;
}

@keyframes mascotaSad {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-2deg); }
    75% { transform: translateY(-5px) rotate(2deg); }
}

/* Toast con mascota */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-weight: 500;
    opacity: 0;
    transition: var(--transition);
    z-index: 300;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-mascota {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === SEARCH === */
.search-bar {
    margin: 0 20px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* === SECTION TITLE === */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === FEATURED === */
.featured {
    margin-bottom: 24px;
}

.featured-scroll {
    display: flex;
    gap: 14px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

.featured-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.featured-card:active {
    transform: scale(0.97);
}

.featured-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.featured-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

/* === MENU ESTILO DELIVERY APP === */
.menu-section-main {
    padding-bottom: 40px;
}

/* Chips de categorías (scrolleable) */
.category-chips {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.cat-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.cat-chip-icon {
    font-size: 1.1rem;
}

.cat-chip-name {
    font-weight: 600;
}

/* Contenedor del menú */
.accordion-container {
    padding: 0 16px;
}

/* === GRID DE CATEGORÍAS === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Tarjeta de categoría (tile) */
.category-tile {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-tile:active {
    transform: scale(0.97);
}

.category-tile-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.category-tile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.category-tile-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.category-tile-count {
    display: inline-block;
    background: var(--bg-accent);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* === VISTA DE PRODUCTOS (después de seleccionar categoría) === */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    opacity: 0.8;
}

.back-btn svg {
    color: var(--primary);
}

.category-header-active {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.category-header-icon {
    font-size: 2.2rem;
    width: 56px;
    height: 56px;
    background: var(--bg-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header-active h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.category-header-active span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* Card de producto estilo delivery */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card:active {
    transform: scale(0.98);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    z-index: 2;
}

.product-img {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, var(--bg-accent) 0%, #FFF0EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-emoji {
    font-size: 3rem;
    line-height: 1;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    min-height: 2.4em;
}

.product-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.product-add {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.product-add:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.product-add:active {
    transform: scale(0.95);
}

/* Empty state */
.empty-menu {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-menu-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}


/* === PRODUCT CARD (legacy, para búsqueda grid) === */
.product-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    background: var(--bg-accent);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.product-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

/* === FLOATING CART === */
.floating-cart {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    transform: translateY(120%);
    transition: var(--transition);
    z-index: 90;
}

.floating-cart.show {
    transform: translateY(0);
}

.floating-cart-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.floating-cart-count {
    font-size: 0.85rem;
    opacity: 0.8;
}

.floating-cart-total {
    font-size: 1.2rem;
    font-weight: 700;
}

.floating-cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.floating-cart-btn:hover {
    background: var(--primary-dark);
}

/* === MODALS === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--border);
}

.close-floating {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* === CART MODAL === */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    gap: 14px;
}

.cart-item-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.cart-item-notes {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
}

.cart-item-qty {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #E53935;
    padding: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3.5rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.empty-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-total {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-whatsapp {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: #1FAF5A;
}

/* === PRODUCT MODAL === */
.modal-product .modal-body {
    padding-top: 0;
}

.product-header {
    background: linear-gradient(135deg, var(--bg-accent), var(--bg));
    padding: 50px 20px 30px;
    text-align: center;
}

.product-icon {
    font-size: 5rem;
}

.product-category {
    display: inline-block;
    background: var(--bg);
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-desc {
    color: var(--text-soft);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
}

.qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.qty-row span {
    font-weight: 500;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-btn:active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.qty-value {
    font-size: 1.3rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.notes-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.notes-section textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    height: 80px;
    transition: var(--transition);
}

.notes-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-add {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--primary-dark);
}

.btn-add-price {
    font-size: 1.1rem;
    font-weight: 700;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    opacity: 0;
    transition: var(--transition);
    z-index: 300;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === INSTALL PROMPT === */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 150;
}

.install-prompt.show {
    display: flex;
}

.install-prompt p {
    font-weight: 500;
    font-size: 0.9rem;
}

.install-buttons {
    display: flex;
    gap: 10px;
}

.btn-install {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
}

/* === SEARCH RESULTS === */
.search-results {
    padding: 0 20px;
    margin-bottom: 20px;
}

.search-results-title {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 12px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* === RESPONSIVE === */

/* Móviles muy pequeños (iPhone SE, Galaxy S8 mini) */
@media (max-width: 359px) {
    .header {
        padding: 10px 12px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-badge {
        font-size: 0.55rem;
        padding: 2px 6px;
    }

    .cart-btn {
        width: 40px;
        height: 40px;
    }

    .hero {
        padding: 14px 12px 10px;
        min-height: 110px;
    }

    .hero-text {
        max-width: 52%;
    }

    .hero-greeting {
        font-size: 1.2rem;
    }

    .hero-sub {
        font-size: 0.8rem;
    }

    .mascota {
        right: 2px;
        bottom: -12px;
    }

    .mascota-img {
        height: 110px;
    }

    .mascota-speech {
        font-size: 0.7rem;
        padding: 6px 10px;
        top: -5px;
    }

    .search-bar {
        margin: 0 12px 14px;
        padding: 10px 12px;
    }

    .search-bar input {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 0.95rem;
        padding: 0 12px;
        margin-bottom: 12px;
    }

    .featured-scroll {
        padding: 0 12px;
        gap: 8px;
    }

    .featured-card {
        flex: 0 0 105px;
        padding: 10px;
    }

    .featured-icon {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .featured-name {
        font-size: 0.7rem;
    }

    .featured-price {
        font-size: 0.85rem;
    }

    .accordion-container {
        padding: 0 12px;
    }

    /* Grid de categorías para móviles muy pequeños */
    .accordion-container {
        padding: 0 12px;
    }

    .categories-grid {
        gap: 10px;
    }

    .category-tile {
        padding: 16px 12px;
    }

    .category-tile-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .category-tile-name {
        font-size: 0.85rem;
    }

    .category-tile-sub {
        font-size: 0.68rem;
        margin-bottom: 6px;
    }

    .category-tile-count {
        font-size: 0.62rem;
        padding: 3px 8px;
    }

    .back-btn {
        font-size: 0.85rem;
        margin-bottom: 14px;
    }

    .category-header-active {
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .category-header-icon {
        font-size: 1.8rem;
        width: 48px;
        height: 48px;
    }

    .category-header-active h3 {
        font-size: 1.05rem;
    }

    .category-header-active span {
        font-size: 0.8rem;
    }

    .products-grid {
        gap: 10px;
    }

    .product-img {
        height: 80px;
    }

    .product-emoji {
        font-size: 2.4rem;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-desc {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .product-price {
        font-size: 0.95rem;
    }

    .product-add {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .product-badge {
        font-size: 0.5rem;
        padding: 3px 6px;
        top: 8px;
        left: 8px;
    }

    .floating-cart {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 12px 14px;
    }

    .floating-cart-count {
        font-size: 0.75rem;
    }

    .floating-cart-total {
        font-size: 1rem;
    }

    .floating-cart-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .toast {
        bottom: 85px;
        padding: 10px 16px;
        font-size: 0.85rem;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(80px);
        white-space: normal;
        text-align: center;
    }

    .toast.show {
        transform: translateX(0) translateY(0);
    }

    .modal-header {
        padding: 14px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        padding: 14px;
    }

    .product-header {
        padding: 35px 14px 20px;
    }

    .product-icon {
        font-size: 3.5rem;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-desc {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }

    .qty-row {
        padding: 12px;
    }

    .qty-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .qty-value {
        font-size: 1.1rem;
    }

    .btn-add {
        padding: 14px;
        font-size: 0.9rem;
    }

    .empty-mascota {
        height: 90px;
    }

    .cart-item {
        padding: 12px;
        gap: 10px;
    }

    .cart-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .cart-item-name {
        font-size: 0.85rem;
    }

    .cart-total {
        font-size: 1.2rem;
    }

    .btn-whatsapp {
        padding: 14px;
        font-size: 0.9rem;
    }
}

/* Móviles pequeños (iPhone SE, 360-374px) */
@media (max-width: 374px) and (min-width: 360px) {
    .header {
        padding: 12px 14px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero {
        padding: 16px 14px 12px;
        min-height: 115px;
    }

    .hero-text {
        max-width: 54%;
    }

    .hero-greeting {
        font-size: 1.25rem;
    }

    .mascota-img {
        height: 125px;
    }

    .mascota-speech {
        font-size: 0.72rem;
        padding: 7px 11px;
    }

    .featured-card {
        flex: 0 0 115px;
    }
}

/* Móviles estándar (375-480px) */
@media (max-width: 480px) and (min-width: 375px) {
    .hero-text {
        max-width: 58%;
    }

    .mascota-img {
        height: 150px;
    }

    .mascota-speech {
        font-size: 0.8rem;
    }

    .featured-card {
        flex: 0 0 130px;
    }
}

/* Safe area para iPhones con notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .floating-cart {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .install-prompt {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }

    @media (max-width: 374px) {
        .floating-cart {
            bottom: calc(12px + env(safe-area-inset-bottom));
        }

        .toast {
            bottom: calc(85px + env(safe-area-inset-bottom));
        }
    }
}

/* Tablets pequeñas */
@media (min-width: 600px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .category-tile {
        padding: 24px 20px;
    }

    .category-tile-icon {
        font-size: 3rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-img {
        height: 120px;
    }

    .product-emoji {
        font-size: 3.5rem;
    }

    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .mascota-img {
        height: 200px;
    }

    .mascota {
        right: 20px;
    }

    .hero-text {
        max-width: 50%;
    }

    .hero-greeting {
        font-size: 1.8rem;
    }

    .featured-card {
        flex: 0 0 160px;
    }
}

/* Tablets y desktop */
@media (min-width: 768px) {
    .modal-content {
        border-radius: var(--radius);
        margin: auto;
        max-height: 85vh;
    }

    .modal {
        align-items: center;
        padding: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .product-img {
        height: 130px;
    }

    .product-emoji {
        font-size: 4rem;
    }

    .product-info {
        padding: 14px;
    }

    .product-name {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1.15rem;
    }

    .floating-cart {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(120%);
        width: 400px;
    }

    .floating-cart.show {
        transform: translateX(-50%) translateY(0);
    }

    .mascota-img {
        height: 220px;
    }

    .hero {
        min-height: 160px;
    }

    .hero-text {
        max-width: 50%;
    }

    .hero-greeting {
        font-size: 2rem;
    }
}

/* Touch devices - mejoras de usabilidad */
@media (hover: none) and (pointer: coarse) {
    .product-card:active {
        background: var(--bg-accent);
        transform: scale(0.97);
    }

    .featured-card:active {
        transform: scale(0.97);
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .product-add:active {
        transform: scale(0.9);
    }

    /* Touch targets mínimos de 44px */
    .qty-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .cart-item-remove {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape en móvil */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 90px;
        padding: 10px 20px;
    }

    .hero-greeting {
        font-size: 1.3rem;
    }

    .mascota-img {
        height: 100px;
    }

    .mascota {
        bottom: -10px;
    }

    .mascota-speech {
        display: none;
    }

    .modal-content {
        max-height: 95vh;
    }

    .product-header {
        padding: 20px;
    }

    .product-icon {
        font-size: 3rem;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-price {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .floating-cart {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* === WHATSAPP FLOATING BUTTON === */
.whatsapp-float {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 80;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float:active {
    transform: scale(0.95);
}

.whatsapp-tooltip {
    position: absolute;
    right: 65px;
    background: var(--text);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--text);
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Ajustar posición cuando hay carrito flotante */
.whatsapp-float.cart-visible {
    bottom: 180px;
}

/* Responsive WhatsApp button */
@media (max-width: 480px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 90px;
        right: 16px;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }

    .whatsapp-tooltip {
        display: none;
    }

    .whatsapp-float.cart-visible {
        bottom: 160px;
    }
}

@media (max-width: 359px) {
    .whatsapp-float {
        width: 46px;
        height: 46px;
        bottom: 80px;
        right: 12px;
    }

    .whatsapp-float svg {
        width: 22px;
        height: 22px;
    }

    .whatsapp-float.cart-visible {
        bottom: 140px;
    }
}

/* Safe area para el botón de WhatsApp */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .whatsapp-float {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .whatsapp-float.cart-visible {
        bottom: calc(180px + env(safe-area-inset-bottom));
    }

    @media (max-width: 480px) {
        .whatsapp-float {
            bottom: calc(90px + env(safe-area-inset-bottom));
        }

        .whatsapp-float.cart-visible {
            bottom: calc(160px + env(safe-area-inset-bottom));
        }
    }
}
