/* =========================================
   EDICIONES TORÍZ
   ESTILO GENERAL
   ========================================= */

:root {
    --marfil: #f3efe3;
    --marfil-oscuro: #e8e1d0;

    --verde: #26382b;
    --verde-medio: #526650;
    --verde-claro: #70806d;

    --texto: #252a24;

    --papel: #e7e0ce;

    --madera-oscura: #2f1d13;
    --madera: #563522;
    --madera-clara: #70472c;

    --sombra: rgba(25, 38, 28, 0.18);
}


/* =========================================
   RESETEO
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
}


body {
    background: var(--marfil);
    color: var(--texto);

    font-family: Georgia, "Times New Roman", serif;

    line-height: 1.7;
}


/* =========================================
   ENCABEZADO
   ========================================= */

.encabezado {
    width: 100%;

    padding: 35px 30px 25px;

    text-align: center;

    border-bottom: 1px solid rgba(38, 56, 43, 0.25);
}


.marca {
    margin-bottom: 25px;
}


.logo {
    display: block;

    width: 190px;
    height: auto;

    margin: 0 auto 10px;
}


.subtitulo {
    color: var(--verde-medio);

    font-size: 0.9rem;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* =========================================
   NAVEGACIÓN
   ========================================= */

.navegacion {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 35px;
}


.navegacion a {
    color: var(--verde);

    text-decoration: none;

    font-size: 0.95rem;

    letter-spacing: 0.04em;

    transition: color 0.25s ease;
}


.navegacion a:hover {
    color: var(--verde-claro);
}


/* =========================================
   HERO
   ========================================= */

.hero {
    max-width: 950px;

    margin: 0 auto;

    padding: 115px 30px 125px;

    text-align: center;
}


.etiqueta {
    color: var(--verde-medio);

    font-size: 0.78rem;

    letter-spacing: 0.18em;

    font-weight: bold;
}


.hero h1 {
    margin-top: 18px;

    color: var(--verde);

    font-size: clamp(2.3rem, 5vw, 4.2rem);

    font-weight: normal;

    line-height: 1.15;
}


.introduccion {
    max-width: 650px;

    margin: 30px auto 35px;

    font-size: 1.1rem;

    color: #4b5149;
}


/* =========================================
   BOTONES
   ========================================= */

.boton {
    display: inline-block;

    padding: 10px 22px;

    border: 1px solid var(--verde);

    color: var(--verde);

    text-decoration: none;

    font-size: 0.9rem;

    letter-spacing: 0.05em;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}


.boton:hover {
    background: var(--verde);

    color: var(--marfil);
}


/* =========================================
   SECCIONES
   ========================================= */

.seccion {
    padding: 90px 30px;
}


.titulo-seccion {
    max-width: 900px;

    margin: 0 auto 60px;

    text-align: center;
}


.titulo-seccion h2 {
    margin-top: 8px;

    color: var(--verde);

    font-size: 2.6rem;

    font-weight: normal;

    line-height: 1.2;
}


.titulo-seccion > p:last-child {
    margin-top: 12px;

    color: #62675f;
}


/* =========================================
   CATÁLOGO — LIBRERO
   ========================================= */

.catalogo {
    position: relative;

    padding-top: 90px;
    padding-bottom: 110px;

    background:
        linear-gradient(
            90deg,
            rgba(25, 15, 10, 0.25),
            transparent 18%,
            transparent 82%,
            rgba(25, 15, 10, 0.25)
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 2px,
            transparent 2px,
            transparent 7px
        ),
        linear-gradient(
            90deg,
            var(--madera-oscura),
            var(--madera),
            var(--madera-clara),
            var(--madera),
            var(--madera-oscura)
        );

    border-top: 10px solid var(--madera-oscura);
    border-bottom: 14px solid var(--madera-oscura);

    box-shadow:
        inset 0 20px 35px rgba(0, 0, 0, 0.35),
        inset 0 -20px 35px rgba(0, 0, 0, 0.35);
}


/* Título del catálogo */

.catalogo .titulo-seccion {
    position: relative;

    z-index: 2;
}


.catalogo .titulo-seccion h2 {
    color: var(--marfil);
}


.catalogo .titulo-seccion > p:last-child {
    color: #d8d0bd;
}


.catalogo .etiqueta {
    color: #c5b995;
}


/* =========================================
   ESTRUCTURA DE LOS LIBROS
   ========================================= */

.libros {
    position: relative;

    max-width: 1050px;

    margin: 0 auto;

    padding: 55px 40px 40px;

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 70px;

    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 2px,
            transparent 2px,
            transparent 8px
        ),
        linear-gradient(
            90deg,
            #422818,
            #613d25,
            #70472c,
            #593720,
            #3d2416
        );

    box-shadow:
        inset 0 10px 25px rgba(0, 0, 0, 0.28),
        inset 0 -12px 25px rgba(0, 0, 0, 0.3),
        0 18px 35px rgba(0, 0, 0, 0.28);
}


