/* ===== Ficha de producto SCP ===== */

.scp-single-product {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 24px 36px;
    margin-bottom: 40px;
}

/* Anular grid/float legacy de WooCommerce en ficha SCP */
.woocommerce div.product.scp-single-product {
    display: block !important;
    padding: 28px 24px 36px;
}

.woocommerce div.product.scp-single-product > * {
    width: 100%;
    max-width: 100%;
    float: none;
    clear: both;
}

.woocommerce div.product.scp-single-product div.images,
.woocommerce div.product.scp-single-product div.summary,
.woocommerce div.product.scp-single-product .summary {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    clear: none !important;
}

.scp-single-product__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 48px;
    align-items: start;
    width: 100%;
}

.scp-single-product__gallery-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.scp-single-product__gallery-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}

.scp-single-product__gallery-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
    max-width: 42%;
}

.scp-single-product__gallery-badges a,
.scp-single-product__gallery-badges .scp-envio-gratis {
    pointer-events: auto;
}

.scp-oferta-icon img {
    height: 72px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.scp-single-product__gallery-badges .offer-card__fire--product {
    position: static;
    line-height: 1;
    pointer-events: none;
}

.scp-single-product__gallery-badges .offer-card__fire--product .offer-card__fire-emoji {
    font-size: 2.75rem;
    filter: drop-shadow(0 2px 6px rgba(255, 90, 0, 0.35));
}

.scp-single-product__gallery-badges .offer-card__fire--animate .offer-card__fire-emoji {
    animation: scpnew-fire-emoji-flicker 1.75s ease-in-out infinite;
    transform-origin: center bottom;
}

@media (prefers-reduced-motion: reduce) {
    .scp-single-product__gallery-badges .offer-card__fire--animate .offer-card__fire-emoji {
        animation: none;
    }
}

.scp-single-product__gallery-badges .scp-envio-gratis img {
    height: 72px !important;
    width: auto !important;
    max-width: 100%;
}

/* Contenedor cuadrado 1:1 — la foto llena todo con cover */
.scp-single-product__gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    border: 1px solid #ececf0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.scp-single-product__gallery .woocommerce-product-gallery,
.scp-single-product__gallery .woocommerce-product-gallery.images {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    float: none !important;
}

.scp-single-product__gallery .woocommerce-product-gallery__wrapper,
.scp-single-product__gallery .flex-viewport {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.scp-single-product__gallery .woocommerce-product-gallery__image,
.scp-single-product__gallery .woocommerce-product-gallery__image--placeholder {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: transparent;
    float: none !important;
}

.scp-single-product__gallery .woocommerce-product-gallery__image a {
    display: block;
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.scp-single-product__gallery .woocommerce-product-gallery__image img,
.scp-single-product__gallery .flex-viewport img,
.scp-single-product__gallery .woocommerce-product-gallery__image--placeholder img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center;
    margin: 0 !important;
    padding: 0 !important;
    border: none;
    display: block;
    box-sizing: border-box;
}

.scp-single-product__summary {
    min-width: 0;
    width: 100%;
    max-width: none;
}

.scp-related-products {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid #e8e8e8;
    width: 100%;
    clear: both;
}

.scp-related-products__title {
    margin: 0 0 20px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a2e;
}

.scp-related-products__grid {
    margin: 0;
}

/* Ocultar relacionados WooCommerce por defecto si aparecen */
.scp-single-product .related.products {
    display: none !important;
}

.scp-single-product__img-note {
    margin: 14px 0 20px;
    padding: 0 12px;
    font-size: 0.72rem;
    color: #888;
    line-height: 1.45;
    text-align: center;
}

.scp-single-product__desc-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px 24px;
    align-items: start;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.scp-single-product__desc-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #6b21a8;
}

.scp-single-product__description {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #444;
}

.scp-single-product__fabricante {
    min-width: 160px;
}

.scp-single-product__price-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 20px;
    align-items: start;
    margin-bottom: 16px;
}

