/* e-Medias Pricing Grid CSS */

.emedias-pricing-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

/* Scrollbar personnalisée */
.emedias-pricing-wrapper::-webkit-scrollbar {
    height: 8px;
}

.emedias-pricing-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.emedias-pricing-wrapper::-webkit-scrollbar-thumb {
    background: #223223;
    border-radius: 10px;
}

.emedias-pricing-wrapper::-webkit-scrollbar-thumb:hover {
    background: #1a261a;
}

/* Firefox */
.emedias-pricing-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #223223 #f1f1f1;
}

.emedias-pricing-table {
    border-collapse: separate;
    border-spacing: 1px;
    margin: 0 auto;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header */
.emedias-pricing-table thead th {
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease;
}

.emedias-pricing-table.sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Row Headers - centrés verticalement */
.emedias-pricing-table tbody th {
    text-align: left;
    font-weight: 600;
    vertical-align: middle;
    height: 80px;
}

.emedias-pricing-table.sticky-column tbody th {
    position: sticky;
    left: 0;
    z-index: 5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Cells */
.emedias-pricing-table tbody td {
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    vertical-align: middle;
    height: 80px;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* Cell Content Wrapper */
.price-cell-content {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Prix Display - centré par défaut */
.price-display {
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

/* Prix */
.price-value {
    display: inline-block;
    transition: all 0.3s ease;
}

.price-currency {
    display: inline-block;
    opacity: 0.7;
    font-weight: 400;
    transition: all 0.3s ease;
}

.price-unavailable {
    opacity: 0.4;
    font-style: italic;
}

/* Bouton CTA - Desktop : au survol uniquement */
.price-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    transform-origin: center center;
    pointer-events: none;
}

/* Desktop : Au survol, le prix disparaît et le bouton apparaît */
@media (min-width: 769px) {
    .emedias-pricing-table tbody td:hover .price-display {
        opacity: 0;
        transform: translateY(-10px);
    }
    
    .emedias-pricing-table tbody td:hover .price-cta-button {
        opacity: 1;
        transform: translateX(-50%) scale(1);
        pointer-events: auto;
    }
    
    .price-cta-button:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        transform: translateX(-50%) scale(1.05) !important;
    }
    
    /* Cacher l'icône panier sur desktop */
    .price-cta-button svg {
        display: none;
    }
}

/* Highlight de colonne */
.emedias-pricing-table .col-highlight {
    transition: background-color 0.2s ease;
}

.emedias-pricing-table .header-highlight {
    transition: background-color 0.2s ease;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .emedias-pricing-table {
        font-size: 14px;
    }
    
    .emedias-pricing-table th,
    .emedias-pricing-table td {
        padding: 8px 12px !important;
    }
    
    .price-value {
        font-size: 14px !important;
    }
    
    /* Mobile : Affichage permanent du bouton avec icône */
    .price-cta-mobile-visible {
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        margin-top: 8px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        pointer-events: auto !important;
    }
    
    .price-cell-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    /* Prix toujours visible sur mobile */
    .price-display {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Cellules plus hautes pour accueillir prix + bouton */
    .emedias-pricing-table tbody td {
        height: auto;
        min-height: 100px;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .price-cta-button {
        font-size: 11px;
        padding: 6px 12px !important;
    }
    
    /* Scrollbar plus visible sur mobile */
    .emedias-pricing-wrapper::-webkit-scrollbar {
        height: 10px;
    }
}

@media (max-width: 480px) {
    .emedias-pricing-table {
        font-size: 12px;
    }
    
    .emedias-pricing-table th,
    .emedias-pricing-table td {
        padding: 6px 8px !important;
    }
    
    .emedias-pricing-table tbody td {
        min-height: 110px;
    }
}

/* Performance */
.price-display,
.price-cta-button {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .emedias-pricing-table * {
        transition-duration: 0.01ms !important;
    }
}