/* CSS variable fallbacks (in case theme globals are not present) */
:root {
    --main-color: #ff7d00;
    --medium-dark: #181818;
}

/* ==========================================================================
   HUBLIO PLANS SHORTCODE STYLES
   Estilos para el shortcode de planes de suscripción dinámicos
   ========================================================================== */

.hublio-plans-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ==========================================================================
   TOGGLE DE FACTURACIÓN (MENSUAL/ANUAL)
   ========================================================================== */

.hublio-plans-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

/* Segmented control */
.toggle-segmented {
    display: inline-flex;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 28px;
    padding: 6px;
    gap: 6px;
}

.toggle-option {
    position: relative;
    color: #ddd!important;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 100px!important;
    background: #181818;
    border: 1px solid #333!important;
    color: #b2b2b2;
}

.toggle-option .label { font-weight: 600; }

.toggle-option:hover {
    background: var(--main-color)!important;
}

.toggle-option.active {
    background: linear-gradient(135deg, var(--main-color), #ff9500)!important;
    color: #fff!important;
    border-color: var(--main-color)!important;
}

.toggle-option .chip-savings {
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    border-radius: 999px;
    position: absolute;
    width: fit-content;
    white-space: nowrap;
    padding: 4px 10px;
    top: 50%;
    transform: translateY(-50%);
    right: -100px;
}

/* ==========================================================================
   GRID DE PLANES
   ========================================================================== */

.hublio-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    align-items: stretch;
}

/* ==========================================================================
   TARJETAS DE PLANES
   ========================================================================== */

.hublio-plan-card {
    background: var(--medium-dark);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hublio-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: #444;
}

.hublio-plan-card.popular {
    border-color: var(--main-color);
    box-shadow: 0 0 0 1px rgba(255, 125, 0, 0.3);
}

.hublio-plan-card.popular:hover {
    box-shadow: 0 10px 30px rgba(255, 125, 0, 0.2);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--main-color), #ff9500);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 125, 0, 0.3);
}

/* ==========================================================================
   HEADER DEL PLAN
   ========================================================================== */

.plan-header {
    text-align: center;
    margin-bottom: 30px;
}

.plan-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px 0;
}

.plan-description {
    font-size: 12px;
    color: #ccc;
    line-height: 1.3;
    margin: 0;
}

/* ==========================================================================
   PRECIOS
   ========================================================================== */

.plan-pricing {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price-display {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.price-display.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

.hublio-plan-card .price-inline { display: inline-flex; align-items: flex-start; gap: 6px; }
.hublio-plan-card .currency { font-size: 18px; color: #fff; font-weight: 600; line-height: 1.1; margin-top: 6px; }
.hublio-plan-card .amount { font-size: 64px; font-weight: 800; color: #fff; line-height: 0.95; }
.hublio-plan-card .decimals { font-size: 18px; color: #fff; margin-left: 2px; line-height: 1.1; }
.hublio-plan-card .original-inline { color: #bbb; text-decoration: line-through; margin-right: 10px; align-self: center; }

.billing-period {
    font-size: 14px;
    color: #ccc;
    margin-top: 8px;
    font-weight: 500;
}

/* Precio gratis */
.price-display .amount:only-child {
    font-size: 36px;
    color: var(--main-color);
}

/* ==========================================================================
   BOTONES CTA
   ========================================================================== */

.plan-cta {
    margin-bottom: 30px;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-button {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.cta-button.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    z-index: 2;
}

.cta-button {
    background: linear-gradient(135deg, var(--main-color), #ff9500);
    color: #fff;
    border: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 125, 0, 0.4);
    color: #fff;
    text-decoration: none;
}

.cta-button:active {
    transform: translateY(0);
}

/* ==========================================================================
   LISTA DE BENEFICIOS
   ========================================================================== */

.plan-benefits {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.benefit-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--main-color), #ff9500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: 2px;
}

.benefit-icon svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5px;
}

.benefit-text {
    color: #ccc;
    flex: 1;
}

/* ==========================================================================
   MENSAJE SIN PLANES
   ========================================================================== */

.hublio-no-plans {
    text-align: center;
    padding: 60px 20px;
    background: var(--medium-dark);
    border: 1px solid #333;
    border-radius: 12px;
    color: #ccc;
    font-size: 16px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .hublio-plans-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }

    .toggle-option .chip-savings {
        top: 160%;
        right: 0;
    }
    
    .hublio-plan-card {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .hublio-plans-container {
        padding: 15px;
    }
    
    .hublio-plans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .toggle-wrapper {
        gap: 15px;
        padding: 6px 20px;
    }
    
    .toggle-label {
        font-size: 14px;
    }
    
    .savings-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .toggle-switch {
        width: 50px;
        height: 26px;
    }
    
    .toggle-slider:before {
        height: 18px;
        width: 18px;
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(24px);
    }
    
    .hublio-plan-card {
        padding: 40px 20px;
    }

    .plan-header {
        margin-bottom: 0;
    }
    
    .plan-title {
        font-size: 22px;
    }

    .plan-pricing {
        margin-bottom: 0;
    }
    
    .amount {
        font-size: 40px;
    }
    
    .currency, .period {
        font-size: 20px;
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .hublio-plans-container {
        padding: 10px;
    }
    
    .toggle-wrapper {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .toggle-switch {
        order: -1;
    }
    
    .hublio-plan-card {
        padding: 40px 20px;
    }
    
    .plan-title {
        font-size: 20px;
    }
    .amount {
        font-size: 36px;
    }
    
    .currency, .period {
        font-size: 18px;
    }
    
    .cta-button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .benefit-item {
        font-size: 13px;
        gap: 10px;
    }
    
    .benefit-icon {
        width: 18px;
        height: 18px;
    }
    
    .benefit-icon svg {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================================================
   ANIMACIONES Y TRANSICIONES
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hublio-plan-card {
    animation: fadeInUp 0.6s ease-out;
}

.hublio-plan-card:nth-child(2) {
    animation-delay: 0.1s;
}

.hublio-plan-card:nth-child(3) {
    animation-delay: 0.2s;
}

.hublio-plan-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Smooth transitions para el toggle */
.price-display,
.cta-button {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover effects mejorados */
.hublio-plan-card:hover .benefit-icon {
    transform: scale(1.1);
}

.hublio-plan-card:hover .plan-title {
    color: var(--main-color);
}