/* =========================================
   REPISA
   ========================================= */

.libros::after {
    content: "";

    position: absolute;

    left: -18px;
    right: -18px;

    bottom: -30px;

    height: 30px;

    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.035) 0px,
            rgba(255, 255, 255, 0.035) 2px,
            transparent 2px,
            transparent 7px
        ),
        linear-gradient(
            to bottom,
            var(--madera-clara),
            var(--madera),
            var(--madera-oscura)
        );

    border-radius: 2px;

    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.08);
}


/* =========================================
   LIBROS
   ========================================= */

.libro {
    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    z-index: 1;
}


/* =========================================
   PORTADAS
   ========================================= */

.portada-contenedor {
    width: 190px;
    height: 285px;

    margin-bottom: 30px;

    background: var(--papel);

    overflow: hidden;

    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.38),
        3px 4px 0 rgba(25, 15, 10, 0.25);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.portada-contenedor:hover {
    transform: translateY(-7px);

    box-shadow:
        0 17px 27px rgba(0, 0, 0, 0.45),
        3px 4px 0 rgba(25, 15, 10, 0.25);
}


.portada-imagen {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================
   INFORMACIÓN DEL LIBRO
   ========================================= */

.informacion-libro {
    max-width: 390px;

    padding: 22px 25px 25px;

    background: rgba(243, 239, 227, 0.96);

    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.25);
}


.tipo-libro {
    color: var(--verde-medio);

    font-size: 0.72rem;

    font-weight: bold;

    letter-spacing: 0.16em;
}


.informacion-libro h3 {
    margin-top: 8px;

    color: var(--verde);

    font-size: 1.8rem;

    font-weight: normal;

    line-height: 1.25;
}


.autor {
    margin-top: 4px;

    font-style: italic;

    color: #62675f;
}


.descripcion {
    margin-top: 18px;

    font-size: 0.98rem;

    color: #454a43;
}


.formato {
    margin-top: 16px;

    color: var(--verde-medio);

    font-size: 0.82rem;

    font-style: italic;
}


.boton-libro {
    margin-top: 22px;
}


/* =========================================
   LA EDITORIAL
   ========================================= */

.editorial {
    max-width: 900px;

    margin: 0 auto;

    text-align: center;
}


.texto-editorial {
    max-width: 700px;

    margin: 0 auto;

    font-size: 1.05rem;
}


.texto-editorial p {
    margin-bottom: 22px;
}


.texto-editorial p:last-child {
    margin-bottom: 0;
}


/* =========================================
   PIE
   ========================================= */

.pie {
    padding: 35px 30px;

    background: var(--verde);

    color: var(--marfil);

    text-align: center;

    font-size: 0.85rem;
}


.pie p + p {
    margin-top: 4px;

    opacity: 0.7;
}


/* =========================================
   ANIMACIÓN
   ========================================= */

.seccion {
    opacity: 0;

    transform: translateY(20px);

    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}


.seccion.visible {
    opacity: 1;

    transform: translateY(0);
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 850px) {

    .libros {
        grid-template-columns: 1fr;

        gap: 80px;
    }

}


