/*
 * Identidad visual del ecommerce anterior.
 * Esta hoja se carga al final para que todas las vistas compartan tipografias,
 * paleta, botones, encabezado, tarjetas, formularios y pie de pagina.
 */
@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../../fonts/fraunces-latin-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../../fonts/plus-jakarta-sans-latin-variable.woff2") format("woff2");
}

:root,
body.ec-site {
    --ec-ink: #2b1a16;
    --ec-muted: #6b5a52;
    --ec-paper: #ffffff;
    --ec-surface: #faf8f6;
    --ec-card: #f7f4f1;
    --ec-sand: #f5eee9;
    --ec-gold: #b58d55;
    --ec-gold-soft: #e1bc7e;
    --ec-wine: #300406;
    --ec-wine-dark: #250907;
    --ec-wine-deep: #250907;
    --ec-wine-soft: #401a15;
    --ec-line: #e8ddd4;
    --ec-border: #e8ddd4;
    --ec-white: #ffffff;
    --ec-shadow-soft: 0 8px 24px rgba(48, 4, 6, .10);
    --ec-shadow-card: 0 4px 14px rgba(48, 4, 6, .08);
}

html,
body.ec-site {
    min-height: 100%;
}

body.ec-site {
    margin: 0;
    color: var(--ec-ink);
    background: var(--ec-surface);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 400;
}

body.ec-site input,
body.ec-site select,
body.ec-site textarea,
body.ec-site button {
    font-family: "Plus Jakarta Sans", sans-serif;
}

body.ec-site h1,
body.ec-site h2,
body.ec-site h3,
body.ec-site .ec-book-title,
body.ec-site .ec-cart-info h2,
body.ec-site .ec-favorite-card h2,
body.ec-site .ec-book-card h2,
body.ec-site .card h3 {
    font-family: "Fraunces", Georgia, serif;
    color: var(--ec-ink);
}

body.ec-site .ec-site-content {
    min-height: 55vh;
    background: var(--ec-paper);
}

/* Encabezado equivalente al original. */
body.ec-site .ec-promo-bar {
    background: var(--ec-wine);
    color: #fff8f0;
}

body.ec-site .ec-promo-content {
    min-height: 28px;
    padding-block: 6px;
    font-size: 11px;
}

body.ec-site .ec-site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(232, 221, 212, .88);
    background: rgba(255, 255, 255, .96);
    box-shadow: none;
    backdrop-filter: blur(14px);
}

body.ec-site .ec-header-main {
    min-height: 84px;
    padding-block: 14px;
}

body.ec-site .ec-brand img {
    width: min(190px, 100%);
    max-height: 56px;
}

body.ec-site .ec-header-search {
    min-height: 38px;
    border-color: #ded9d4;
    border-radius: 10px;
    box-shadow: none;
}

body.ec-site .ec-header-search:focus-within {
    border-color: rgba(181, 141, 85, .85);
    box-shadow: 0 0 0 3px rgba(181, 141, 85, .12);
}

body.ec-site .ec-header-search input {
    color: var(--ec-ink);
    font-size: 13px;
    font-weight: 400;
}

body.ec-site .ec-header-search button {
    width: 48px;
    border-radius: 0 9px 9px 0;
    background: #3b0a06;
    color: #fff;
}

body.ec-site .ec-header-action {
    color: var(--ec-ink);
    font-size: 13px;
    font-weight: 600;
}

body.ec-site .ec-header-action:hover,
body.ec-site .ec-header-action:focus-visible {
    color: var(--ec-wine);
}

body.ec-site .ec-main-nav {
    border-top: 1px solid rgba(232, 221, 212, .8);
    background: var(--ec-sand);
}

body.ec-site .ec-main-nav .ec-shell {
    min-height: 38px;
}

body.ec-site .ec-main-nav a {
    padding-block: 10px;
    color: var(--ec-ink);
    font-size: 13px;
    font-weight: 500;
}

body.ec-site .ec-main-nav a:hover, body.ec-site .ec-main-nav a:focus-visible {
    color: #ffffff;
}

/* Superficies, tarjetas y formularios. */
body.ec-site .ec-cart-page,
body.ec-site .ec-favorites-page,
body.ec-site .ec-directory-page,
body.ec-site .ec-entity-page,
body.ec-site .ec-checkout-page,
body.ec-site .ec-payment-page,
body.ec-site .ec-account-page,
body.ec-site .section {
    background: var(--ec-paper);
}

body.ec-site .ec-cart-list,
body.ec-site .ec-cart-summary,
body.ec-site .ec-favorite-card,
body.ec-site .ec-book-card,
body.ec-site .card,
body.ec-site .ec-auth-card,
body.ec-site .ec-checkout-form,
body.ec-site .ec-payment-result,
body.ec-site .ec-detail-tabs-panel {
    border-color: var(--ec-border);
    background: var(--ec-paper);
    box-shadow: var(--ec-shadow-card);
}

