/*
 * Estilos para Single Product Page
 * Archivo: single-product-styles.css
 * Versión: 2.0.0
 * Última actualización: Optimización de orden responsive
 */

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

/**
 * Layout responsive mobile-first optimizado:
 *
 * MÓVIL (< 1025px) - Flexbox con order:
 * 1. Descripción (order: 1)
 * 2. Acciones sociales (order: 2)
 * 3. Sidebar (order: 3)
 * 4. Productos relacionados (order: 4)
 *
 * DESKTOP (≥ 1025px) - CSS Grid de 3 columnas x 2 filas:
 * [Social Sidebar] [Descripción]             [Info Sidebar]
 * [Social Sidebar] [Productos Relacionados]  [Info Sidebar]
 */
.esaico-product-content {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Reducido de 20px a 15px */
    margin-bottom: 30px; /* Reducido de 40px a 30px */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Orden para móvil usando flexbox order */
.esaico-main-column {
    order: 1; /* Descripción primero */
}

.esaico-mobile-social-actions {
    order: 2; /* Acciones sociales segundo */
}

.esaico-sidebar-column {
    order: 3; /* Sidebar tercero */
}

.esaico-related-products-wrapper {
    order: 4; /* Productos relacionados al final */
    width: 100%;
}

/* Desktop: Grid de 3 columnas */
@media (min-width: 1025px) {
    .esaico-product-content {
        display: grid !important;
        grid-template-columns: auto 1fr minmax(300px, 350px);
        grid-template-rows: auto auto;
        gap: 20px;
    }

    /* Columnas en desktop */
    .esaico-product-social-sidebar {
        grid-column: 1;
        grid-row: 1 / 3; /* Ocupa ambas filas */
    }

    .esaico-main-column {
        grid-column: 2;
        grid-row: 1;
        order: unset;
    }

    .esaico-sidebar-column {
        grid-column: 3;
        grid-row: 1 / 3; /* Ocupa ambas filas */
    }

    .esaico-related-products-wrapper {
        grid-column: 2; /* Columna central */
        grid-row: 2; /* Segunda fila */
        order: unset;
    }
}

/* ==========================================================================
   BARRA LATERAL IZQUIERDA - ACCIONES SOCIALES (Desktop)
   ========================================================================== */

.esaico-product-social-sidebar {
    display: none; /* Oculto por defecto en móvil */
}

@media (min-width: 1025px) {
    .esaico-product-social-sidebar {
        display: flex !important;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 20px !important;
        flex-direction: column;
        gap: 16px;
        z-index: 100;
        align-self: start;
    }
}

/* ==========================================================================
   ACCIONES SOCIALES PARA MÓVIL
   ========================================================================== */

/* Mostrado por defecto en móvil, oculto en desktop */
.esaico-mobile-social-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0; /* Eliminado margen - el gap del contenedor padre controla el espaciado */
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1025px) {
    .esaico-mobile-social-actions {
        display: none;
    }
}

/* ==========================================================================
   COMPONENTES DE ACCIONES SOCIALES
   ========================================================================== */

.esaico-like-wrapper {
    display: flex;
    flex-direction: column-reverse; /* Contador encima del icono */
    align-items: center;
    gap: 4px;
}

.esaico-like-count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 20px;
    text-align: center;
    order: -1; /* Asegurar que esté arriba */
}

