/* ===========================================
   HOMY PLANS
   =========================================== */

#homy-plans-wrapper {
    width: 100%;
    font-family: var(--homy-font-primary);
    box-sizing: border-box;
}

#homy-plans-wrapper *,
#homy-plans-wrapper *::before,
#homy-plans-wrapper *::after {
    box-sizing: border-box;
}

/* ===========================================
   HEADER : currency aligne a droite
   =========================================== */

.homy-plans-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: var(--homy-spacing-8);
    position: relative;
}

/* ===========================================
   SELECTEUR DE DEVISE
   =========================================== */

.homy-currency-section {
    position: relative;
}

.homy-currency-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--homy-spacing-2);
    background: var(--homy-white);
    border: 1px solid var(--homy-purple);
    border-radius: var(--homy-radius-full);
    padding: 9px var(--homy-spacing-4);
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    font-weight: 500;
    color: var(--homy-primary);
    cursor: pointer;
    transition: var(--homy-transition-default);
    white-space: nowrap;
}

.homy-currency-toggle:hover {
    border-color: var(--homy-blue);
    box-shadow: 0 2px 8px rgba(60, 180, 232, 0.15);
}

.homy-currency-chevron {
    transition: transform 0.2s ease;
}

.homy-currency-toggle[aria-expanded="true"] .homy-currency-chevron {
    transform: rotate(180deg);
}

.homy-currency-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--homy-white);
    border: 1px solid var(--homy-purple);
    border-radius: var(--homy-radius-xl);
    padding: var(--homy-spacing-1_5);
    box-shadow: 0 8px 24px rgba(44, 25, 45, 0.12);
    min-width: 160px;
    z-index: 100;
    animation: homy-dropdown-in 0.15s ease;
}

.homy-currency-dropdown.open {
    display: flex;
}

@keyframes homy-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.homy-currency-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--homy-spacing-2);
    width: 100%;
    background: transparent;
    border: none;
    border-radius: var(--homy-radius-lg);
    padding: 9px var(--homy-spacing-3);
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    font-weight: 500;
    color: var(--homy-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.homy-currency-opt:hover {
    background: var(--homy-gray);
}

.homy-currency-opt.active {
    background: rgba(161, 125, 179, 0.12);
    font-weight: 700;
    color: var(--homy-purple);
}

/* ===========================================
   BANDEAU PROMO
   =========================================== */

.homy-promo-banner {
    text-align: center;
    margin-bottom: var(--homy-spacing-9);
    padding: var(--homy-spacing-7) var(--homy-spacing-6);
    background: var(--homy-gray);
    border-radius: var(--homy-radius-3xl);
    border: var(--homy-border-width) solid var(--homy-purple);
}

.homy-promo-badge {
    display: inline-block;
    background: var(--homy-blue);
    color: var(--homy-white);
    font-family: var(--homy-font-title);
    font-size: var(--homy-font-h3);
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: var(--homy-spacing-2) var(--homy-spacing-6);
    border-radius: var(--homy-radius-full);
    margin-bottom: var(--homy-spacing-2_5);
}

.homy-promo-text {
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    color: var(--homy-primary);
    opacity: 0.65;
    margin: 0 0 var(--homy-spacing-4);
}

.homy-promo-counter {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--homy-spacing-2);
    margin-bottom: var(--homy-spacing-3);
}

.homy-promo-remaining {
    font-family: var(--homy-font-title);
    font-size: 40px;
    font-weight: 800;
    color: var(--homy-blue);
    line-height: 1;
}

.homy-promo-counter-label {
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    font-weight: 500;
    color: var(--homy-primary);
    opacity: 0.55;
}

.homy-promo-bar-wrapper {
    width: 100%;
    max-width: 320px;
    height: 8px;
    background: rgba(44, 25, 45, 0.08);
    border-radius: var(--homy-radius-full);
    margin: 0 auto;
    overflow: hidden;
}

.homy-promo-bar {
    height: 100%;
    background: var(--homy-blue);
    border-radius: var(--homy-radius-full);
    transition: width 0.6s ease;
}

/* ===========================================
   PRIX ORIGINAL BARRE (promo)
   =========================================== */

.homy-plan-price-original {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: 2px;
    text-decoration: line-through;
    text-decoration-color: var(--homy-red);
    text-decoration-thickness: 2px;
    opacity: 0.45;
}

.homy-plan-currency-original {
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    font-weight: 600;
    color: var(--homy-primary);
    line-height: 1;
}

.homy-plan-amount-original {
    font-family: var(--homy-font-title);
    font-size: 28px;
    font-weight: 700;
    color: var(--homy-primary);
    line-height: 1;
}

.homy-plan-period-original {
    font-family: var(--homy-font-primary);
    font-size: 12px;
    font-weight: 500;
    color: var(--homy-primary);
}

/* Prix promo en couleur */
.homy-plan-price-promo .homy-plan-amount {
    color: var(--homy-teal);
}