body.ec-site .ec-cart-heading h1,
body.ec-site .ec-directory-heading h1,
body.ec-site .ec-entity-heading h1,
body.ec-site .ec-auth-intro h1,
body.ec-site .ec-auth-card h2,
body.ec-site .ec-checkout-page h1,
body.ec-site .ec-checkout-data > h2,
body.ec-site .ec-payment-result h1 {
    font-family: "Fraunces", Georgia, serif;
}

body.ec-site .ec-shop-kicker,
body.ec-site .kicker,
body.ec-site .eyebrow {
    color: var(--ec-gold);
    letter-spacing: .14em;
}

body.ec-site input:not([type="checkbox"]):not([type="radio"]),
body.ec-site select,
body.ec-site textarea {
    border-color: #ded9d4;
    background: #fff;
    color: var(--ec-ink);
}

body.ec-site input:not([type="checkbox"]):not([type="radio"]):focus,
body.ec-site select:focus,
body.ec-site textarea:focus {
    border-color: rgba(181, 141, 85, .9);
    box-shadow: 0 0 0 3px rgba(181, 141, 85, .12);
}

body.ec-site .ec-auth-intro {
    background: linear-gradient(135deg, var(--ec-wine) 0%, #5a130d 100%);
}

/* Acciones: texto blanco tanto en reposo como en hover. */
body.ec-site .btn,
body.ec-site .btn-dark,
body.ec-site .btn-outline-dark,
body.ec-site .ec-primary-button,
body.ec-site .ec-secondary-button,
body.ec-site .ec-auth-submit,
body.ec-site .ec-book-mini-cart,
body.ec-site .ec-book-card-bottom button,
body.ec-site .ec-order-link,
body.ec-site .ec-catalog-search button,
body.ec-site .ec-directory-search button,
body.ec-site .ec-detail-btn,
body.ec-site .ec-home-request-book-button {
    border-color: var(--ec-wine) !important;
    background: linear-gradient(180deg, #64160f 0%, var(--ec-wine) 100%) !important;
    color: #fff !important;
    font-weight: 700;
}

body.ec-site .btn:hover,
body.ec-site .btn:focus-visible,
body.ec-site .btn-dark:hover,
body.ec-site .btn-outline-dark:hover,
body.ec-site .ec-primary-button:hover,
body.ec-site .ec-secondary-button:hover,
body.ec-site .ec-auth-submit:hover,
body.ec-site .ec-book-mini-cart:hover,
body.ec-site .ec-book-card-bottom button:hover,
body.ec-site .ec-order-link:hover,
body.ec-site .ec-catalog-search button:hover,
body.ec-site .ec-directory-search button:hover,
body.ec-site .ec-detail-btn:hover,
body.ec-site .ec-home-request-book-button:hover {
    border-color: var(--ec-wine-dark) !important;
    background: var(--ec-wine-dark) !important;
    color: #fff !important;
}

body.ec-site .ec-text-button.ec-danger {
    border: 1px solid var(--ec-wine);
    border-radius: 6px;
    background: var(--ec-wine);
    color: #fff;
}

body.ec-site .ec-text-button.ec-danger:hover,
body.ec-site .ec-text-button.ec-danger:focus-visible {
    background: var(--ec-wine-dark);
    color: #fff;
}

body.ec-site .ec-quantity-form {
    border-color: var(--ec-wine);
    background: #fff;
}

body.ec-site .ec-quantity-form button,
body.ec-site .ec-detail-qty-box .ec-qty-step {
    background: var(--ec-wine);
    color: #fff;
}

body.ec-site .ec-quantity-form button:hover,
body.ec-site .ec-detail-qty-box .ec-qty-step:hover {
    background: var(--ec-wine-dark);
    color: #fff;
}

/* Los corazones son controles de icono: visibles vino sobre blanco y blancos al activar. */
body.ec-site .ec-favorite-button {
    border-color: rgba(48, 4, 6, .22) !important;
    background: rgba(255, 255, 255, .96) !important;
    color: var(--ec-wine) !important;
}

body.ec-site .ec-favorite-button:hover,
body.ec-site .ec-favorite-button:focus-visible,
body.ec-site .ec-favorite-button.is-favorite {
    border-color: var(--ec-wine) !important;
    background: var(--ec-wine) !important;
    color: #fff !important;
}

/* Pie original en vino profundo. */
body.ec-site .ec-store-footer {
    background: var(--ec-wine);
    color: #fff8f0;
}

body.ec-site .ec-store-footer h2 {
    color: #fff8f0;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
}

body.ec-site .ec-store-footer p,
body.ec-site .ec-store-footer a {
    color: rgba(255, 248, 240, .82);
    font-weight: 400;
}

body.ec-site .ec-store-footer a:hover,
body.ec-site .ec-store-footer a:focus-visible {
    color: #fff;
}

/* Contraste obligatorio en las pautas y llamados con fondo oscuro. */
body.ec-site .ec-home-promo-card.is-wine .ec-home-promo-copy h3,
body.ec-site .ec-home-promo-card.is-wine .ec-home-promo-copy p,
body.ec-site .ec-home-promo-card.is-wine .ec-home-promo-copy a,
body.ec-site .ec-home-promo-card.is-ink .ec-home-promo-copy h3,
body.ec-site .ec-home-promo-card.is-ink .ec-home-promo-copy p,
body.ec-site .ec-home-promo-card.is-ink .ec-home-promo-copy a,
body.ec-site .ec-home-club-card h3,
body.ec-site .ec-home-club-card p,
body.ec-site .ec-home-club-card a {
    color: #fff8f0 !important;
}

/* Selector claro para las tres formas de pago. */
body.ec-site .ec-payment-methods {
    display: grid;
    gap: 10px;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
}

body.ec-site .ec-payment-methods legend {
    float: none;
    width: 100%;
    margin: 0 0 2px;
    padding: 0;
    color: var(--ec-ink);
    font-size: 13px;
    font-weight: 700;
}

body.ec-site .ec-payment-methods .ec-payment-method {
    position: relative;
    display: grid;
    grid-template-columns: 20px 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body.ec-site .ec-payment-methods .ec-payment-method:has(input:checked) {
    border-color: var(--ec-wine);
    background: #fff9f6;
    box-shadow: 0 0 0 3px rgba(48, 4, 6, .08);
}

body.ec-site .ec-payment-methods .ec-payment-method > input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--ec-wine);
}

body.ec-site .ec-payment-methods .ec-payment-method > span {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: inherit;
    font-weight: inherit;
}

body.ec-site .ec-payment-methods .ec-payment-method .ec-payment-method-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ec-wine);
    background: var(--ec-sand);
}

