.no-libros-grid,
.no-libros-grid * { box-sizing: border-box; }

.no-libros-grid {
    --verde: #123f36;
    --verde2: #205e54;
    --azul: #5b8290;
    --crema: #f7f6f1;
    --texto: #53656c;
    --beige: #b49b83;
    width: 100%;
    display: grid;
    gap: 28px;
    margin: 30px auto;
}

.no-libros-grid--1 { grid-template-columns: 1fr; max-width: 760px; }
.no-libros-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 1120px; }
.no-libros-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); max-width: 1180px; }
.no-libros-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); max-width: 1250px; }

.no-libro-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--crema);
    border: 1px solid rgba(39,64,74,.12);
    border-radius: 22px;
    box-shadow: 0 14px 35px rgba(18,63,54,.10);
    transition: transform .22s ease, box-shadow .22s ease;
}

.no-libro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(18,63,54,.16);
}

.no-libro-card__image {
    display: block;
    aspect-ratio: 4 / 4.7;
    overflow: hidden;
    background: #e8e4dc;
}

.no-libro-card__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.no-libro-card:hover .no-libro-card__image img {
    transform: scale(1.035);
}

.no-libro-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azul);
}

.no-libro-card__placeholder .dashicons {
    font-size: 62px;
    width: 62px;
    height: 62px;
}

.no-libro-card__body {
    padding: 27px 26px 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.no-libro-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #dfeae8;
    color: var(--azul);
    font: 800 10px/1 "Inter", Arial, sans-serif;
    letter-spacing: 1.3px;
}

.no-libro-card__title {
    margin: 15px 0 10px;
    color: var(--verde);
    font: 700 clamp(30px, 2.6vw, 39px)/.98 "Cormorant Garamond", Georgia, serif;
    letter-spacing: -.4px;
}

.no-libro-card__description {
    margin: 0 0 18px;
    color: var(--texto);
    font: 400 14px/1.65 "Inter", Arial, sans-serif;
    text-align: justify;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.no-libro-card__price {
    margin: auto 0 18px;
    color: var(--beige);
    font: 800 19px/1.2 "Inter", Arial, sans-serif;
}

.no-libro-card__button {
    width: 100%;
    min-height: 49px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--verde2);
    color: #fff !important;
    text-decoration: none !important;
    font: 800 13px/1.2 "Inter", Arial, sans-serif;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.no-libro-card__button:hover {
    background: #0d302a;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(18,63,54,.20);
}

.no-libro-card__button svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
    flex: 0 0 19px;
}

.no-libros-vacio {
    padding: 35px;
    text-align: center;
    border: 1px dashed rgba(39,64,74,.2);
    border-radius: 20px;
    color: #53656c;
}

@media (max-width: 900px) {
    .no-libros-grid--4,
    .no-libros-grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
    .no-libros-grid,
    .no-libros-grid--4,
    .no-libros-grid--3,
    .no-libros-grid--2 { grid-template-columns: 1fr; gap: 20px; }
    .no-libro-card__body { padding: 24px 21px 25px; }
    .no-libro-card__title { font-size: 36px; }
}


/* =========================================================
   VENTANA EMERGENTE / MODAL DE LIBROS
   ========================================================= */
.no-libro-card {
    cursor: pointer;
    outline: none;
}

.no-libro-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(91,130,144,.35), 0 20px 45px rgba(18,63,54,.16);
}

.no-libro-card__details {
    margin-top: auto;
    color: var(--verde2);
    font: 800 13px/1.2 "Inter", Arial, sans-serif;
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.no-libro-card__details span {
    font-size: 18px;
    transition: transform .2s ease;
}

.no-libro-card:hover .no-libro-card__details span {
    transform: translateX(4px);
}

.no-libro-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.no-libro-modal.is-open {
    display: flex;
}

.no-libro-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17,31,31,.70);
    backdrop-filter: blur(6px);
}

.no-libro-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(1080px, 100%);
    max-height: min(760px, calc(100vh - 60px));
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(330px, 48%) minmax(0, 52%);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 28px 90px rgba(0,0,0,.28);
    animation: noLibroIn .25s ease both;
}

@keyframes noLibroIn {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.no-libro-modal__close {
    position: absolute;
    z-index: 5;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.96);
    color: #163b35;
    box-shadow: 0 7px 22px rgba(0,0,0,.13);
    font: 400 31px/38px Arial, sans-serif;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.no-libro-modal__close:hover {
    transform: rotate(5deg) scale(1.05);
    background: #fff;
}

.no-libro-modal__media {
    min-height: 560px;
    background: #eeeae3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
    overflow: hidden;
}

.no-libro-modal__media img {
    width: 100%;
    height: 100%;
    max-height: 690px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.no-libro-modal__content {
    padding: 58px 54px 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #fbfaf7;
}

.no-libro-modal__tag {
    display: inline-flex;
    padding: 8px 13px;
    border-radius: 999px;
    background: #e0ebe8;
    color: #5b8290;
    font: 800 10px/1 "Inter", Arial, sans-serif;
    letter-spacing: 1.4px;
}

.no-libro-modal__title {
    margin: 18px 0 8px;
    color: #123f36;
    font: 700 clamp(38px, 4vw, 58px)/.92 "Cormorant Garamond", Georgia, serif;
    letter-spacing: -.7px;
}

.no-libro-modal__price {
    color: #b49b83;
    font: 800 21px/1.2 "Inter", Arial, sans-serif;
}

.no-libro-modal__price:empty {
    display: none;
}

.no-libro-modal__divider {
    width: 100%;
    height: 1px;
    margin: 25px 0 23px;
    background: rgba(39,64,74,.14);
}

.no-libro-modal__content h3 {
    margin: 0 0 9px;
    color: #285c78;
    font: 700 19px/1.2 "Inter", Arial, sans-serif;
}

.no-libro-modal__description,
.no-libro-modal__full {
    margin: 0;
    color: #53656c;
    font: 400 15px/1.7 "Inter", Arial, sans-serif;
}

.no-libro-modal__full {
    margin-top: 14px;
}

.no-libro-modal__full:empty {
    display: none;
}

.no-libro-modal__button {
    width: 100%;
    min-height: 54px;
    margin-top: auto;
    padding: 14px 20px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    background: #205e54;
    color: #fff !important;
    text-decoration: none !important;
    font: 800 14px/1.2 "Inter", Arial, sans-serif;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.no-libro-modal__button:hover {
    background: #0d302a;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(18,63,54,.22);
}

.no-libro-modal__button svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

body.no-libro-modal-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .no-libro-modal {
        padding: 12px;
    }

    .no-libro-modal__dialog {
        max-height: calc(100vh - 24px);
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .no-libro-modal__media {
        min-height: 300px;
        max-height: 46vh;
        padding: 22px 52px 22px 22px;
    }

    .no-libro-modal__media img {
        max-height: 42vh;
    }

    .no-libro-modal__content {
        padding: 30px 24px 26px;
    }

    .no-libro-modal__title {
        font-size: 42px;
    }

    .no-libro-modal__button {
        margin-top: 25px;
    }
}