/* Botones sociales base */
.esaico-social-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.esaico-social-btn:hover {
    background: #fafafa;
    border-color: #1a1a1a;
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.esaico-social-btn:active {
    transform: scale(0.95);
}

.esaico-social-btn svg {
    width: 20px;
    height: 20px;
    stroke: #6b7280;
    transition: all 0.2s ease;
}

.esaico-social-btn:hover svg {
    stroke: #1a1a1a;
}

/* Botón Me Encanta - Estado activo */
.esaico-social-btn.heart-like-btn.liked {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.esaico-social-btn.heart-like-btn.liked svg {
    fill: #ef4444 !important;
    stroke: #ef4444 !important;
}

.esaico-social-btn.heart-like-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.esaico-social-btn.heart-like-btn:hover svg {
    stroke: #ef4444;
}

/* Botón Compartir */
.esaico-social-btn.share-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.esaico-social-btn.share-btn:hover svg {
    stroke: #3b82f6;
}

/* ==========================================================================
   COLUMNA PRINCIPAL
   ========================================================================== */

.esaico-main-column {
    min-width: 0; /* Previene overflow en grid */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* NO usar overflow-x: hidden - NO afecta sticky pero es buena práctica evitarlo */
}

/* ==========================================================================
   SIDEBAR DERECHA
   ========================================================================== */

.esaico-sidebar-column {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1025px) {
    .esaico-sidebar-column {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 20px !important;
        width: auto;
        max-width: 350px;
        align-self: start;
    }
}

/* ==========================================================================
   ESTILOS DEL CARD DEL SIDEBAR
   ========================================================================== */

.esaico-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   CARD HEADER - DISEÑO MODERNO Y MINIMALISTA
   ========================================================================== */

/**
 * Header del card con diseño profesional:
 * - Desktop: Layout horizontal con badges a la izquierda, precio destacado a la derecha
 * - Móvil: Stack vertical centrado para mejor legibilidad
 * - Badges con gradientes sutiles y microinteracciones
 * - Precio con tipografía destacada y efecto visual
 */

.esaico-card-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo sutil */
.esaico-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.esaico-card-header:hover::before {
    left: 100%;
}

.esaico-header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 1;
}

.esaico-price {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: #10b981; /* Fallback color */
    letter-spacing: -0.5px;
    z-index: 1;
    position: relative;
}

.esaico-price .amount,
.esaico-price .amount .woocommerce-Price-amount,
.esaico-price .amount bdi,
.esaico-price .woocommerce-Price-amount,
.esaico-price bdi {
    position: relative;
    z-index: 1;
    color: #10b981 !important; /* Forzar color verde siempre visible */
    font-weight: 800 !important;
    font-size: inherit;
}

/* Asegurar que el símbolo de moneda también sea visible */
.esaico-price .woocommerce-Price-currencySymbol {
    color: #10b981 !important;
}

/* ==========================================================================
   BADGES/BOTONES - DISEÑO MODERNO CON GRADIENTES
   ========================================================================== */

.esaico-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

/* Efecto de onda al hover */
.esaico-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.esaico-button:hover::after {
    width: 300px;
    height: 300px;
}

.esaico-button i,
.esaico-button span {
    z-index: 1;
    position: relative;
}

.esaico-button i {
    font-size: 16px;
}

/* Badge GRATIS - Verde vibrante */
.esaico-button.gratis {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.esaico-button.gratis:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Badge PRO - Dorado premium */
.esaico-button.pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.esaico-button.pro:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Badge DEMO - Azul moderno */
.esaico-button.demo {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.esaico-button.demo:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.esaico-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* ==========================================================================
   RESPONSIVE - CARD HEADER
   ========================================================================== */

/* Desktop y Tablet grande (≥1025px) - Layout horizontal */
@media (min-width: 1025px) {
    .esaico-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 24px;
    }

    .esaico-header-left {
        justify-content: flex-start;
    }

    .esaico-price {
        font-size: 36px;
    }
}

/* Tablet (768px - 1024px) - Layout vertical compacto */
@media (max-width: 1024px) {
    .esaico-card-header {
        padding: 18px;
        gap: 14px;
    }

    .esaico-price {
        font-size: 28px;
    }

    .esaico-button {
        padding: 9px 18px;
        font-size: 13px;
    }
}

/* Móvil (≤768px) - Stack vertical centrado */
@media (max-width: 768px) {
    .esaico-card-header {
        padding: 16px;
        gap: 12px;
        border-radius: 12px;
    }

    .esaico-header-left {
        gap: 8px;
    }

    .esaico-button {
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 10px;
    }

    .esaico-button i {
        font-size: 14px;
    }

    .esaico-price {
        font-size: 26px;
    }
}

/* Móvil pequeño (≤480px) - Ultra compacto */
@media (max-width: 480px) {
    .esaico-card-header {
        padding: 14px;
        gap: 10px;
    }

    .esaico-header-left {
        gap: 6px;
    }

    .esaico-button {
        padding: 7px 14px;
        font-size: 11px;
        gap: 6px;
        border-radius: 8px;
    }

    .esaico-button i {
        font-size: 12px;
    }

    .esaico-price {
        font-size: 24px;
    }
}

/* Otros elementos del sidebar */
.esaico-ad-section {
    margin: 20px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.esaico-action-button {
    margin: 20px 0;
}

.esaico-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: #10b981;
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.esaico-download-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   CARD DE AUTOR - DISEÑO MODERNO Y RESPONSIVO
   ========================================================================== */

.esaico-author-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.esaico-author-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.05), transparent);
    transition: left 0.6s ease;
}

