/* ========================================
   TEMA ITALICA MIDTOWN
   Version: 2026.08.03-perf1
   Base: theme-italica.css (cargar en paralelo via #theme-base-stylesheet — sin @import)
   Variante: Recoleta Alt Bold + botonera Midtown (naranja / verde)
   ======================================== */

@font-face {
    font-family: 'RecoletaAlt';
    src: url('../fonts/RecoletaAlt-Bold.woff2') format('woff2'),
         url('../fonts/RecoletaAlt-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Naranja del mockup Midtown */
    --midtown-orange: #F8AE19;
    /* Verde accesible sobre blanco/naranja claro (≥ AA texto normal) */
    --midtown-green: #4A5C3A;
    /* Verde del mockup (solo acentos / bordes secundarios; no texto pequeño) */
    --midtown-green-soft: #8CA077;
}

/* Títulos de categoría: caja verde al ancho del nombre (sin cortar renglón) */
body.theme-italica-midtown .category-title,
.theme-italica-midtown .category-title {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    font-weight: 700 !important;
    /* Sin tracking: el letter-spacing deja hueco extra a la derecha del último glifo */
    letter-spacing: 0 !important;
    text-transform: capitalize !important;
    display: table !important; /* shrink-to-fit estable + centrado con margin auto */
    width: auto !important;
    max-width: calc(100% - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    /* Recoleta deja más aire óptico arriba: menos padding-top */
    padding: 0 16px 4px !important;
    font-size: 1.89em !important; /* ~40% más que 1.35em */
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

body.theme-italica-midtown .subcategory-title,
.theme-italica-midtown .subcategory-title {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: capitalize !important;
    text-align: center !important;
}

body.theme-italica-midtown .dual-title .caps-part,
.theme-italica-midtown .dual-title .caps-part {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: capitalize !important;
}

body.theme-italica-midtown .flyers-section-title.category-title,
.theme-italica-midtown .flyers-section-title.category-title {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    text-transform: capitalize !important;
}

@media (max-width: 768px) {
    body.theme-italica-midtown .category-title,
    .theme-italica-midtown .category-title {
        /* block + fit-content: respeta max-width y centra con margin auto */
        display: block !important;
        font-size: clamp(1.25em, 6.5vw, 1.75em) !important;
        padding: 2px 12px 5px !important;
        letter-spacing: 0 !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
        hyphens: none !important;
        width: fit-content !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    body.theme-italica-midtown .menu-content .category-title,
    body.theme-italica-midtown .category > .category-title {
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Nombres de producto: nombre → badges/iconos → precio, alineados al centro */
body.theme-italica-midtown .product-name-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important; /* anula styles-base space-between */
    width: fit-content !important;
    max-width: 100% !important;
    column-gap: 6px !important;
    row-gap: 2px !important;
    line-height: 1.15 !important;
    margin-bottom: 0 !important;
}

body.theme-italica-midtown .product-name,
body.theme-italica-midtown a.product-name {
    font-size: 1.05em !important;
    line-height: 1.15 !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.theme-italica-midtown .product-price {
    font-size: 1.05em !important;
    line-height: 1.15 !important;
}

body.theme-italica-midtown .price-container {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    line-height: 1.15 !important;
    transform: none !important;
}

body.theme-italica-midtown .price-container .product-price.old-price {
    font-size: 0.9em !important;
    font-weight: normal !important;
}

body.theme-italica-midtown .product-name-row .inline-icons {
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 1.15em !important;
    line-height: 1 !important;
    overflow: visible !important;
    /* Subir pastillas/iconos al centro óptico de las mayúsculas Nexa */
    transform: translateY(-0.12em) !important;
}

body.theme-italica-midtown .product-name-row .inline-icons > *,
body.theme-italica-midtown .product-name-row .inline-icons .badge-pill,
body.theme-italica-midtown .product-name-row .inline-icons .badge-nuevo,
body.theme-italica-midtown .product-name-row .inline-icons .badge-sin-tacc,
body.theme-italica-midtown .product-name-row .inline-icons .custom-product-badge,
body.theme-italica-midtown .product-name-row .inline-icons .product-icon-emoji {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0.18em 0.55em 0.2em !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    transform: none !important;
}

/* Iconos img/svg: mismo alto que la línea, sin pastilla de padding */
body.theme-italica-midtown .product-name-row .inline-icons img,
body.theme-italica-midtown .product-name-row .inline-icons svg,
body.theme-italica-midtown .product-name-row .inline-icons .product-icon-custom {
    display: block !important;
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    padding: 0 !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

body.theme-italica-midtown .product-name-row .inline-icons i,
body.theme-italica-midtown .product-name-row .inline-icons [class*="fa-"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.95em !important;
    line-height: 1 !important;
    height: 1em !important;
    padding: 0 !important;
}

body.theme-italica-midtown .product-name-row .inline-icons .badge-pill-label,
body.theme-italica-midtown .product-name-row .inline-icons .badge-pill-icon {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
    transform: none !important;
}

body.theme-italica-midtown .promotion-badge,
body.theme-italica-midtown .badge-nuevo,
body.theme-italica-midtown .badge-sin-tacc {
    font-size: 0.85em !important;
}

/* Descripción: apenas un poco más grande */
body.theme-italica-midtown .product-description {
    font-size: 1.08em !important;
    line-height: 1.2 !important;
}

/* ── Títulos de sección: centrados ── */
body.theme-italica-midtown .section-title-divider {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
}

body.theme-italica-midtown .section-title-text {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    font-weight: 700 !important;
    text-transform: capitalize !important;
    text-align: center !important;
    width: 100% !important;
    letter-spacing: 0.02em !important;
}

body.theme-italica-midtown .section-title-description {
    text-align: center !important;
}

body.theme-italica-midtown .section-group-box .section-title-divider {
    justify-content: center !important;
}

/* ── Botones categoría principal (desktop): caja naranja compacta ── */
@media (min-width: 769px) {
    body.theme-italica-midtown .category-button {
        font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
        font-weight: 700 !important;
        text-transform: capitalize !important;
        letter-spacing: 0.01em !important;
        background: var(--midtown-orange) !important;
        background-image: none !important;
        border: 2px solid var(--midtown-orange) !important;
        border-radius: 8px !important;
        color: #fff !important;
        box-shadow: none !important;
        padding: 8px 16px !important;
        min-height: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        gap: 4px !important;
        flex: 0 1 auto;
    }

    body.theme-italica-midtown .category-button .btn-label {
        font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
        font-weight: 700 !important;
        text-transform: capitalize !important;
        font-size: 0.95em !important;
        line-height: 1.15 !important;
        color: inherit !important;
    }

    body.theme-italica-midtown .category-button .btn-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 1.1em !important;
    }

    body.theme-italica-midtown .category-button .btn-icon img {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
    }

    body.theme-italica-midtown .category-button:hover,
    body.theme-italica-midtown .category-button.active {
        background: var(--midtown-orange) !important;
        background-image: none !important;
        border-color: var(--midtown-green) !important;
        color: #fff !important;
        filter: none !important;
        box-shadow: 0 2px 8px rgba(74, 92, 58, 0.22) !important;
        transform: translateY(-1px);
    }

    body.theme-italica-midtown .category-button.active .btn-icon img,
    body.theme-italica-midtown .category-button:hover .btn-icon img {
        filter: none !important;
    }
}

/* ── Botones categoría (móvil): estilo Italica original (Nexa + caja crema) ── */
@media (max-width: 768px) {
    body.theme-italica-midtown .category-button {
        font-family: 'Nexa', Arial, sans-serif !important;
        font-weight: bold !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        background-image: none !important;
        background-color: #fffcf4 !important;
        border: 2px solid var(--accent-color) !important;
        border-radius: 12px !important;
        color: var(--titulos-color) !important;
        box-shadow: none !important;
        padding: 14px 10px !important;
        min-height: 90px !important;
        gap: 6px !important;
        transform: none !important;
    }

    body.theme-italica-midtown .category-button .btn-label {
        font-family: 'Nexa', Arial, sans-serif !important;
        font-weight: bold !important;
        text-transform: none !important;
        font-size: 0.85em !important;
        line-height: 1.2 !important;
        color: inherit !important;
    }

    body.theme-italica-midtown .category-button .btn-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.8em !important;
    }

    body.theme-italica-midtown .category-button .btn-icon img {
        width: 38px !important;
        height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
        filter: none !important;
    }

    body.theme-italica-midtown .category-button.active,
    body.theme-italica-midtown .category-button:hover {
        background-image: none !important;
        background-color: var(--accent-color) !important;
        color: #fff !important;
        border-color: var(--accent-color) !important;
        box-shadow: 0 2px 8px rgba(237, 122, 0, 0.3) !important;
        filter: none !important;
        transform: none !important;
    }

    body.theme-italica-midtown .category-button.active .btn-icon img,
    body.theme-italica-midtown .category-button:hover .btn-icon img {
        filter: brightness(0) invert(1) !important;
    }
}

/* ── Subcategorías: pastilla + tipografía ~80% más grande ── */
body.theme-italica-midtown .subcategories-buttons {
    align-items: center;
    gap: 14px;
    padding: 0 16px;
}

body.theme-italica-midtown .subcategory-button {
    font-family: 'RecoletaAlt', 'Nexa', Georgia, serif !important;
    font-weight: 700 !important;
    text-transform: capitalize !important;
    letter-spacing: 0.01em !important;
    background: #fff !important;
    border: 2px solid var(--midtown-orange) !important;
    border-radius: 999px !important;
    color: var(--midtown-green) !important;
    padding: 12px 28px !important;
    font-size: 1.89em !important; /* ~80% más que 1.05em */
    width: auto !important;
    max-width: 100%;
    min-height: 0 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

body.theme-italica-midtown .subcategory-button:hover,
body.theme-italica-midtown .subcategory-button.active {
    background: var(--midtown-orange) !important;
    border-color: var(--midtown-orange) !important;
    color: var(--midtown-green) !important;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    body.theme-italica-midtown .subcategory-button {
        font-size: 1.6em !important;
        padding: 10px 22px !important;
    }
}

/* Carrito: mismos tonos que Italica base (el selector body.theme-italica no aplica acá) */
body.theme-italica-midtown .cart-add-btn {
    background: var(--verde) !important;
    color: #fff !important;
    border: 1px solid var(--verde);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}

body.theme-italica-midtown .cart-add-btn:hover {
    filter: none;
    background: var(--accent-color) !important;
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Chef special: fondo levemente tintado (accesible sobre crema) */
body.theme-italica-midtown .product-card.chef-special-card {
    background: rgba(74, 92, 58, 0.10) !important;
}

/* Resaltar producto: verde Midtown (mejor contraste que naranja en crema) */
body.theme-italica-midtown .product-card.product-highlight-card {
    --product-highlight-color: var(--midtown-green);
}
