/* ==================================================
   HISTORIAL · IMPRIMI2
================================================== */

.pagina-historial {
    min-height: 70vh;
    background: #fffef9;
    color: #111111;
}

.historial-hero {
    max-width: 1250px;
    margin: 0 auto;
    padding:
        72px
        5%
        42px;
}

.historial-kicker {
    margin-bottom: 13px;
    color: #13aec0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.historial-hero h1 {
    margin: 0;
    font-size:
        clamp(
            58px,
            8vw,
            110px
        );
    line-height: 0.82;
    font-weight: 950;
    letter-spacing: -0.055em;
}

.historial-intro {
    max-width: 630px;
    margin-top: 28px;
    color: #666666;
    font-size:
        clamp(
            16px,
            2vw,
            20px
        );
    line-height: 1.45;
}


/* ==================================================
   PANEL
================================================== */

.historial-panel {
    max-width: 1250px;
    margin: 0 auto;
    padding:
        0
        5%
        110px;
}

.historial-oculto {
    display: none !important;
}

.historial-estado {
    padding:
        48px
        30px;
    border: 1px solid #dddddd;
    background: #ffffff;
    text-align: center;
}

.historial-estado h2 {
    margin-bottom: 10px;
    font-size:
        clamp(
            25px,
            4vw,
            36px
        );
}

.historial-estado p {
    max-width: 620px;
    margin:
        0
        auto
        24px;
    color: #777777;
    line-height: 1.5;
}

.historial-boton {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding:
        0
        23px;
    border: 0;
    background: #111111;
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}


/* ==================================================
   LISTA
================================================== */

.historial-lista {
    display: grid;
    gap: 26px;
}

.historial-pedido {
    overflow: hidden;
    border: 1px solid #dcdcdc;
    background: #ffffff;
}

.historial-pedido-cabecera {
    display: grid;
    grid-template-columns:
        minmax(130px, 0.7fr)
        minmax(150px, 1fr)
        minmax(140px, 0.8fr)
        auto;
    gap: 22px;
    align-items: center;
    padding:
        20px
        24px;
    border-bottom: 1px solid #dddddd;
    background: #f6f6f3;
}

.historial-dato {
    min-width: 0;
}

.historial-dato span {
    display: block;
    margin-bottom: 5px;
    color: #777777;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.historial-dato strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.historial-total strong {
    color: #ff006e;
    font-size: 17px;
}


/* ==================================================
   ESTADO PEDIDO
================================================== */