@media (max-width: 600px) {

    .encabezado {
        padding: 25px 20px 20px;
    }


    .logo {
        width: 155px;
    }


    .navegacion {
        gap: 20px;
    }


    .navegacion a {
        font-size: 0.85rem;
    }


    .hero {
        padding: 80px 25px 90px;
    }


    .hero h1 {
        font-size: 2.25rem;
    }


    .introduccion {
        font-size: 1rem;
    }


    .seccion {
        padding: 70px 25px;
    }


    .titulo-seccion {
        margin-bottom: 45px;
    }


    .titulo-seccion h2 {
        font-size: 2.2rem;
    }


    .libros {
        padding: 45px 20px 35px;
    }


    .portada-contenedor {
        width: 175px;
        height: 263px;
    }


    .informacion-libro {
        max-width: 100%;

        padding: 20px;
    }

}

/* =========================================
   FICHA INDIVIDUAL DE LIBRO
   ========================================= */

.ficha-libro {
    max-width: 1100px;
    margin: 0 auto;
    padding: 100px 40px 90px;

    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 80px;

    align-items: center;
}


/* PORTADA */

.ficha-portada {
    display: flex;
    justify-content: center;
    align-items: center;
}

.portada-ficha {
    display: block;
    width: 100%;
    max-width: 380px;
    height: auto;

    box-shadow:
        0 18px 30px rgba(0, 0, 0, 0.22),
        5px 7px 0 rgba(38, 56, 43, 0.10);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.portada-ficha:hover {
    transform: translateY(-6px);

    box-shadow:
        0 25px 38px rgba(0, 0, 0, 0.28),
        5px 7px 0 rgba(38, 56, 43, 0.10);
}


/* INFORMACIÓN */

.ficha-informacion {
    max-width: 600px;
}

.ficha-informacion > .etiqueta {
    margin-bottom: 18px;
}

.ficha-informacion h1 {
    color: var(--verde);
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    font-weight: normal;
    line-height: 1.08;
}

.ficha-autor {
    margin-top: 12px;

    color: #4f554d;
    font-size: 1.15rem;
    font-style: italic;
}

.ficha-genero {
    margin-top: 6px;

    color: var(--verde-medio);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
}


/* DESCRIPCIÓN */

.ficha-descripcion {
    margin-top: 38px;

    font-size: 1.04rem;
    line-height: 1.8;
    color: #3f443d;
}

.ficha-descripcion p {
    margin-bottom: 20px;
}

.ficha-descripcion p:last-child {
    margin-bottom: 0;
}


/* DATOS EDITORIALES */

.ficha-datos {
    margin-top: 38px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);

    border-top: 1px solid rgba(38, 56, 43, 0.25);
    border-bottom: 1px solid rgba(38, 56, 43, 0.25);
}

.ficha-datos div {
    padding: 17px 15px;

    display: flex;
    flex-direction: column;

    border-bottom: 1px solid rgba(38, 56, 43, 0.12);
}

.ficha-datos div:nth-child(odd) {
    border-right: 1px solid rgba(38, 56, 43, 0.12);
}

.ficha-datos div:nth-child(3),
.ficha-datos div:nth-child(4) {
    border-bottom: none;
}

.ficha-datos span {
    color: var(--verde-medio);

    font-size: 0.68rem;
    font-weight: bold;
    letter-spacing: 0.13em;
}

.ficha-datos strong {
    margin-top: 4px;

    color: var(--verde);
    font-size: 0.95rem;
    font-weight: normal;
}


/* EDICIÓN DIGITAL */

.ficha-digital {
    margin-top: 25px;
    padding: 17px 20px;

    background: var(--marfil-oscuro);
    border-left: 3px solid var(--verde);
}

.tipo-edicion {
    margin-bottom: 3px;

    color: var(--verde-medio);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.14em;
}

.ficha-digital p:last-child {
    color: var(--verde);
    font-size: 1rem;
}


/* BOTONES */