.scp-single-product__price-col .scp-single-product__price-label {
    display: block;
    margin-bottom: 6px;
}

.scp-single-product__price-note {
    margin: 0;
    font-size: 0.72rem;
    color: #777;
    max-width: 200px;
    line-height: 1.35;
    text-align: right;
}

.scp-single-product__price-sep {
    border: none;
    border-top: 1px solid #e5e5ea;
    margin: 18px 0 16px;
}

.scp-single-product__lista-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 20px;
    align-items: center;
    width: 100%;
}

.scp-single-product__lista-precio {
    display: block;
    min-width: 0;
}

.scp-precio-lista--ficha {
    display: block !important;
    visibility: visible !important;
}

.scp-precio-lista--ficha .scp-precio-lista__amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-top: 4px;
}

.scp-single-product__lista-financing {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: auto;
    flex-shrink: 0;
}

/* Botón que abre el popup */
.scp-financing-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid #6b21a8;
    border-radius: 8px;
    background: #ffffff;
    color: #6b21a8 !important;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.scp-financing-open-btn:hover {
    background: #f3e8ff;
    color: #581c87 !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.15);
}

.scp-financing-open-btn__icon {
    display: inline-flex;
    flex-shrink: 0;
}

/* ===== Modal planes de financiación ===== */
body.scp-financing-modal-open {
    overflow: hidden;
}

.scp-financing-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.scp-financing-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scp-financing-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 30, 0.72);
}

.scp-financing-modal__dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}

.scp-financing-modal.is-open .scp-financing-modal__dialog {
    transform: translateY(0) scale(1);
}

.scp-financing-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: linear-gradient(90deg, #7c3aed 0%, #6b21a8 100%);
    color: #ffffff;
}

.scp-financing-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scp-financing-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.scp-financing-modal__close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: none;
}

.scp-financing-modal__body {
    padding: 20px;
    background: #12121f;
    overflow-y: auto;
}

.scp-financing-modal__grid {
    display: grid;
    gap: 16px;
    align-items: stretch;
}

/* 1 medio de pago = ancho completo; 2 = dos columnas */
.scp-financing-modal__grid--1 {
    grid-template-columns: 1fr;
}

.scp-financing-modal__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scp-financing-modal__col {
    border-radius: 10px;
    padding: 14px;
    min-width: 0;
}

.scp-financing-modal__col--mp {
    border: 1px solid #38bdf8;
    background: rgba(56, 189, 248, 0.06);
}

.scp-financing-modal__col--banks {
    border: 1px solid #a855f7;
    background: rgba(168, 85, 247, 0.06);
}

.scp-financing-modal__col-label {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.scp-financing-modal__col--mp .scp-financing-modal__col-label {
    color: #bae6fd;
}

.scp-financing-modal__col--banks .scp-financing-modal__col-label {
    color: #e9d5ff;
}

.scp-financing-modal__slot + .scp-financing-modal__slot {
    margin-top: 12px;
}

/* Cuotas MP dentro del modal oscuro (anula estilos inline del plugin) */
.scp-financing-modal .cuotas-mp-financiacion-box {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
}

.scp-financing-modal .cuotas-mp-precio-lista,
.scp-financing-modal .cuotas-mp-header,
.scp-financing-modal .cuotas-mp-subtitulo {
    display: none !important;
}

.scp-financing-modal .cuotas-mp-opciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 !important;
}

.scp-financing-modal .cuotas-mp-opcion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 11px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    font-size: 0.92rem !important;
}