.historial-badge {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding:
        5px
        11px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.historial-badge[data-estado="processing"] {
    background: #13aec0;
}

.historial-badge[data-estado="shipped"] {
    background: #111111;
}

.historial-badge[data-estado="cancelled"],
.historial-badge[data-estado="refunded"] {
    background: #777777;
}

.historial-badge[data-pago="unpaid"] {
    background: #ffd600;
    color: #111111;
}


/* ==================================================
   ITEMS
================================================== */

.historial-items {
    display: grid;
}

.historial-item {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    gap: 25px;
    padding:
        24px;
    border-bottom: 1px solid #e2e2e2;
}

.historial-item:last-child {
    border-bottom: 0;
}

.historial-item h3 {
    margin:
        0
        0
        8px;
    font-size: 18px;
    font-weight: 800;
}

.historial-item-datos {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
}

.historial-item-datos p {
    margin: 0;
    color: #777777;
    font-size: 12px;
}

.historial-item-precio {
    margin: 0;
    color: #111111;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}


/*
Código de descuento: una fila más, debajo de los
productos, para que cuadre con el total.
*/
.historial-descuento h3 {
    font-size: 15px;
}

/*
Dos clases: tema.css (que va el último) pone en claro
.historial-item-precio en modo oscuro, con una sola.
*/
.historial-descuento .historial-descuento-importe {
    color: #ff006e;
}


/* ==================================================
   PERSONALIZACIÓN
================================================== */

.historial-personalizacion {
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.historial-personalizacion-titulo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
}

.historial-personalizacion-titulo strong {
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

.historial-personalizacion-titulo span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding:
        3px
        8px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
}

.historial-caras {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 10px;
}

.historial-cara {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 9px;
    background: #ffffff;
}

.historial-cara-frontal {
    border-left: 4px solid #13aec0;
}

.historial-cara-trasera {
    border-left: 4px solid #ff006e;
}

.historial-cara-cabecera {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 7px;
    margin-bottom: 8px;
}

.historial-cara-cabecera strong {
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.07em;
}

.historial-cara-cabecera span {
    color: #777777;
    font-size: 9px;
    font-weight: 800;
}

.historial-cara p {
    margin:
        5px
        0;
    color: #666666;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.historial-cara p strong {
    color: #111111;
}

.historial-diseno-boton {
    min-height: 38px;
    margin-top: 9px;
    padding:
        0
        13px;
    border: 1px solid #111111;
    background: transparent;
    color: #111111;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 900;
}

.historial-diseno-boton:disabled {
    cursor: wait;
    opacity: 0.5;
}

.historial-notas {
    margin:
        10px
        0
        0;
    padding:
        10px
        11px;
    border-radius: 8px;
    background:
        rgba(
            255,
            214,
            0,
            0.14
        );
    color: #555555;
    font-size: 11px;
    line-height: 1.45;
}


/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 850px) {

    .historial-pedido-cabecera {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .historial-badge {
        justify-self: start;
    }

}

@media (max-width: 650px) {

    .historial-hero {
        padding-top: 45px;
    }

    .historial-panel {
        padding-bottom: 75px;
    }

    .historial-pedido-cabecera {
        grid-template-columns:
            1fr;
        gap: 13px;
        padding:
            18px;
    }

    .historial-item {
        grid-template-columns:
            1fr;
        padding:
            18px;
    }

    .historial-item-precio {
        justify-self: start;
    }

    .historial-caras {
        grid-template-columns:
            1fr;
    }

}


/* ==================================================
   HISTORIAL · ESTADO DE PRODUCCIÓN
================================================== */

.historial-produccion {
    margin: 0 22px 18px;
    padding: 15px;
    border: 1px solid rgba(17, 17, 17, 0.10);
    border-left: 4px solid #13aec0;
    background: #f8feff;
}

.historial-produccion-in_production {
    border-left-color: #ffd600;
    background: #fffdf3;
}

.historial-produccion-ready {
    border-left-color: #13aec0;
    background: #f2fdff;
}

.historial-produccion-hold {
    border-left-color: #ff006e;
    background: #fff6f9;
}

.historial-produccion-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.historial-produccion-cabecera span {
    color: #777777;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.historial-produccion-cabecera strong {
    font-size: 10px;
    font-weight: 950;
}

.historial-produccion-pasos {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 5px;
}

.historial-produccion-pasos > div {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 5px;
    color: #999999;
    font-size: 8px;
    font-weight: 900;
    text-align: center;
}

.historial-produccion-pasos > div::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 6px;
    left: -52%;
    width: 104%;
    height: 2px;
    background: #dddddd;
}

.historial-produccion-pasos > div:first-child::before {
    display: none;
}

.historial-produccion-pasos i {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    display: block;
    border-radius: 50%;
    background: #dddddd;
}

.historial-produccion-pasos .activo {
    color: #111111;
}

.historial-produccion-pasos .activo i,
.historial-produccion-pasos .activo::before {
    background: #13aec0;
}

.historial-produccion-in_production
.historial-produccion-pasos
.activo i,
.historial-produccion-in_production
.historial-produccion-pasos
.activo::before {
    background: #ffd600;
}

.historial-produccion-aviso {
    margin: 12px 0 0;
    padding: 9px 10px;
    background: rgba(255, 0, 110, 0.08);
    color: #a80046;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 600px) {

    .historial-produccion {
        margin: 0 14px 15px;
    }

}


/* ==================================================
   VOLVER A PEDIR
================================================== */

.historial-pedido-pie {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    justify-content: flex-end;

    gap:
        12px
        18px;

    padding-top: 16px;

    border-top:
        1px solid #e6e6e6;

}


.historial-repetir {

    /*
    A la derecha aunque a su izquierda esté la
    cancelación (botón o nota).
    */
    margin-left: auto;

    min-height: 44px;

    padding:
        0
        22px;

    border:
        1px solid #111111;

    background: transparent;

    color: #111111;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.1em;

    transition:
        background .15s ease,
        color .15s ease;

}


.historial-repetir:hover:not(:disabled) {

    background: #111111;

    color: #ffffff;

}


.historial-repetir:disabled {

    opacity: 0.5;

    cursor: wait;

}



/* ==================================================
   SOLICITUD DE CANCELACIÓN (historial.js)

   Estado de la solicitud debajo de la producción
   (amarillo: pendiente; cyan: aceptada; gris:
   rechazada) y, en el pie, el botón o la nota de por
   qué ya no se puede cancelar. Modo oscuro en tema.css.
================================================== */

.historial-cancelacion {

    margin:
        0
        22px
        18px;

    padding: 15px;

    border:
        1px solid rgba(17, 17, 17, 0.10);

    border-left:
        4px solid #ffd600;

    background: #fffdf3;

}


.historial-cancelacion-aceptada {

    border-left-color: #13aec0;

    background: #f2fdff;

}


.historial-cancelacion-rechazada {

    border-left-color: #777777;

    background: #f7f7f7;

}


.historial-cancelacion strong {

    display: block;

    margin-bottom: 6px;

    color: #111111;

    font-size: 11px;

    font-weight: 900;

    letter-spacing: 0.06em;

}


.historial-cancelacion p {

    margin: 0;

    color: #555555;

    font-size: 13px;

    line-height: 1.55;

}


.historial-cancelacion-enlace {

    display: inline-flex;

    align-items: center;

    min-height: 38px;

    margin-top: 12px;

    padding:
        0
        16px;

    border:
        1px solid #111111;

    color: #111111;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-decoration: none;

    transition:
        background .15s ease,
        color .15s ease;

}


.historial-cancelacion-enlace:hover {

    background: #111111;

    color: #ffffff;

}


.historial-cancelar {

    min-height: 44px;

    padding:
        0
        18px;

    border:
        1px solid rgba(17, 17, 17, 0.3);

    background: transparent;

    color: #555555;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.1em;

    transition:
        border-color .15s ease,
        color .15s ease;

}


.historial-cancelar:hover:not(:disabled) {

    border-color: #ff006e;

    color: #ff006e;

}


.historial-cancelar:disabled {

    opacity: 0.5;

    cursor: wait;

}


.historial-cancelar-nota {

    flex:
        1
        1
        260px;

    margin: 0;

    /*
    El pie no tiene márgenes laterales (los botones van
    pegados al borde de la tarjeta); el texto, no.
    */
    padding:
        0
        0
        0
        24px;

    color: #666666;

    font-size: 12px;

    line-height: 1.5;

}


/*
En la nota, el enlace es texto subrayado, no botón.
*/
.historial-cancelar-nota .historial-cancelacion-enlace {

    display: inline;

    min-height: 0;

    margin: 0;

    padding: 0;

    border: 0;

    color: #111111;

    font-size: inherit;

    font-weight: 700;

    letter-spacing: normal;

    text-decoration: underline;

}


.historial-cancelar-nota .historial-cancelacion-enlace:hover {

    background: transparent;

    color: #ff006e;

}


@media (max-width: 600px) {

    .historial-cancelacion {

        margin:
            0
            14px
            15px;

    }


    .historial-cancelar-nota {

        padding:
            0
            18px;

    }

}



/* ==================================================
   AVISO DEL RESULTADO
================================================== */

.repetir-aviso {

    position: fixed;

    left: 50%;

    bottom: 24px;

    z-index: 970;

    width: min(460px, calc(100vw - 32px));

    padding: 20px;

    border:
        1px solid #111111;

    background: #ffffff;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.18);

    opacity: 0;

    transform:
        translate(-50%, 16px);

    transition:
        opacity .2s ease,
        transform .2s ease;

}


.repetir-aviso-visible {

    opacity: 1;

    transform:
        translate(-50%, 0);

}


.repetir-aviso-titulo {

    margin-bottom: 12px;

    color: #087b87;

    font-size: 14px;

    font-weight: 800;

}


.repetir-aviso-nada {

    color: #ff006e;

}


.repetir-aviso-lista {

    margin: 0 0 16px;

    padding: 0;

    list-style: none;

}


.repetir-aviso-lista li {

    padding:
        8px
        0
        8px
        14px;

    border-left:
        3px solid #ff006e;

    color: #444444;

    font-size: 12px;

    line-height: 1.5;

}


.repetir-aviso-lista li + li {

    margin-top: 6px;

}


.repetir-aviso-parcial {

    border-left-color: #ffd600 !important;

}


.repetir-aviso-acciones {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}


.repetir-aviso-boton,
.repetir-aviso-cerrar {

    min-height: 42px;

    flex: 1;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding:
        0
        18px;

    border:
        1px solid #111111;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.1em;

    text-decoration: none;

}


.repetir-aviso-boton {

    border-color: #ff006e;

    background: #ff006e;

    color: #ffffff;

}


.repetir-aviso-boton:hover {

    border-color: #111111;

    background: #111111;

}


.repetir-aviso-cerrar {

    background: transparent;

    color: #111111;

}


.repetir-aviso-cerrar:hover {

    background: #111111;

    color: #ffffff;

}


@media (max-width: 560px) {

    .historial-pedido-pie {

        justify-content: stretch;

    }


    .historial-repetir,
    .historial-cancelar {

        width: 100%;

    }

}