body.ec-site .ec-payment-method-icon .ec-icon {
    width: 20px;
    height: 20px;
}

body.ec-site .ec-payment-method strong,
body.ec-site .ec-payment-method small {
    display: block;
}

body.ec-site .ec-payment-method strong {
    color: var(--ec-ink);
    font-size: 13px;
}

body.ec-site .ec-payment-method small {
    margin-top: 3px;
    color: var(--ec-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
}

body.ec-site .ec-payment-method small a {
    color: var(--ec-wine);
    font-weight: 700;
    text-decoration: underline;
}

body.ec-site .ec-payment-methods .ec-payment-method.is-locked {
    grid-template-columns: 40px minmax(0, 1fr);
    cursor: default;
    opacity: .68;
    background: var(--ec-card);
}

@media (max-width: 930px) {
    body.ec-site .ec-header-main {
        padding-block: 12px;
    }
}

@media (max-width: 680px) {
    body.ec-site .ec-header-main {
        min-height: 72px;
    }

    body.ec-site .ec-brand img {
        width: 150px;
    }
}

/* 1.0.97: confirmación de última unidad solo en el detalle del libro. */
body.ec-site .ec-detail-stock-confirmation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 20px 22px;
    border: 1px solid #9bdfb2;
    border-radius: 18px;
    background: linear-gradient(135deg, #f3fff7 0%, #fffdfa 100%);
    box-shadow: 0 12px 28px rgba(26, 128, 71, .08);
}

body.ec-site .ec-detail-stock-confirmation-copy {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-width: 0;
}

body.ec-site .ec-detail-stock-confirmation-icon {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #128c4a;
    background: rgba(37, 211, 102, .13);
}

body.ec-site .ec-detail-stock-confirmation-icon .ec-icon {
    width: 22px;
    height: 22px;
}

body.ec-site .ec-detail-stock-confirmation-kicker {
    display: block;
    margin-bottom: 3px;
    color: #397256;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

body.ec-site .ec-detail-stock-confirmation-copy strong {
    display: block;
    color: var(--ec-ink);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 18px;
    line-height: 1.3;
}

body.ec-site .ec-detail-stock-confirmation-copy p {
    margin: 6px 0 0;
    color: #536158;
    font-size: 13px;
    line-height: 1.5;
}

body.ec-site .ec-checkout-discount,
body.ec-site .ec-checkout-discount strong {
    color: #207648;
}

/* 1.0.98: la búsqueda abre directamente el bloque de resultados. */
body.ec-site .ec-search-results-target {
    scroll-margin-top: 24px;
    outline: none;
}

@media (max-width: 680px) {
    body.ec-site .ec-search-results-target {
        scroll-margin-top: 12px;
    }

    body.ec-site .ec-detail-stock-confirmation {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
        border-radius: 16px;
    }

    body.ec-site .ec-detail-stock-confirmation .ec-detail-btn-order {
        width: 100%;
    }
}

/* 1.0.92: dos libros por fila en todas las vitrinas móviles. */
@media (max-width: 680px) {
    body.ec-site .ec-catalog-grid,
    body.ec-site .ec-favorites-grid,
    body.ec-site .ec-entity-books,
    body.ec-site .ec-store-shelf-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        align-items: stretch;
    }

    body.ec-site .ec-catalog-grid > .ec-book-card,
    body.ec-site .ec-favorites-grid > .ec-book-card,
    body.ec-site .ec-entity-books > .ec-book-card,
    body.ec-site .ec-store-shelf-grid > .ec-book-card-compact-shop {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
    }
}
