/* Correcciones de FAQ y de las fichas 1/2/3/4 en paletas alternativas.
 * Nunca afectar el diseño actual: se habilita exclusivamente al seleccionar
 * Rosa, Oscuro, Boutique o una personalización basada en dichas paletas.
 * Cargar DESPUÉS de las hojas de las fichas para evitar los fondos #fff y
 * botones #000 fijados por las plantillas Atlas / TeamPoint.
 */

/* PREGUNTAS FRECUENTES: panel, filas, enlaces y bordes del tema elegido. */
html.appearance-palette-complete body #storeFaqSection {
    background-color: var(--palette-page) !important;
    color: var(--palette-text) !important;
}
html.appearance-palette-complete body #storeFaqSection .store-faq-panel {
    background: var(--palette-surface) !important;
    color: var(--palette-text) !important;
    border: 1px solid var(--palette-border) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}
html.appearance-palette-complete[data-appearance-palette-mode="dark"] body #storeFaqSection .store-faq-panel {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}
html.appearance-palette-complete body #storeFaqSection :is(.store-faq-list, .store-faq-item) {
    background: transparent !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body #storeFaqSection :is(.store-faq-heading, .store-faq-item > summary) {
    color: var(--palette-text) !important;
}
html.appearance-palette-complete body #storeFaqSection :is(.store-faq-intro, .store-faq-answer) {
    color: var(--palette-muted) !important;
}
html.appearance-palette-complete body #storeFaqSection :is(.store-faq-icon, .store-faq-answer a, .store-faq-link) {
    color: var(--palette-accent) !important;
}
html.appearance-palette-complete body #storeFaqSection .store-faq-item > summary:focus-visible {
    outline-color: var(--palette-accent) !important;
}

/* CONTENEDORES DE FICHA: el diseño 4 volvía a pintar el fondo de blanco,
 * dejando títulos blancos invisibles cuando se seleccionaba el tema oscuro. */
html.appearance-palette-complete body.product-detail-open #productDetail.product-detail-section.active,
html.appearance-palette-complete body.product-detail-open #productDetail > .product-detail-card,
html.appearance-palette-complete body.product-detail-open #productDetail .product-detail-info,
html.appearance-palette-complete body.product-detail-open #productDetail .teampoint-detail-accordions {
    background-color: var(--palette-page) !important;
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .product-detail-title, .product-description, .detail-description-heading,
    .detail-description-toggle, .detail-block-title, .detail-purchase-title,
    .detail-size-heading-row, .detail-size-heading-row .detail-block-title,
    .teampoint-color-label, .teampoint-color-variant, .product-reviews-head h2,
    .atlas-reviews-heading, .atlas-mini-review, .atlas-info-accordion summary
) {
    color: var(--palette-text) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .detail-breadcrumb, .detail-breadcrumb button, .detail-breadcrumb i,
    .teampoint-breadcrumb-category, #detailBreadcrumbName, .size-help,
    .teampoint-installments, .atlas-normal-price-label,
    .atlas-transfer-primary span, .atlas-accordion-body,
    .atlas-shipping-callout p, .atlas-mini-review-date
) {
    color: var(--palette-muted) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .product-detail-price .price-new, .atlas-transfer-primary strong
) {
    color: var(--palette-price) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .product-detail-price .price-old, .atlas-regular-price-row .price-old
) {
    color: var(--palette-muted) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .product-detail-price .price-off, .product-detail-transfer,
    .teampoint-product-promotion strong
) {
    color: var(--palette-discount) !important;
}
/* En el Diseño 4, el beneficio de envío gratis sigue en verde con cualquier paleta. */
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail .teampoint-shipping-highlight strong {
    color: #198754 !important;
}

