/**
 * Encabezado del catalogo (/cat/).
 * Todo va prefijado con body.pagina-catalogo para no afectar al resto del sitio,
 * que comparte encabezado.css y formulario.css.
 */

body.pagina-catalogo .cabecera {
    padding: 8px 10px;
    background-color: #14100f;
    background-image:
        radial-gradient(85% 150% at 42% 38%, rgba(150, 116, 84, 0.55) 0%, rgba(62, 48, 37, 0.35) 45%, rgba(0, 0, 0, 0) 78%),
        linear-gradient(180deg, #262020 0%, #14100f 100%);
    color: #f8fafc;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

body.pagina-catalogo .cabecera a {
    color: #f8fafc;
}

body.pagina-catalogo .div-cabecera {
    width: 96%;
    max-width: 1280px;
    gap: 0.5rem 1rem;
    align-items: center;
}

body.pagina-catalogo .imgcablogo {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    object-fit: contain;
}

/* ---------- Buscador ---------- */

body.pagina-catalogo .divformulario {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: center;
}

body.pagina-catalogo .hformulario {
    width: 100%;
    text-align: center;
}

body.pagina-catalogo .txtfiltro,
body.pagina-catalogo .txtfiltrocod {
    display: inline-block;
    height: 2.4rem;
    margin: 0 0.15rem;
    padding: 0 0.9rem;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(180deg, #3d3733 0%, #221e1c 100%);
    border: 2px solid #e08a2e;
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.pagina-catalogo .txtfiltro {
    width: 190px;
}

body.pagina-catalogo .txtfiltrocod {
    width: 140px;
    -moz-appearance: textfield;
}

body.pagina-catalogo .txtfiltrocod::-webkit-outer-spin-button,
body.pagina-catalogo .txtfiltrocod::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.pagina-catalogo .txtfiltro::placeholder,
body.pagina-catalogo .txtfiltrocod::placeholder {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    opacity: 1;
}

body.pagina-catalogo .txtfiltro:focus,
body.pagina-catalogo .txtfiltrocod:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(224, 138, 46, 0.28);
}

body.pagina-catalogo .btnbuscar {
    display: inline-block;
    width: auto;
    min-width: 6rem;
    height: 2.4rem;
    margin: 0 0.15rem;
    padding: 0 0.9rem;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

body.pagina-catalogo .btnbuscar:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ---------- Selector de rubros ---------- */

body.pagina-catalogo .rubro-select-wrap {
    position: relative;
    width: 100%;
    /* Mas ancho que antes para que los rubros largos entren con la fuente grande */
    max-width: 450px;
    margin: 0.4rem auto 0;
}

body.pagina-catalogo .rubro-select-wrap::before {
    content: 'RUBROS';
    position: absolute;
    left: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    padding: 0.26rem 0.55rem;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    border-radius: 999px;
    pointer-events: none;
}

body.pagina-catalogo .comborubro {
    width: 100%;
    height: 2.4rem;
    padding: 0 2rem 0 5rem;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    text-align: left;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%230f172a' d='M6 8 0 2 1.4.6 6 5.2 10.6.6 12 2Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 0.7rem;
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

body.pagina-catalogo .comborubro:focus {
    outline: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* Rubros que tienen productos en oferta */
body.pagina-catalogo .comborubro option.comborubro-option--oferta {
    background-color: #ffedd5;
    color: #9a3412;
    font-weight: 700;
}

/* ---------- Accesos de la derecha ---------- */

body.pagina-catalogo .divconocerte {
    width: auto;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

/* El boton de inicio y el de WhatsApp se definen en encabezado.css,
   los comparten varias paginas */

body.pagina-catalogo .divconocerte h3 {
    margin: 0;
    padding: 0.45rem 1rem;
    flex-shrink: 0;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    color: #f59e0b;
    background: #0b0b0b;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 999px;
    white-space: nowrap;
}

/* Nombre del cliente + total del pedido debajo */
body.pagina-catalogo .cliente-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    flex-shrink: 0;
    min-width: 0;
}

body.pagina-catalogo .carrito-total-cab {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.22rem 0.7rem;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    line-height: 1.15;
    color: #ecfdf5;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: 1px solid rgba(153, 246, 228, 0.55);
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.4);
    white-space: nowrap;
}

body.pagina-catalogo .carrito-total-cab[hidden] {
    display: none !important;
}

body.pagina-catalogo .carrito-total-cab__lbl {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

body.pagina-catalogo .carrito-total-cab__val {
    font-size: 0.88rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

body.pagina-catalogo .btnusu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    box-sizing: border-box;
    background: radial-gradient(circle at 32% 26%, #93c5fd 0%, #3b82f6 45%, #1d4ed8 100%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

body.pagina-catalogo .img-btnusu {
    width: 30px;
    height: 30px;
    padding: 0;
}

body.pagina-catalogo .menu-pedido {
    padding: 0;
    flex-shrink: 0;
}

/* Mismo diametro que el boton de inicio */
body.pagina-catalogo .iconpedido {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- Barra de resumen dentro del encabezado ---------- */

body.pagina-catalogo .cantidad-catalogo {
    flex: 1 1 100%;
    margin-top: 0.1rem;
}

@media only screen and (max-width: 1220px) {
    body.pagina-catalogo .cabecera {
        padding: 6px 6px 8px;
    }

    body.pagina-catalogo .div-cabecera {
        width: 100%;
        gap: 0.35rem 0.5rem;
        justify-content: center;
    }

    body.pagina-catalogo .divformulario {
        flex: 1 1 100%;
        order: 2;
        padding: 0;
    }

    body.pagina-catalogo .divconocerte {
        flex: 1 1 100%;
        order: 1;
        justify-content: space-evenly;
        gap: 0.35rem;
    }

    body.pagina-catalogo .cantidad-catalogo {
        order: 3;
    }

    body.pagina-catalogo .txtfiltro {
        width: 36%;
        max-width: 190px;
    }

    body.pagina-catalogo .txtfiltrocod {
        width: 28%;
        max-width: 140px;
    }

    body.pagina-catalogo .txtfiltro,
    body.pagina-catalogo .txtfiltrocod {
        height: 2.2rem;
        padding: 0 0.5rem;
        font-size: 0.95rem;
    }

    body.pagina-catalogo .btnbuscar {
        min-width: 0;
        width: 22%;
        max-width: 90px;
        height: 2.2rem;
        padding: 0 0.4rem;
        font-size: 0.78rem;
        letter-spacing: 0.02em;
    }

    body.pagina-catalogo .rubro-select-wrap {
        max-width: none;
        margin-top: 0.3rem;
    }

    body.pagina-catalogo .comborubro {
        height: 2.25rem;
        padding: 0 1.7rem 0 4.6rem;
        font-size: 0.9rem;
    }

    body.pagina-catalogo .btnusu {
        width: 42px;
        height: 42px;
    }

    body.pagina-catalogo .iconpedido {
        width: 44px;
        height: 44px;
    }

    body.pagina-catalogo .divconocerte h3 {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
        white-space: normal;
        text-align: center;
    }

    body.pagina-catalogo .carrito-total-cab {
        padding: 0.18rem 0.55rem;
        gap: 0.28rem;
    }

    body.pagina-catalogo .carrito-total-cab__lbl {
        font-size: 0.55rem;
    }

    body.pagina-catalogo .carrito-total-cab__val {
        font-size: 0.78rem;
    }
}