.scp-financing-modal .cuotas-mp-cuotas-num,
.scp-financing-modal .cuotas-mp-x,
.scp-financing-modal .cuotas-mp-cuota-valor,
.scp-financing-modal .cuotas-mp-sin-interes .cuotas-mp-cuotas-num,
.scp-financing-modal .cuotas-mp-con-interes .cuotas-mp-cuotas-num,
.scp-financing-modal .cuotas-mp-sin-interes .cuotas-mp-cuota-valor,
.scp-financing-modal .cuotas-mp-con-interes .cuotas-mp-cuota-valor {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.scp-financing-modal .cuotas-mp-opcion.es-sin-interes .cuotas-mp-cuotas-num,
.scp-financing-modal .cuotas-mp-opcion.es-sin-interes .cuotas-mp-cuota-valor {
    color: #bbf7d0 !important;
}

.scp-financing-modal .cuotas-mp-total-label,
.scp-financing-modal .cuotas-mp-cft,
.scp-financing-modal .cuotas-mp-separador {
    color: #e2e8f0 !important;
    font-size: 0.82rem !important;
}

.scp-financing-modal .cuotas-mp-badge-si {
    background: #22c55e !important;
    color: #ffffff !important;
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.scp-financing-modal .cuotas-mp-nuevo {
    background: #38bdf8 !important;
    color: #0f172a !important;
}

.scp-financing-modal .cuotas-mp-footer {
    margin-top: 14px;
    font-size: 0.78rem !important;
    color: #e2e8f0 !important;
    text-align: left !important;
}

.scp-financing-modal .cuotas-mp-cards {
    margin-top: 14px;
    opacity: 1;
}

.scp-precio-lista__label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a1a2e;
}

.scp-precio-lista__label .scp-price-label__accent,
.scp-precio-lista__label span {
    color: var(--scp-accent, #9333ea);
}

.scp-precio-lista__amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-top: 4px;
}

.scp-single-product__price-block {
    margin-bottom: 20px;
}

.scp-single-product__title {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 14px;
    line-height: 1.25;
}

.scp-single-product__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.scp-pbadge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.scp-pbadge--tag,
.scp-pbadge--web {
    background: #6b21a8;
    color: #ffffff;
}

.scp-pbadge--ok {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.scp-pbadge--sku {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.scp-single-product__price-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
}

.scp-single-product__price-label .scp-price-label__accent {
    color: var(--scp-accent, #9333ea);
}

.scp-single-product__price-value {
    margin-bottom: 6px;
}

.scp-price-main__current,
.scp-price-main__current .amount {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1a1a2e;
}

.scp-price-main--nostock {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1a1a2e;
}

.scp-price-main--sale .scp-price-main__old {
    display: block;
    font-size: 0.95rem;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.scp-single-product__price-tax {
    margin-bottom: 12px;
}

.scp-single-product__price-tax .price-excl-tax {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.55);
}


.scp-single-product__stock-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.scp-stock-card {
    line-height: 1.35;
}

.scp-stock-card__title {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.scp-stock-card__title--ok {
    color: #2e9b32;
}

.scp-stock-card__title--no {
    color: #c11b20;
}

.scp-stock-pill__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.scp-stock-pill--ok {
    background: #65ee67;
}

.scp-stock-pill--no {
    background: #c11b20;
}

.scp-stock-card__note {
    margin: 0;
    font-size: 0.72rem;
    color: #666666;
}

.scp-stock-card__time {
    color: #6b21a8;
}

.scp-single-product__variations .variations_form {
    margin-bottom: 16px;
}

.scp-single-product__variations .single_add_to_cart_button,
.scp-single-product__variations .quantity {
    display: none !important;
}

.scp-buy-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.scp-buy-block__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.scp-buy-block__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1 1 200px;
    min-width: 0;
}

.scp-buy-block__qty {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f4f4f7;
    border: 1px solid #e2e2e8;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Anula estilos globales de button (color blanco invisible en fondo claro) */
.scp-buy-block .scp-buy-block__qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #c9c9d4;
    background: #ffffff;
    color: #6b21a8 !important;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}

.scp-buy-block .scp-buy-block__qty-btn:hover {
    background: #6b21a8;
    border-color: #6b21a8;
    color: #ffffff !important;
    transform: none;
}

.scp-buy-block__qty-label {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
    padding: 0 6px;
    font-size: 0.88rem;
    color: #555;
    white-space: nowrap;
}

.scp-buy-block__qty-input {
    width: 28px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    background: transparent;
    -moz-appearance: textfield;
}

.scp-buy-block__qty-input::-webkit-outer-spin-button,
.scp-buy-block__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scp-buy-block .scp-buy-block__btn {
    border: none;
    border-radius: 10px;
    padding: 14px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    color: #ffffff !important;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.scp-buy-block .scp-buy-block__btn--cart,
.scp-buy-block .scp-buy-block__btn--buy {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

.scp-buy-block .scp-buy-block__btn--cart {
    background: linear-gradient(180deg, #7c3aed 0%, #6b21a8 100%);
    box-shadow: 0 4px 14px rgba(107, 33, 168, 0.35);
}

.scp-buy-block .scp-buy-block__btn--buy {
    background: linear-gradient(180deg, #581c87 0%, #4c1d95 100%);
    box-shadow: 0 4px 12px rgba(76, 29, 149, 0.3);
}

.scp-buy-block .scp-buy-block__btn--cart:hover,
.scp-buy-block .scp-buy-block__btn--buy:hover {
    transform: translateY(-1px);
    color: #ffffff !important;
}

.scp-buy-block .scp-buy-block__btn--cart:hover {
    background: linear-gradient(180deg, #6b21a8 0%, #581c87 100%);
    box-shadow: 0 6px 18px rgba(107, 33, 168, 0.4);
}

.scp-buy-block .scp-buy-block__btn--buy:hover {
    background: linear-gradient(180deg, #4c1d95 0%, #3b0764 100%);
}

.scp-buy-block__error {
    margin: 0;
    font-size: 0.82rem;
    color: #c11b20;
}

.scp-single-product__actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    width: 100%;
}

.scp-single-product__buy,
.scp-single-product__buy .scp-buy-block {
    width: 100%;
    max-width: 100%;
}

.scp-single-product__shipping {
    width: 100%;
    display: block;
    clear: both;
}

.scp-single-product__shipping .ac-shipping-trigger-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.scp-single-product__shipping .ac-shipping-trigger-btn,
.scp-single-product__shipping .button {
    display: inline-block;
}

.scp-single-product__nostock {
    margin-top: 20px;
    width: 100%;
}

.scp-single-product__nostock .ac-stock-alert-form,
.scp-single-product__nostock form[class*="stock"] {
    width: 100%;
    max-width: 420px;
}

.scp-single-product--no-stock .scp-single-product__price-block {
    display: none !important;
}

.scp-single-product__extras {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}

.scp-fabricante-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6b21a8;
    font-weight: 600;
    text-decoration: none;
}

.scp-fabricante-link a:hover {
    text-decoration: underline;
}

.scp-envio-gratis-wrap--cart {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

.scp-envio-gratis-wrap--cart .scp-envio-gratis img {
    height: 28px !important;
    width: auto !important;
}

.scp-envio-gratis img {
    max-width: 100%;
    height: auto;
}

/* Tabs descripción debajo */
.scp-single-product .woocommerce-tabs {
    margin-top: 32px;
    grid-column: 1 / -1;
}

.scp-single-product .woocommerce-tabs .tabs {
    padding: 0;
    margin: 0 0 16px;
    list-style: none;
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e8e8e8;
}

.scp-single-product .woocommerce-tabs .tabs li a {
    display: block;
    padding: 10px 16px;
    font-weight: 700;
    color: #6b21a8;
    text-decoration: none;
}

@media (max-width: 960px) {
    .scp-single-product__grid {
        grid-template-columns: 1fr;
    }

    .scp-single-product__summary {
        max-width: none;
    }


    .scp-single-product__desc-row {
        grid-template-columns: 1fr;
    }

    .scp-single-product__price-row {
        grid-template-columns: 1fr;
    }

    .scp-single-product__price-note {
        text-align: left;
        max-width: none;
    }


    .scp-financing-modal__grid--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .scp-single-product {
        padding: 18px 14px 24px;
    }

    .scp-single-product__stock-row {
        grid-template-columns: 1fr;
    }

    .scp-buy-block__buttons {
        grid-template-columns: 1fr;
        flex: 1 1 100%;
    }
}