.esaico-author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
}

.esaico-author-card:hover::before {
    left: 100%;
}

/* Header del card con avatar e info */
.esaico-author-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.esaico-author-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.esaico-author-card:hover .esaico-author-avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.esaico-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.esaico-author-info {
    flex: 1;
    min-width: 0;
}

.esaico-author-name {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.esaico-author-name a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.esaico-author-name a:hover {
    color: #10b981;
}

.esaico-author-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.esaico-author-meta i {
    color: #10b981;
    font-size: 13px;
}

/* Biografía del autor */
.esaico-author-bio {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 10px;
    border-left: 3px solid #10b981;
    position: relative;
    z-index: 1;
}

.esaico-author-bio p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

/* Botón de acción */
.esaico-author-action {
    position: relative;
    z-index: 1;
}

.esaico-author-action .btn {
    width: 100%;
    justify-content: center;
}

.esaico-author-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.esaico-author-link:hover i {
    transform: translateX(4px);
}

/* Responsive - Móvil */
@media (max-width: 480px) {
    .esaico-author-card {
        padding: 16px;
    }

    .esaico-author-header {
        gap: 12px;
    }

    .esaico-author-avatar {
        width: 56px;
        height: 56px;
        border-width: 2px;
    }

    .esaico-author-name {
        font-size: 16px;
    }

    .esaico-author-meta {
        font-size: 13px;
    }

    .esaico-author-link {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 12px 16px;
    }
}

.esaico-info-section,
.esaico-tags-section {
    margin: 20px 0;
}

.esaico-info-title,
.esaico-tags-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.esaico-attributes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.esaico-attribute-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
}

.esaico-attribute-item .attribute-label {
    font-weight: 600;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.esaico-attribute-item .attribute-value {
    color: #1a1a1a;
    font-weight: 500;
}

.esaico-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.esaico-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #e5e7eb;
    color: #1a1a1a;
    font-size: 13px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.esaico-tag:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* ==========================================================================
   TABS DE DESCRIPCIÓN
   ========================================================================== */

.esaico-product-tabs {
    margin-bottom: 0; /* Eliminado margen inferior innecesario */
}

/* ==========================================================================
     CONTENEDOR DEL REPRODUCTOR MIDI - Fuera de los tabs
     ========================================================================== */

.esaico-midi-player-container {
    margin-bottom: 30px; /* Espacio entre el reproductor y los tabs */
}

/* ==========================================================================
     REPRODUCTOR MIDI - Solo aparece si el producto tiene archivo MIDI
     ========================================================================== */

.esaico-midi-player-box {
    background: var(--esaico-gradient-primary);
    border-radius: 12px;
    padding: 0;
    margin: 0; /* Sin margen - el contenedor padre maneja el espaciado */
    box-shadow: 0 4px 16px rgba(var(--esaico-primary-rgb, 102, 126, 234), 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 120px; /* Altura mínima para asegurar que se vea el contenido */
}

.esaico-midi-player-box:hover {
    box-shadow: 0 6px 20px rgba(var(--esaico-primary-rgb, 102, 126, 234), 0.4);
    transform: translateY(-2px);
}

.esaico-midi-player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.esaico-midi-player-header i {
    font-size: 18px;
    color: #fff;
    animation: pulse 2s ease-in-out infinite;
}

.esaico-midi-player-header span {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.esaico-midi-player-content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    min-height: 60px;
}

/* Asegurar que el shortcode midiplay se muestre correctamente */
.esaico-midi-player-content > * {
    width: 100%;
    max-width: 100%;
}

/* Estilos específicos para el reproductor MIDI */
.esaico-midi-player-content midi-player,
.esaico-midi-player-content .midi-player-container {
    width: 100% !important;
    max-width: 100%;
    display: block;
}

/* Estilos para reproductor MP3 con Waveform */
.esaico-midi-player-content #waveform-container {
    width: 100%;
    height: 80px;
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    contain: strict;
    isolation: isolate;
    padding: 0;
    box-sizing: border-box;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Contener cualquier elemento hijo del waveform */
.esaico-midi-player-content #waveform-container > * {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    clip-path: inset(0 round 8px) !important;
}

/* Contener canvas específicamente */
.esaico-midi-player-content #waveform-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
}