.ficha-botones {
    margin-top: 30px;

    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ficha-botones .boton {
    padding: 12px 20px;
}


/* VOLVER AL CATÁLOGO */

.volver {
    padding: 0 30px 90px;

    text-align: center;
}

.volver .boton {
    font-size: 0.82rem;
}


/* =========================================
   FICHA EN MÓVIL
   ========================================= */

@media (max-width: 850px) {

    .ficha-libro {
        grid-template-columns: 1fr;

        gap: 55px;

        padding: 75px 30px 70px;
    }

    .ficha-portada {
        order: 1;
    }

    .ficha-informacion {
        order: 2;

        max-width: 650px;
        margin: 0 auto;
        text-align: center;
    }

    .ficha-descripcion {
        text-align: left;
    }

    .ficha-datos {
        text-align: left;
    }

    .ficha-digital {
        text-align: left;
    }

    .ficha-botones {
        justify-content: center;
    }

    .portada-ficha {
        max-width: 330px;
    }
}


@media (max-width: 600px) {

    .ficha-libro {
        padding: 60px 25px 60px;
    }

    .portada-ficha {
        max-width: 285px;
    }

    .ficha-informacion h1 {
        font-size: 2.5rem;
    }

    .ficha-autor {
        font-size: 1.05rem;
    }

    .ficha-descripcion {
        margin-top: 30px;
        font-size: 0.98rem;
    }

    .ficha-datos {
        grid-template-columns: 1fr;
    }

    .ficha-datos div,
    .ficha-datos div:nth-child(odd),
    .ficha-datos div:nth-child(3),
    .ficha-datos div:nth-child(4) {
        border-right: none;
        border-bottom: 1px solid rgba(38, 56, 43, 0.12);
    }

    .ficha-datos div:last-child {
        border-bottom: none;
    }

    .ficha-botones {
        flex-direction: column;
        align-items: stretch;
    }

    .ficha-botones .boton {
        text-align: center;
    }

    .volver {
        padding-bottom: 65px;
    }
}

/* =========================================
   CANASTA
   ========================================= */

.canasta {
    max-width: 950px;
    margin: 0 auto;
    padding: 95px 30px 70px;
}

.canasta .titulo-seccion {
    margin-bottom: 50px;
}

.canasta .titulo-seccion h1 {
    margin-top: 8px;
    color: var(--verde);
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: normal;
    line-height: 1.15;
}

.canasta-contenido {
    max-width: 800px;
    margin: 0 auto;
}

.item-canasta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding: 28px 30px;
    background: var(--marfil-oscuro);
    border-top: 1px solid rgba(38, 56, 43, 0.18);
}

.item-canasta:last-child {
    border-bottom: 1px solid rgba(38, 56, 43, 0.18);
}

.item-canasta-informacion h2 {
    margin-top: 5px;
    color: var(--verde);
    font-size: 1.45rem;
    font-weight: normal;
}

.item-canasta-informacion .autor {
    margin-top: 2px;
    color: #62675f;
}

.item-canasta-precio {
    text-align: right;
    white-space: nowrap;
}

.item-canasta-precio strong {
    display: block;
    color: var(--verde);
    font-size: 1.1rem;
    font-weight: normal;
}

.eliminar-producto {
    margin-top: 8px;
    padding: 0;
    border: none;
    background: none;
    color: #777;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
}

.eliminar-producto:hover {
    color: var(--verde);
}

.canasta-vacia {
    max-width: 600px;
    margin: 0 auto;
    padding: 45px 30px;
    text-align: center;
    background: var(--marfil-oscuro);
}

.canasta-vacia p {
    margin-bottom: 22px;
    color: #62675f;
}

.canasta-total {
    max-width: 800px;
    margin: 30px auto 0;
    padding: 25px 30px;
    background: var(--verde);
    color: var(--marfil);
}

.canasta-total > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.canasta-total span {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}

.canasta-total strong {
    font-size: 1.5rem;
    font-weight: normal;
}

.canasta-acciones {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.canasta-acciones .boton {
    border-color: var(--marfil);
    color: var(--marfil);
}

.canasta-acciones .boton:hover {
    background: var(--marfil);
    color: var(--verde);
}

.canasta-acciones .boton-secundario {
    opacity: 0.75;
}

.boton-anadido {
    background: var(--verde);
    color: var(--marfil);
}

@media (max-width: 600px) {

    .canasta {
        padding: 65px 20px 55px;
    }

    .item-canasta {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 25px 20px;
    }

    .item-canasta-precio {
        width: 100%;
        text-align: left;
    }

    .canasta-total > div:first-child {
        align-items: flex-start;
    }

    .canasta-acciones {
        flex-direction: column;
    }

    .canasta-acciones .boton {
        width: 100%;
        text-align: center;
    }

}