/* ===========================================
   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;
}

/* Avantage fidélité/parrainage gelé : mention « (à venir) » */
.homy-plan-feature-soon {
    opacity: 0.65;
}

.homy-plan-feature-soon-tag {
    font-style: italic;
    font-weight: 600;
    opacity: 0.85;
    white-space: nowrap;
}

/* ===========================================
   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;
    }
}

/* ===========================================
   GESTION D'ABONNEMENT (upgrade / downgrade)
   =========================================== */

/* Bannière d'information (essai en cours / changement programmé) */
.homy-plans-notice {
    border-radius: var(--homy-radius-lg, 14px);
    padding: 14px 18px;
    margin-bottom: var(--homy-spacing-6, 24px);
    font-family: var(--homy-font-primary);
    font-size: 14px;
    line-height: 1.5;
}
.homy-plans-notice-info {
    background: #FEF3E2;
    border: 1px solid #F4C77B;
    color: #8A5A12;
}

/* Carte de la formule actuelle */
.homy-plan-current {
    outline: 2px solid var(--homy-blue, #3CB4E8);
    outline-offset: -2px;
}
.homy-plan-current-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--homy-blue, #3CB4E8);
    color: var(--homy-white, #fff);
    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;
}
.homy-plan-current-label {
    width: 100%;
    text-align: center;
    padding: 13px 16px;
    border-radius: var(--homy-radius-full);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--homy-dark, #2C192D);
    font-family: var(--homy-font-primary);
    font-weight: 600;
    font-size: 14px;
}

/* Variantes de bouton */
.homy-plan-btn-downgrade {
    background: var(--homy-white, #fff);
    color: var(--homy-dark, #2C192D);
    border: 1px solid rgba(0, 0, 0, 0.18);
}
.homy-plan-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   MODALE DE CHANGEMENT DE FORMULE
   (sélecteurs renforcés pour primer sur les styles Elementor du thème)
   =========================================== */
body.homy-modal-open {
    overflow: hidden;
}
#homy-plans-wrapper .homy-change-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: var(--homy-font-primary);
}
#homy-plans-wrapper .homy-change-modal[hidden] {
    display: none;
}
#homy-plans-wrapper .homy-change-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(44, 25, 45, 0.55);
    backdrop-filter: blur(3px);
    animation: homy-modal-fade 0.18s ease-out;
}
#homy-plans-wrapper .homy-change-modal-box {
    position: relative;
    background: var(--homy-white, #fff);
    border-radius: 28px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 24px 70px rgba(44, 25, 45, 0.32);
    overflow: hidden;
    animation: homy-modal-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes homy-modal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes homy-modal-pop {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
#homy-plans-wrapper .homy-change-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 26px 28px 18px;
}
#homy-plans-wrapper .homy-change-modal-kicker {
    font-family: var(--homy-font-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--homy-blue, #3CB4E8);
    font-weight: 700;
    margin: 0 0 6px;
}
#homy-plans-wrapper .homy-change-modal-title {
    font-family: var(--homy-font-title);
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--homy-primary, #2C192D);
    margin: 0;
}
#homy-plans-wrapper .homy-change-modal-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: var(--homy-purple, #A17DB3) !important;
    color: #fff !important;
    cursor: pointer;
    border-radius: var(--homy-radius-full);
    transition: background 0.15s ease;
}
#homy-plans-wrapper .homy-change-modal-close:hover {
    background: var(--homy-primary, #2C192D) !important;
}
#homy-plans-wrapper .homy-change-modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: #fff !important;
    fill: none !important;
    stroke-width: 2.5;
}

/* Body */
#homy-plans-wrapper .homy-change-modal-body {
    padding: 4px 28px 24px;
}
#homy-plans-wrapper .homy-change-modal-loading {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}
#homy-plans-wrapper .homy-change-modal-loading .homy-btn-spinner {
    width: 34px;
    height: 34px;
    border-width: 3px;
    border-color: rgba(60, 180, 232, 0.25);
    border-top-color: var(--homy-blue, #3CB4E8);
}
#homy-plans-wrapper .homy-change-modal-error {
    background: #FEECEC;
    border: 1px solid #F5B5B5;
    color: #B91C1C;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
}
#homy-plans-wrapper .homy-change-text {
    font-size: 15px;
    line-height: 1.55;
    color: var(--homy-dark, #2C192D);
    margin: 0 0 18px;
}

/* Bloc principal mis en avant (montant à régler / date de bascule) */
#homy-plans-wrapper .homy-change-highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, rgba(60, 180, 232, 0.12), rgba(161, 125, 179, 0.12));
    border: 1px solid rgba(60, 180, 232, 0.35);
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
#homy-plans-wrapper .homy-change-highlight-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--homy-dark, #2C192D);
    opacity: 0.85;
}
#homy-plans-wrapper .homy-change-highlight-value {
    font-family: var(--homy-font-title);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--homy-blue, #3CB4E8);
    white-space: nowrap;
}

/* Lignes secondaires */
#homy-plans-wrapper .homy-change-recap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 2px 0;
}
#homy-plans-wrapper .homy-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}
#homy-plans-wrapper .homy-change-row-label {
    color: #6b6b6b;
}
#homy-plans-wrapper .homy-change-row-value {
    color: var(--homy-dark, #2C192D);
    font-weight: 600;
}

/* Footer + boutons (priment sur les boutons Elementor) */
#homy-plans-wrapper .homy-change-modal-foot {
    display: flex;
    gap: 12px;
    padding: 18px 28px 26px;
}
#homy-plans-wrapper .homy-change-modal-foot button {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--homy-radius-full);
    font-family: var(--homy-font-primary);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: var(--homy-transition-default, all 0.2s ease);
    -webkit-appearance: none;
    appearance: none;
}
#homy-plans-wrapper button.homy-change-modal-cancel {
    background: var(--homy-white, #fff);
    border: 1.5px solid rgba(44, 25, 45, 0.18);
    color: var(--homy-dark, #2C192D);
}
#homy-plans-wrapper button.homy-change-modal-cancel:hover {
    background: #f5f2f7;
    border-color: rgba(44, 25, 45, 0.3);
}
#homy-plans-wrapper button.homy-change-modal-confirm {
    background: var(--homy-blue, #3CB4E8);
    border: 1.5px solid var(--homy-blue, #3CB4E8);
    color: var(--homy-white, #fff);
    box-shadow: 0 6px 16px rgba(60, 180, 232, 0.3);
}
#homy-plans-wrapper button.homy-change-modal-confirm:hover {
    background: var(--homy-teal, #245F71);
    border-color: var(--homy-teal, #245F71);
}
#homy-plans-wrapper button.homy-change-modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 480px) {
    #homy-plans-wrapper .homy-change-modal-head { padding: 22px 20px 14px; }
    #homy-plans-wrapper .homy-change-modal-body { padding: 4px 20px 20px; }
    #homy-plans-wrapper .homy-change-modal-foot { padding: 14px 20px 22px; flex-direction: column-reverse; }
    #homy-plans-wrapper .homy-change-modal-title { font-size: 23px; }
}