.esaico-midi-player-content .player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 60px;
    overflow: visible;
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    margin-top: 16px;
}

.esaico-midi-player-content .play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--esaico-gradient-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.esaico-midi-player-content .play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.esaico-midi-player-content .time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
}

.esaico-midi-player-content .volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 120px;
    min-width: 80px;
    justify-content: flex-end;
    margin-left: auto;
}

.esaico-midi-player-content .volume-control i {
    color: #6c757d;
    font-size: 14px;
}

.esaico-midi-player-content #volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    background: #dee2e6;
}

.esaico-midi-player-content #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--esaico-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.esaico-midi-player-content #volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.esaico-midi-player-content #volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--esaico-primary);
    cursor: pointer;
    border: none;
}

.esaico-midi-player-content #esaico-audio-element {
    display: none;
}

/* Animación del ícono de música */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Responsive para reproductor MIDI */
@media (max-width: 768px) {
    .esaico-midi-player-box {
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Prevenir overflow */
    }

    .esaico-midi-player-header {
        padding: 14px 16px;
    }

    .esaico-midi-player-header i {
        font-size: 16px;
    }

    .esaico-midi-player-header span {
        font-size: 15px;
    }

    .esaico-midi-player-content {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Prevenir overflow del contenido */
    }

    /* Waveform container responsive */
    .esaico-midi-player-content #waveform-container {
        width: 100% !important;
        height: 60px !important; /* Reducido para móvil */
        margin-bottom: 12px;
    }

    /* Player controls responsive */
    .esaico-midi-player-content .player-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-height: auto;
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Prevenir overflow */
    }

    .esaico-midi-player-content .play-btn {
        align-self: center;
        order: 1;
        flex-shrink: 0;
    }

    .esaico-midi-player-content .time-display {
        justify-content: center;
        align-self: center;
        order: 2;
        flex-shrink: 0;
    }

    .esaico-midi-player-content .volume-control {
        justify-content: center;
        max-width: 200px;
        align-self: center;
        order: 3;
        flex-shrink: 0;
    }

    /* Asegurar que los controles no causen overflow */
    .esaico-midi-player-content .volume-control #volume-slider {
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .esaico-midi-player-box {
        border-radius: 10px;
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .esaico-midi-player-header {
        padding: 12px 14px;
    }

    .esaico-midi-player-header i {
        font-size: 14px;
    }

    .esaico-midi-player-header span {
        font-size: 14px;
    }

    .esaico-midi-player-content {
        padding: 14px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Waveform aún más pequeño en móviles pequeños */
    .esaico-midi-player-content #waveform-container {
        height: 50px !important;
        margin-bottom: 10px;
    }

    /* Controles más compactos */
    .esaico-midi-player-content .player-controls {
        padding: 10px;
        gap: 10px;
    }

    .esaico-midi-player-content .play-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .esaico-midi-player-content .time-display {
        font-size: 12px;
    }

    .esaico-midi-player-content .volume-control {
        max-width: 150px;
    }

    .esaico-midi-player-content .volume-control #volume-slider {
        max-width: 100px;
    }
}

.esaico-tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    margin-top: 0; /* Sin margen superior - el contenedor del reproductor maneja el espaciado */
}

.esaico-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.esaico-tab-link:hover {
    color: #1a1a1a;
}

.esaico-tab-link.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.esaico-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    padding: 25px;
}

.esaico-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.esaico-product-description {
    line-height: 1.8;
    color: #374151;
    font-size: 15px;
}

.esaico-show-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #f3f4f6;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esaico-show-more-btn:hover {
    background: #e5e7eb;
}

/* Reviews */
.esaico-reviews-container {
    padding: 20px 0;
}

.esaico-reviews-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.esaico-no-reviews {
    text-align: center;
    padding: 40px 20px;
    background: #f9fafb;
    border-radius: 8px;
}

/* ==========================================================================
   PRODUCTOS RELACIONADOS
   ========================================================================== */

