/* 
 * Accesibilidad: Widget Horizontal y Temas 
 */

:root {
    --a11y-text-scale: 1;
}

/* ── ESTILOS DEL WIDGET HORIZONTAL (INLINE) ── */
.aby-a11y-widget {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    background: #f5f5f5;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    gap: 12px;
    border: 1px solid #e5e7eb;
    max-width: 100%;
    overflow-x: auto;
}

.aby-a11y-divider {
    width: 1px;
    height: 24px;
    background-color: #e5e7eb;
}

.aby-a11y-controls {
    display: flex;
    gap: 6px;
}

.aby-a11y-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 10px;
    font-size: 0.9rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aby-a11y-btn:hover {
    color: #111827;
    background-color: #e5e7eb;
}

.aby-a11y-btn[aria-pressed="true"] {
    background: var(--aby-green);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Overrides para modo oscuro del widget en sí */
html[data-a11y-theme="dark"] .aby-a11y-widget {
    background: #1a1a1a;
    border-color: #333333;
    box-shadow: none;
}
html[data-a11y-theme="dark"] .aby-a11y-divider {
    background-color: #333333;
}
html[data-a11y-theme="dark"] .aby-a11y-btn {
    color: #a0a0a0;
}
html[data-a11y-theme="dark"] .aby-a11y-btn:hover {
    color: #ffffff;
    background-color: #333333;
}
html[data-a11y-theme="dark"] .aby-a11y-btn[aria-pressed="true"] {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Tamaños de fuente botones */
.aby-a11y-size-controls .aby-a11y-btn:nth-child(1) { font-size: 0.85rem; }
.aby-a11y-size-controls .aby-a11y-btn:nth-child(2) { font-size: 1rem; }
.aby-a11y-size-controls .aby-a11y-btn:nth-child(3) { font-size: 1.15rem; }

/* Temas botones */
.aby-a11y-theme-controls .aby-theme-normal[aria-pressed="true"] { background: var(--aby-gray-800); color: var(--aby-white); }
.aby-a11y-theme-controls .aby-theme-sepia[aria-pressed="true"] { background: #D4B06A; color: #2B2B2B; }
.aby-a11y-theme-controls .aby-theme-dark[aria-pressed="true"] { background: #121212; color: #E0E0E0; border: 1px solid #404040; }


/* ── APLICACIÓN DE TEMAS A NIVEL GLOBAL ── */

/* Modo Oscuro / Alto Contraste */
html[data-a11y-theme="dark"] {
    --aby-bg-color: #121212;
    --aby-gray-100: #1a1a1a;
    --aby-gray-200: #2d2d2d;
    --aby-gray-300: #404040;
    --aby-gray-600: #a0a0a0;
    --aby-gray-800: #E0E0E0;
    --aby-black: #ffffff;
    --aby-white: #1e1e1e;
    --aby-cream: #181818;
    --aby-cream-deep: #222222;
    background-color: var(--aby-bg-color);
    color: var(--aby-gray-800);
}

/* Modo Lectura Cálido (Sepia) */
html[data-a11y-theme="sepia"] {
    --aby-bg-color: #FBF0D9;
    --aby-gray-100: #FFF8E7;
    --aby-gray-200: #E8DCC4;
    --aby-gray-800: #2B2B2B;
    --aby-black: #1A1A1A;
    --aby-white: #FFFBF0;
    --aby-cream: #FFF5DD;
    --aby-cream-deep: #F0E3CB;
    background-color: var(--aby-bg-color);
    color: var(--aby-gray-800);
}

/* Ajustes comunes para temas */
html[data-a11y-theme="dark"] h1, html[data-a11y-theme="dark"] h2, html[data-a11y-theme="dark"] h3, 
html[data-a11y-theme="dark"] h4, html[data-a11y-theme="dark"] h5, html[data-a11y-theme="dark"] h6,
html[data-a11y-theme="sepia"] h1, html[data-a11y-theme="sepia"] h2, html[data-a11y-theme="sepia"] h3, 
html[data-a11y-theme="sepia"] h4, html[data-a11y-theme="sepia"] h5, html[data-a11y-theme="sepia"] h6 {
    color: var(--aby-gray-800);
}

html[data-a11y-theme="dark"] .btn-primary,
html[data-a11y-theme="sepia"] .btn-primary,
html[data-a11y-theme="dark"] .aby-atc-btn,
html[data-a11y-theme="sepia"] .aby-atc-btn {
    color: #ffffff; 
}
html[data-a11y-theme="sepia"] .btn-primary, html[data-a11y-theme="sepia"] .aby-atc-btn {
    background-color: var(--aby-green);
}

/* ====================================================
   CORRECCIONES DE MODO OSCURO (CONTRASTE)
   ==================================================== */

/* 1. Blockquotes (Citas) en Modo Oscuro */
html[data-a11y-theme="dark"] blockquote,
html[data-a11y-theme="dark"] blockquote p,
html[data-a11y-theme="dark"] .wp-block-quote,
html[data-a11y-theme="dark"] .wp-block-quote p {
    color: var(--aby-gray-800) !important;
}

/* 2. Tablas en Modo Oscuro */
html[data-a11y-theme="dark"] table,
html[data-a11y-theme="dark"] table td,
html[data-a11y-theme="dark"] table th {
    background-color: var(--aby-bg-color) !important;
    color: var(--aby-gray-800) !important;
    border-color: var(--aby-gray-300) !important;
}
html[data-a11y-theme="dark"] table th {
    background-color: var(--aby-gray-100) !important;
}
/* Forzar que el texto no se vea invisible (blanco sobre blanco/gris claro) */
html[data-a11y-theme="dark"] table tbody td {
    color: var(--aby-gray-800) !important;
    background-color: transparent !important;
}

/* 3. Fichas de Producto (Tarjetas) y Artículos en Modo Oscuro */
html[data-a11y-theme="dark"] .aby-product-card,
html[data-a11y-theme="dark"] .summary.entry-summary,
html[data-a11y-theme="dark"] .woocommerce-product-gallery {
    background-color: var(--aby-bg-color) !important;
    color: var(--aby-gray-800) !important;
    border-color: var(--aby-gray-300) !important;
}
html[data-a11y-theme="dark"] .aby-product-card h2,
html[data-a11y-theme="dark"] .aby-product-card h3,
html[data-a11y-theme="dark"] .product_title,
html[data-a11y-theme="dark"] .aby-post-card h3,
html[data-a11y-theme="dark"] .aby-post-card a,
html[data-a11y-theme="dark"] article h3 a,
html[data-a11y-theme="dark"] .related-posts h3 a,
html[data-a11y-theme="dark"] .related-posts a.read-more {
    color: var(--aby-gray-800) !important;
}

/* Fichas de Compra CTA en Blog (Mantienen fondo blanco, texto oscuro) */
html[data-a11y-theme="dark"] .aby-blog-cta-card {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}
html[data-a11y-theme="dark"] .aby-blog-cta-card h4 a,
html[data-a11y-theme="dark"] .aby-blog-cta-card p,
html[data-a11y-theme="dark"] .aby-blog-cta-card li,
html[data-a11y-theme="dark"] .aby-blog-cta-card .aby-blog-cta-shipping,
html[data-a11y-theme="dark"] .aby-blog-cta-card .aby-blog-cta-price bdi,
html[data-a11y-theme="dark"] .aby-blog-cta-card .aby-blog-cta-link-secondary {
    color: #1a1a1a !important;
}

/* Resumen del Artículo (Mantienen fondo blanco, texto oscuro) */
html[data-a11y-theme="dark"] .article-quick-answer {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}
html[data-a11y-theme="dark"] .article-quick-answer p {
    color: #1a1a1a !important;
}

/* Cajas verdes (Callouts) con fondos especiales */
html[data-a11y-theme="dark"] .has-background,
html[data-a11y-theme="dark"] .wp-block-cover,
html[data-a11y-theme="dark"] .aby-box {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .has-background h1,
html[data-a11y-theme="dark"] .has-background h2,
html[data-a11y-theme="dark"] .has-background h3,
html[data-a11y-theme="dark"] .has-background h4,
html[data-a11y-theme="dark"] .has-background p,
html[data-a11y-theme="dark"] .wp-block-cover h1,
html[data-a11y-theme="dark"] .wp-block-cover h2,
html[data-a11y-theme="dark"] .wp-block-cover h3,
html[data-a11y-theme="dark"] .wp-block-cover p,
html[data-a11y-theme="dark"] .aby-box h2,
html[data-a11y-theme="dark"] .aby-box h3,
html[data-a11y-theme="dark"] .aby-box p,
html[data-a11y-theme="dark"] .cta-dynamic-editorial,
html[data-a11y-theme="dark"] .cta-dynamic-editorial h2,
html[data-a11y-theme="dark"] .cta-dynamic-editorial p {
    color: #ffffff !important;
}

/* Pie de página inferior (Fondo blanco, texto oscuro) */
html[data-a11y-theme="dark"] .footer-bottom {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}
html[data-a11y-theme="dark"] .footer-bottom p,
html[data-a11y-theme="dark"] .footer-bottom span,
html[data-a11y-theme="dark"] .footer-bottom .payment-method-title,
html[data-a11y-theme="dark"] .footer-bottom .pay-badge,
html[data-a11y-theme="dark"] .footer-bottom .payment-gateway-note,
html[data-a11y-theme="dark"] .footer-bottom .footer-seo-text,
html[data-a11y-theme="dark"] .footer-bottom .copyright {
    color: #1a1a1a !important;
}

/* Corregir breadcrumb y meta info en la cabecera (verde) */
html[data-a11y-theme="dark"] .shop-hero__desc,
html[data-a11y-theme="dark"] .single-meta-info,
html[data-a11y-theme="dark"] .single-meta-info span,
html[data-a11y-theme="dark"] .shop-breadcrumb__sep {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ── APLICACIÓN DE ESCALA DE TEXTO ── */
.single-post .entry-content,
.single-product .woocommerce-Tabs-panel,
.single-product .woocommerce-product-details__short-description {
    font-size: calc(1rem * var(--a11y-text-scale));
    line-height: calc(1.6 * var(--a11y-text-scale));
}

/* ==========================================================================
   WOOCOMMERCE SINGLE PRODUCT PAGE - DARK MODE OVERRIDES
   ========================================================================== */

/* 1. Breadcrumb */
html[data-a11y-theme="dark"] .product-breadcrumb-fullwidth,
html[data-a11y-theme="dark"] .product-breadcrumb-bar,
html[data-a11y-theme="dark"] .product-breadcrumb-inner {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .product-breadcrumb-inner a,
html[data-a11y-theme="dark"] .product-breadcrumb__sep,
html[data-a11y-theme="dark"] .product-breadcrumb__item {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 2. Tarjeta de Resumen (Precios, Título) */
html[data-a11y-theme="dark"] .product-summary-card {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}
html[data-a11y-theme="dark"] .woocommerce div.product .summary .product_title,
html[data-a11y-theme="dark"] .woocommerce div.product .summary .price,
html[data-a11y-theme="dark"] .woocommerce div.product .summary .price span.amount {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .product_meta,
html[data-a11y-theme="dark"] .product_meta a,
html[data-a11y-theme="dark"] .product_meta span {
    color: #a0a0a0 !important;
}
html[data-a11y-theme="dark"] .woocommerce-product-details__short-description {
    color: #d1d5db !important;
}

/* 3. Selector de Cantidad */
html[data-a11y-theme="dark"] .quantity input.qty {
    background-color: #121212 !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

/* 4. Trust Module */
html[data-a11y-theme="dark"] .product-trust-module {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] .trust-text-box strong {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .trust-text-box span {
    color: #a0a0a0 !important;
}

/* 5. Módulo Tiered Pricing (Si aplica) */
html[data-a11y-theme="dark"] .tp-card {
    background-color: #121212 !important;
    border-color: #333333 !important;
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .tp-card--featured {
    background-color: #1f2937 !important;
    border-color: var(--aby-gold) !important;
}
html[data-a11y-theme="dark"] .tp-selector__title,
html[data-a11y-theme="dark"] .tp-card-title,
html[data-a11y-theme="dark"] .tp-price-main {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .tp-savings-badge {
    color: #ffffff !important;
}

/* 6. Pestañas (Tabs) */
html[data-a11y-theme="dark"] .woocommerce-tabs .tabs {
    border-bottom-color: #333333 !important;
}
html[data-a11y-theme="dark"] .woocommerce-tabs ul.tabs li {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] .woocommerce-tabs ul.tabs li a {
    color: #a0a0a0 !important;
}
html[data-a11y-theme="dark"] .woocommerce-tabs ul.tabs li.active {
    background-color: #121212 !important;
    border-bottom-color: #121212 !important;
}
html[data-a11y-theme="dark"] .woocommerce-tabs ul.tabs li.active a {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .woocommerce-Tabs-panel {
    color: #d1d5db !important;
}
html[data-a11y-theme="dark"] .woocommerce-Tabs-panel h2 {
    color: #ffffff !important;
}

/* Tablas de Atributos */
html[data-a11y-theme="dark"] .woocommerce table.shop_attributes th {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] .woocommerce table.shop_attributes td {
    background-color: #1a1a1a !important;
    color: #d1d5db !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] .woocommerce table.shop_attributes tr:nth-child(even) td,
html[data-a11y-theme="dark"] .woocommerce table.shop_attributes tr:nth-child(even) th {
    background-color: #121212 !important;
}

/* 7. Reseñas (Reviews) */
html[data-a11y-theme="dark"] #reviews #comments ol.commentlist li .comment_container {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] #reviews #comments ol.commentlist li .meta {
    color: #a0a0a0 !important;
}
html[data-a11y-theme="dark"] #reviews #comments ol.commentlist li .meta strong {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] #reviews #comments ol.commentlist li .description {
    color: #d1d5db !important;
}
html[data-a11y-theme="dark"] .woocommerce .star-rating span::before,
html[data-a11y-theme="dark"] .woocommerce .star-rating::before {
    color: var(--aby-gold) !important;
}
/* Formulario de Reseñas */
html[data-a11y-theme="dark"] #review_form #respond {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] #review_form #respond input[type="text"],
html[data-a11y-theme="dark"] #review_form #respond input[type="email"],
html[data-a11y-theme="dark"] #review_form #respond textarea {
    background-color: #121212 !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}
html[data-a11y-theme="dark"] #review_form #respond label {
    color: #d1d5db !important;
}

/* 8. Productos Relacionados */
html[data-a11y-theme="dark"] .related.products h2 {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .woocommerce ul.products li.product {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
}
html[data-a11y-theme="dark"] .woocommerce ul.products li.product .woocommerce-loop-product__title {
    color: #ffffff !important;
}
html[data-a11y-theme="dark"] .woocommerce ul.products li.product .price {
    color: var(--aby-gold) !important;
}

/* ── NUEVOS ESTILOS DEL TOOLBAR (WIDGET + SOCIAL) ── */
.aby-article-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: #fcfcfc;
    border-radius: var(--radius-md, 8px);
    padding: 8px 16px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
    gap: 15px;
}

/* Modificadores para achicar el widget dentro del toolbar */
.aby-a11y-widget.aby-a11y-compact {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}
.aby-a11y-compact .aby-a11y-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}
.aby-a11y-compact .aby-a11y-divider {
    height: 18px;
}

/* Redes de Compartir */
.aby-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.aby-share-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.share-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}
.share-btn.share-wa:hover { background: #25D366; }
.share-btn.share-fb:hover { background: #1877F2; }
.share-btn.share-email:hover { background: #ea4335; }
.share-btn.share-link:hover { background: #4b5563; }

/* Soporte Tema Oscuro para Toolbar */
html[data-a11y-theme="dark"] .aby-article-toolbar {
    background: #1a1a1a;
    border-color: #333;
}
html[data-a11y-theme="dark"] .aby-share-label {
    color: #9ca3af;
}
html[data-a11y-theme="dark"] .share-btn {
    background: #2d2d2d;
    color: #d1d5db;
}

/* Responsividad */
@media (max-width: 600px) {
    .aby-article-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .aby-a11y-widget.aby-a11y-compact {
        width: 100%;
        justify-content: space-between;
    }
}
.share-btn.share-x:hover { background: #000000; }
html[data-a11y-theme="dark"] .share-btn.share-x:hover { background: #ffffff; color: #000000; }