/* Galería, miniaturas y botones auxiliares. Se mantiene el tamaño y orden. */
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .detail-gallery-column, .product-detail-image, .atlas-detail-aside
) {
    background-color: var(--palette-image) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .detail-thumb, .detail-thumb-more, .detail-gallery-arrow,
    .product-size-guide-trigger, .detail-description-toggle,
    .size-guide-trigger, .atlas-gallery-thumbs
) {
    background-color: var(--palette-surface) !important;
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .detail-quantity, .detail-quantity button, .detail-quantity output, #detailQtyValue
) {
    background-color: var(--palette-surface) !important;
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .size-option:not(.active):not(:disabled), .detail-size-required-notice,
    .atlas-info-accordion, .atlas-price-box, .atlas-shipping-callout,
    .teampoint-shipping-highlight, .teampoint-product-promotion,
    .teampoint-info-accordion, .teampoint-accordion-content, .atlas-trust-strip,
    .atlas-payment-methods, .atlas-mini-review
) {
    background-color: var(--palette-surface) !important;
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail .size-option.active:not(:disabled) {
    background-color: var(--palette-button) !important;
    color: var(--palette-button-text) !important;
    border-color: var(--style-button-border-color) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail .size-option:disabled,
html.appearance-palette-complete body.product-detail-open #productDetail .size-option.sold-out {
    background-color: var(--style-button-disabled-bg) !important;
    color: var(--style-button-disabled-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .teampoint-info-accordion summary, .teampoint-accordion-content,
    .teampoint-info-accordion svg, .teampoint-line-icon, .atlas-trust-label,
    .atlas-trust-strip i, .atlas-shipping-callout strong
) {
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail :is(
    .detail-size-section, .detail-purchase-section, .detail-size-heading-row,
    .teampoint-info-accordion, .atlas-info-accordion, .atlas-regular-price-row
) {
    border-color: var(--palette-border) !important;
}

/* Compra: las fichas 1, 2 y 4 imponían negro incluso sobre las paletas rosa
 * y crema. Estas reglas ganan también ante los !important de TeamPoint. */
html.appearance-palette-complete body.product-detail-open #productDetail #detailAddToCart:not(:disabled),
html.appearance-palette-complete body.product-detail-open #productDetail #detailAddToCart:not(:disabled):is(:hover, :focus, :active) {
    background-color: var(--palette-button) !important;
    color: var(--palette-button-text) !important;
    border-color: var(--style-button-border-color) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail #detailAddToCart:not(:disabled):is(:hover, :focus-visible) {
    background-color: var(--style-button-hover-bg) !important;
    color: var(--style-button-hover-text) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail #detailAddToCart:disabled {
    background-color: var(--style-button-disabled-bg) !important;
    color: var(--style-button-disabled-text) !important;
    border-color: var(--palette-border) !important;
}
html.appearance-palette-complete body.product-detail-open #productDetail #detailBackToProducts {
    background-color: var(--palette-surface) !important;
    color: var(--palette-text) !important;
    border-color: var(--palette-border) !important;
}

/* Diseño 4: especificidad adicional para ganar al último CSS específico y
 * corregir también el texto en los acordeones, precios y variantes. */
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail.product-detail-section.active,
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail .product-detail-info,
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail .teampoint-detail-accordions {
    background: var(--palette-page) !important;
    color: var(--palette-text) !important;
}
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail :is(
    .teampoint-info-accordion, .teampoint-info-accordion summary
) {
    background: var(--palette-surface) !important;
    color: var(--palette-text) !important;
}
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail :is(
    .product-detail-price .price-new, .product-detail-price .price-old
) {
    color: var(--palette-price) !important;
}
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail .product-detail-price .price-old {
    color: var(--palette-muted) !important;
}
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail #detailAddToCart:not(:disabled),
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail #detailAddToCart:not(:disabled):is(:hover, :focus, :active) {
    background: var(--palette-button) !important;
    color: var(--palette-button-text) !important;
    border-color: var(--style-button-border-color) !important;
}
html.appearance-palette-complete[data-product-detail-layout="teampoint"] body.product-detail-open #productDetail #detailAddToCart:not(:disabled):is(:hover, :focus-visible) {
    background: var(--style-button-hover-bg) !important;
    color: var(--style-button-hover-text) !important;
}

@media (max-width: 900px) {
    /* Evitar recortes de títulos, respuestas y controles en teléfonos chicos. */
    html.appearance-palette-complete body #storeFaqSection .store-faq-item > summary { min-width: 0; overflow-wrap: anywhere; }
    html.appearance-palette-complete body #storeFaqSection .store-faq-answer { min-width: 0; overflow-wrap: anywhere; }
    html.appearance-palette-complete body.product-detail-open #productDetail .product-detail-info { min-width: 0; }
}