.esaico-related-products-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.esaico-related-products {
    width: 100%;
    max-width: 100%;
    margin: 0; /* Eliminado margen - el gap del contenedor padre controla el espaciado */
    box-sizing: border-box;
}

.esaico-related-products h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.esaico-related-products .woo-product-loop {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* En móvil, los relacionados tienen order: 4 (al final) */
@media (max-width: 1024px) {
    .esaico-related-products {
        margin: 0; /* Sin margen - usa gap del padre */
    }
}

/* En desktop, los relacionados están en grid-row: 2 */
@media (min-width: 1025px) {
    .esaico-related-products {
        margin: 10px 0 0 0; /* Margen superior pequeño solo en desktop */
    }
}

/* ==========================================================================
   BREADCRUMB Y METADATA
   ========================================================================== */

.esaico-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--esaico-text-muted, #6b7280);
}

/* Los enlaces heredan estilos globales de a {} */

.esaico-breadcrumb i {
    font-size: 12px;
}

.esaico-product-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    line-height: 1.2;
}

.esaico-meta-section {
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}

.esaico-meta-scroll {
    display: flex;
    gap: 20px;
    align-items: center;
    min-width: min-content;
    padding-bottom: 4px;
}

.esaico-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--esaico-text-muted, #6b7280);
    white-space: nowrap;
}

.esaico-meta-item i {
    font-size: 14px;
}

/* Los enlaces heredan estilos globales de a {} */

@media (max-width: 768px) {
    .esaico-product-title {
        font-size: 24px;
    }

    .esaico-meta-scroll {
        gap: 16px;
    }

    .esaico-meta-item {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .esaico-product-title {
        font-size: 20px;
    }

    .esaico-breadcrumb {
        font-size: 12px;
    }
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL - PREVENIR OVERFLOW
   ========================================================================== */

.esaico-single-product-container,
.esaico-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* NO usar overflow-x: hidden aquí - rompe el sticky */
}

/* Asegurar que ningún elemento hijo cause overflow */
.esaico-container > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   RESPONSIVE - TABLET Y MÓVIL
   ========================================================================== */

@media (max-width: 768px) {
    .esaico-product-content {
        gap: 12px; /* Reducido de 15px a 12px en tablet */
        padding: 0 10px;
    }

    .esaico-mobile-social-actions {
        padding: 12px;
        gap: 12px;
        margin: 0; /* Sin margen adicional */
    }

    .esaico-mobile-social-actions .esaico-social-btn {
        width: 48px;
        height: 48px;
    }

    .esaico-related-products {
        margin: 0; /* Sin margen adicional */
    }

    /* Botón cargar más en productos relacionados */
    .esaico-related-products .esaico-load-more-container {
        text-align: center;
        margin-top: 20px;
        padding-bottom: 20px;
    }

    .esaico-related-products .esaico-load-more-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 24px;
        background: var(--esaico-gradient-primary);
        color: var(--esaico-text-white);
        border: none;
        border-radius: var(--esaico-border-radius-lg);
        font-size: 14px;
        font-weight: var(--esaico-font-weight-semibold);
        cursor: pointer;
        transition: var(--esaico-transition-all);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
        text-decoration: none;
    }

    .esaico-related-products .esaico-load-more-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

    .esaico-related-products .esaico-load-more-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

    .esaico-related-products .esaico-load-more-btn i {
        font-size: 14px;
    }
}

/* ==========================================================================
   RESPONSIVE - MÓVIL PEQUEÑO (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .esaico-product-content {
        gap: 10px; /* Reducido de 12px a 10px en móvil pequeño */
        padding: 0 5px;
    }

    .esaico-mobile-social-actions {
        padding: 10px;
        gap: 10px;
        margin: 0; /* Sin margen adicional */
    }

    .esaico-mobile-social-actions .esaico-social-btn {
        width: 44px;
        height: 44px;
    }

    .esaico-mobile-social-actions .esaico-social-btn svg {
        width: 18px;
        height: 18px;
    }

    .esaico-related-products {
        margin: 0; /* Sin margen adicional */
    }

    /* Forzar que todo respete los límites del viewport */
    body,
    html {
        max-width: 100vw !important;
    }

    .esaico-single-product-container,
    .esaico-container,
    .esaico-product-content,
    .esaico-main-column,
    .esaico-sidebar-column {
        max-width: 100% !important;
        width: 100% !important;
    }
}
