/**
 * Pricing Tables Toggle Functionality - Mobile Only
 * Hides benefits by default and allows expand/collapse functionality
 * Button text changes between "View Benefits" and "Hide Benefits" based on state
 */

/* Hide toggle button on desktop by default */
.view-benefits-toggle {
    display: none !important;
}

/* Ensure benefits are visible on desktop */
@media (min-width: 993px) {
    .eb-pricing-body {
        display: block !important;
    }
}

@media (max-width: 992px) {
    /* Hide benefits by default on mobile */
    .eb-pricing-body {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    }
    
    /* Show benefits when expanded */
    .eb-pricing-body.expanded {
        max-height: 2000px;
        opacity: 1;
        transition: max-height 0.5s ease-in, opacity 0.4s ease-in;
    }
    
    /* Animate individual benefit items */
    .eb-pricing-body.expanded .eb-pricebox-feature-item {
        animation: fadeInUp 0.4s ease-out forwards;
        opacity: 0;
    }
    
    /* Stagger animation for each item */
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(1) { animation-delay: 0.05s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(2) { animation-delay: 0.08s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(3) { animation-delay: 0.11s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(4) { animation-delay: 0.14s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(5) { animation-delay: 0.17s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(6) { animation-delay: 0.20s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(7) { animation-delay: 0.23s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(8) { animation-delay: 0.26s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(9) { animation-delay: 0.29s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(10) { animation-delay: 0.32s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(11) { animation-delay: 0.35s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(12) { animation-delay: 0.38s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(13) { animation-delay: 0.41s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(14) { animation-delay: 0.44s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(15) { animation-delay: 0.47s; }
    .eb-pricing-body.expanded .eb-pricebox-feature-item:nth-child(16) { animation-delay: 0.50s; }
    
    /* Keyframe animation */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* "View Benefits" / "Hide Benefits" toggle button */
    .view-benefits-toggle {
        order: 5 !important;
        margin-top: 8px;
        text-align: center;
        cursor: pointer;
        font-size: 1rem;
        font-family: inherit;
        padding: 5px 0;
        transition: opacity 0.3s ease;
        display: block !important;
    }
    
    .view-benefits-toggle:hover {
        opacity: 0.8;
    }
    
    .view-benefits-toggle .toggle-text {
        font-weight: 400 !important;
        font-style: normal !important;
    }
    
    /* Override any inherited font-weight from Essential Blocks - Maximum specificity */
    .eb-pricing-item .view-benefits-toggle,
    .eb-pricing-item .view-benefits-toggle .toggle-text,
    .eb-pricing-item .view-benefits-toggle span,
    .eb-pricing-wrapper .view-benefits-toggle .toggle-text,
    .eb-pricing-item:not(.featured) .view-benefits-toggle .toggle-text,
    .eb-pricing-item.featured .view-benefits-toggle .toggle-text {
        font-weight: 400 !important;
        font-style: normal !important;
    }
    
    /* Force normal weight on all states */
    .view-benefits-toggle .toggle-text,
    .view-benefits-toggle span.toggle-text {
        font-weight: 400 !important;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Style for dark background plans (Essential XL and Premium XL) */
    .eb-pricing-item:not(.featured) .view-benefits-toggle {
        color: #ffffff;
    }
    
    /* Style for featured plan (Elite XL) with white background */
    .eb-pricing-item.featured .view-benefits-toggle {
        color: #23282d;
    }
    
    /* Adjust spacing for footer when toggle button is present */
    .eb-pricing-footer {
        margin-bottom: 0 !important;
    }
}