.homy-plan-price-promo .homy-plan-currency,
.homy-plan-price-promo .homy-plan-period {
    color: var(--homy-teal);
}

/* Tag promo sur la carte */
.homy-plan-promo-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--homy-blue);
    color: var(--homy-white);
    font-family: var(--homy-font-primary);
    font-size: 12px;
    font-weight: 700;
    padding: var(--homy-spacing-1) var(--homy-spacing-3);
    border-radius: var(--homy-radius-full);
    z-index: 3;
}

.homy-plan-featured .homy-plan-promo-tag {
    top: 14px;
}

/* ===========================================
   GRILLE DES PLANS
   =========================================== */

.homy-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--homy-spacing-2);
    align-items: stretch;
}

@media (max-width: 900px) {
    .homy-plans-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===========================================
   CARTE PLAN
   =========================================== */

.homy-plan-card {
    border-radius: var(--homy-radius-3xl);
    padding: var(--homy-spacing-9) var(--homy-spacing-7);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.homy-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(44, 25, 45, 0.10);
}

.homy-plan-featured {
    padding-top: var(--homy-spacing-12);
    box-shadow: 0 8px 32px rgba(161, 125, 179, 0.18);
    transform: scale(1.1);
    z-index: 2;
}

.homy-plan-featured:hover {
    transform: scale(1.1) translateY(-6px);
}

.homy-plan-popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--homy-purple);
    color: var(--homy-white);
    font-family: var(--homy-font-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px var(--homy-spacing-4_5, 18px);
    border-radius: var(--homy-radius-full);
    white-space: nowrap;
}

/* ===========================================
   HEADER DU PLAN
   =========================================== */

.homy-plan-header {
    margin-bottom: var(--homy-spacing-7);
    width: 100%;
}

.homy-plan-title {
    font-family: var(--homy-font-title);
    font-size: 22px;
    font-weight: 800;
    color: var(--homy-primary);
    margin: 0 0 var(--homy-spacing-4);
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: center;
    padding: 0;
    border: none;
}

.homy-plan-price-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.homy-plan-currency {
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-h2);
    font-weight: 700;
    color: var(--homy-primary);
    line-height: 1;
}

.homy-plan-amount {
    font-family: var(--homy-font-title);
    font-size: 52px;
    font-weight: 800;
    color: var(--homy-primary);
    line-height: 1;
    letter-spacing: -1px;
    transition: opacity 0.15s ease;
}

.homy-plan-amount.updating {
    opacity: 0.4;
}

.homy-plan-period {
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    font-weight: 500;
    color: var(--homy-primary);
    opacity: 0.55;
    margin-left: 2px;
}

.homy-plan-monthly {
    margin-top: var(--homy-spacing-1_5);
    font-family: var(--homy-font-primary);
    font-size: 12px;
    font-weight: 500;
    color: var(--homy-primary);
    opacity: 0.5;
    text-align: center;
}

/* ===========================================
   LISTE D'AVANTAGES
   =========================================== */

.homy-plan-features {
    list-style: none;
    margin: 0 0 var(--homy-spacing-8);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--homy-spacing-2_5);
    flex: 1;
    width: 100%;
    text-align: left;
}

.homy-plan-feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--homy-spacing-2_5);
    font-family: var(--homy-font-primary);
    font-size: var(--homy-font-mini);
    line-height: 1.5;
    color: var(--homy-primary);
}

.homy-plan-bullet {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: var(--homy-radius-full);
    margin-top: 4px;
    flex-shrink: 0;
}

/* ===========================================
   BOUTON CTA
   =========================================== */

.homy-plan-cta {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.homy-plan-btn {
    font-family: var(--homy-font-primary);
    font-size: 15px;
    font-weight: var(--homy-font-weight-button);
    background: var(--homy-blue);
    color: var(--homy-white);
    border: none;
    border-radius: var(--homy-radius-full);
    padding: 13px var(--homy-spacing-8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--homy-spacing-1_5);
    transition: var(--homy-transition-default);
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}

.homy-plan-btn:hover {
    background: var(--homy-teal);
    transform: translateX(2px);
}

.homy-plan-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.homy-plan-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.homy-plan-btn:hover svg {
    transform: translateX(3px);
}

/* ===========================================
   SPINNER (checkout)
   =========================================== */

.homy-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--homy-white);
    border-radius: var(--homy-radius-full);
    animation: homy-spin 0.6s linear infinite;
}

@keyframes homy-spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
    .homy-plan-card {
        padding: var(--homy-spacing-7) var(--homy-spacing-5);
    }
    .homy-plan-featured {
        transform: none;
    }
    .homy-plan-amount {
        font-size: 44px;
    }
    .homy-plan-title {
        font-size: 19px;
    }
    .homy-plans-header {
        margin-bottom: var(--homy-spacing-5);
    }
    .homy-promo-banner {
        padding: var(--homy-spacing-5) var(--homy-spacing-4);
        margin-bottom: var(--homy-spacing-6);
    }
    .homy-promo-remaining {
        font-size: 32px;
    }
}