/* ================================================================
 * 1Defy 2026 — espace Mon compte
 * ================================================================ */

:root {
    --one-defy-account-sticky-offset: 188px;
    --one-defy-account-border: #dde3e7;
    --one-defy-account-muted: #66717a;
    --one-defy-account-radius: 22px;
    --one-defy-account-shadow: 0 10px 28px rgba(17, 31, 19, 0.07);
}

.woocommerce-account .one-defy-account-shell {
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.woocommerce-account .one-defy-account-main,
.woocommerce-account .woocommerce-MyAccount-content {
    min-width: 0;
}

.woocommerce-account .woocommerce-MyAccount-content {
    float: none !important;
    width: auto !important;
}

/* Barre latérale -------------------------------------------------- */

.one-defy-account-sidebar {
    z-index: 2;
}

.one-defy-account-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--one-defy-account-border);
    border-radius: var(--one-defy-account-radius);
    background: linear-gradient(145deg, #f7f9fa 0%, #fff 100%);
    box-shadow: 0 6px 18px rgba(17, 31, 19, 0.05);
}

.one-defy-account-profile__content {
    min-width: 0;
}

.one-defy-account-profile__eyebrow,
.one-defy-account-dashboard__eyebrow,
.one-defy-account-panel__eyebrow,
.one-defy-account-card__eyebrow {
    display: block;
    margin: 0;
    color: #537331;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.35;
    text-transform: uppercase;
}

.one-defy-account-profile__name {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 800;
    line-height: 1.1;
}

.one-defy-account-profile__status {
    display: inline-flex;
    margin-top: 0.45rem;
    color: #315d13;
    font-size: 0.78rem;
    font-weight: 700;
}

.one-defy-ambassador-badge {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: contain;
}

.one-defy-account-menu-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--one-defy-account-border);
    border-radius: 14px;
    background: #fff;
    color: #111;
    font-weight: 700;
}

.one-defy-account-menu-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
}

.one-defy-account-menu-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.one-defy-referral-share {
    max-width: 720px;
    padding: 1.25rem;
    border: 1px solid var(--one-defy-account-border);
    border-radius: 16px;
    background: #f7f9fa;
}

.one-defy-referral-status {
    display: inline-flex;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #e6f6d8;
    color: #315d13;
    font-size: 0.78rem;
    font-weight: 700;
}

.one-defy-account-navigation {
    margin-top: 0.85rem;
    padding: 0.55rem;
    border: 1px solid var(--one-defy-account-border);
    border-radius: var(--one-defy-account-radius);
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 31, 19, 0.04);
}

.one-defy-account-nav__item + .one-defy-account-nav__item {
    margin-top: 0.2rem;
}

.one-defy-account-nav__item.is-logout {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid #edf0f2;
}

.one-defy-account-nav__link,
.one-defy-account-nav__group-title {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    border-radius: 13px;
    color: #202428;
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.one-defy-account-nav__group-title {
    min-height: 40px;
    padding-bottom: 0.45rem;
    color: #111;
    font-size: 0.79rem;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.one-defy-account-nav__group-title.is-current {
    color: #315d13;
}

.one-defy-account-nav__link:hover,
.one-defy-account-nav__link:focus-visible,
.one-defy-account-nav__link.is-current {
    background: #e9f8dd;
    color: #315d13;
}

.one-defy-account-nav__link.is-current {
    box-shadow: inset 3px 0 0 var(--color-brand, #74bc33);
}

.one-defy-account-nav__link .bi,
.one-defy-account-nav__group-title .bi {
    width: 1.1rem;
    flex: 0 0 1.1rem;
    text-align: center;
}

.one-defy-account-nav__children {
    padding: 0 0.25rem 0.35rem 0.8rem;
}

.one-defy-account-nav__link.is-child {
    min-height: 40px;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 550;
}

/* Tableau de bord ------------------------------------------------- */

.one-defy-account-dashboard {
    display: grid;
    gap: 1.5rem;
}

.one-defy-account-dashboard__header {
    padding: 0.15rem 0 0.25rem;
}

.one-defy-account-dashboard__title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.08;
}

.one-defy-account-overview {
    min-width: 0;
}

.one-defy-account-card {
    position: relative;
    display: flex;
    min-height: 290px;
    flex-direction: column;
    padding: 1.4rem;
    overflow: hidden;
    border: 1px solid var(--one-defy-account-border);
    border-radius: var(--one-defy-account-radius);
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 31, 19, 0.045);
}

.one-defy-account-card--loyalty {
    border-color: rgba(116, 188, 51, 0.42);
    background: linear-gradient(145deg, #effbe7 0%, #fff 78%);
}

.one-defy-account-card--professional {
    background: linear-gradient(145deg, #f5f7f8 0%, #fff 78%);
}

.one-defy-account-card__icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: #edf0f2;
    color: #202428;
    font-size: 1.15rem;
}

.one-defy-account-card--loyalty .one-defy-account-card__icon {
    background: #d5f2bd;
    color: #315d13;
}

.one-defy-account-card__title {
    margin: 0.2rem 0 1rem;
    font-size: 1.2rem;
    font-weight: 750;
    line-height: 1.25;
}

.one-defy-account-card__value {
    display: block;
    margin-bottom: 0.65rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.1;
}

.one-defy-account-card__value--points {
    color: #315d13;
}

.one-defy-account-card__value small {
    font-size: 0.8rem;
    font-weight: 700;
}

.one-defy-account-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.65rem;
    margin-bottom: 1.25rem;
    color: var(--one-defy-account-muted);
    font-size: 0.86rem;
}

.one-defy-account-card__meta span:not(:last-child)::after {
    margin-left: 0.65rem;
    color: #b2bbc1;
    content: "•";
}

.one-defy-loyalty-progress {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.one-defy-loyalty-progress .progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(116, 188, 51, 0.18);
}

.one-defy-loyalty-progress .progress-bar {
    border-radius: inherit;
    background: var(--color-brand, #74bc33);
}

.one-defy-account-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin-top: 0.85rem;
}

.one-defy-account-card__links a {
    color: #46515a;
    font-size: 0.78rem;
    text-underline-offset: 3px;
}

.one-defy-referral-link .form-control {
    min-width: 0;
    border-radius: 10px 0 0 10px !important;
    text-overflow: ellipsis;
}

.one-defy-referral-link .btn {
    border-radius: 0 10px 10px 0 !important;
}

/* Avantage ambassadeur ------------------------------------------- */

.one-defy-ambassador-balance {
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border: 1px solid #bce99a;
    border-radius: calc(var(--one-defy-account-radius) + 4px);
    background: linear-gradient(135deg, #f4fcef 0%, #fff 72%);
    box-shadow: var(--one-defy-account-shadow);
}

.one-defy-ambassador-balance__eyebrow {
    color: #4d7d21;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.one-defy-ambassador-status {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.one-defy-ambassador-status.is-active {
    background: #dff5ce;
    color: #315d13;
}

.one-defy-ambassador-status.is-warning {
    background: #fff1c7;
    color: #7a5200;
}

.one-defy-ambassador-status.is-empty,
.one-defy-ambassador-status.is-expired {
    background: #ececec;
    color: #5f5f5f;
}

.one-defy-ambassador-metric {
    padding: 1.15rem;
    border: 1px solid rgba(116, 188, 51, 0.25);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.one-defy-ambassador-balance__amount {
    color: #315d13;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.15;
}

.one-defy-ambassador-code {
    padding: 0.4rem 0.55rem;
    border-radius: 7px;
    background: #f1f1f1;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
}

.one-defy-ambassador-expiry-warning {
    color: #9a6500;
    font-weight: 700;
}

.one-defy-ambassador-usage .progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(116, 188, 51, 0.18);
}

.one-defy-ambassador-usage .progress-bar {
    border-radius: inherit;
    background: var(--color-brand, #74bc33);
}

.one-defy-ambassador-empty {
    padding: 1.25rem;
    border: 1px dashed rgba(116, 188, 51, 0.55);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

/* Panneaux secondaires ------------------------------------------- */

.one-defy-account-panel,
.one-defy-recent-products,
.one-defy-account-activity {
    padding: 1.4rem;
    border: 1px solid var(--one-defy-account-border);
    border-radius: var(--one-defy-account-radius);
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 31, 19, 0.04);
}

.one-defy-account-panel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.one-defy-account-panel__title {
    margin: 0.2rem 0 0;
    font-size: clamp(1.2rem, 2.4vw, 1.55rem);
    font-weight: 750;
}

.one-defy-account-panel__all-link {
    flex: 0 0 auto;
    color: #222;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.one-defy-account-panel__all-link:hover,
.one-defy-account-panel__all-link:focus-visible {
    color: #4d7d21;
}

.one-defy-coupon-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px dashed rgba(116, 188, 51, 0.6);
    border-radius: 14px;
    background: #f8fcf5;
}

.one-defy-coupon-card code {
    color: #111;
    font-weight: 800;
}

.one-defy-coupon-card.is-used,
.one-defy-coupon-card.is-exhausted {
    border-color: #c9ced2;
    background: #f4f5f5;
}

.one-defy-coupon-card.is-used code,
.one-defy-coupon-card.is-exhausted code {
    color: #656b70;
}

.one-defy-coupon-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
}

.one-defy-coupon-status.is-available {
    color: #315f0d;
    background: #dff4ca;
}

.one-defy-coupon-status.is-used {
    color: #555d63;
    background: #e5e7e8;
}

.one-defy-coupon-status.is-exhausted {
    color: #fff;
    background: #697177;
}

.one-defy-coupon-row.is-used > *,
.one-defy-coupon-row.is-exhausted > * {
    color: #687076;
    background-color: #f7f7f7;
}

.one-defy-coupons-empty {
    padding: 1rem 1.1rem;
    border: 1px solid #e1e5e8;
    border-radius: 14px;
    background: #f8f9f9;
}

.one-defy-account-activity {
    padding: 0;
    overflow: hidden;
}

.one-defy-account-activity summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    font-weight: 750;
    list-style: none;
}

.one-defy-account-activity summary::-webkit-details-marker {
    display: none;
}

.one-defy-account-activity summary::after {
    color: #5f6970;
    content: "\F282";
    font-family: "bootstrap-icons";
    transition: transform 0.2s ease;
}

.one-defy-account-activity[open] summary::after {
    transform: rotate(180deg);
}

.one-defy-account-activity__count {
    margin-left: auto;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: #edf0f2;
    font-size: 0.78rem;
}

.one-defy-account-activity__content {
    padding: 0 1.4rem 1rem;
}

.one-defy-account-activity__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-top: 1px solid #edf0f2;
}

/* Produits récemment consultés ----------------------------------- */

.one-defy-recent-products {
    min-width: 0;
    overflow: hidden;
}

.one-defy-recent-products__slider {
    overflow: visible;
    padding-bottom: 1.25rem;
}

.one-defy-recent-products__slider .swiper-slide {
    height: auto;
}

.one-defy-recent-products__slider .swiper-slide > .product-card {
    height: 100%;
    margin-bottom: 0 !important;
}

.one-defy-recent-products__slider .product-card .product-thumb > div {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.one-defy-recent-products__slider .product-info {
    padding: 0 0.5rem 0.5rem;
}

.one-defy-recent-products__slider .swiper-scrollbar {
    bottom: 0;
    height: 4px;
    background: #e6eaed;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.one-defy-recent-products__slider.swiper-initialized .swiper-scrollbar {
    opacity: 1;
}

.one-defy-recent-products__slider .swiper-scrollbar-drag {
    background: var(--color-brand, #74bc33);
}

/* Messages et écrans WooCommerce -------------------------------- */

.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-message {
    position: relative;
    right: auto;
    width: 100%;
    border-radius: 14px;
}

.woocommerce-account .woocommerce-MyAccount-content > .container,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-codes-promo.container {
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

/* Responsive ----------------------------------------------------- */

@media (min-width: 768px) {
    .one-defy-recent-products__slider {
        overflow: hidden;
        padding-bottom: 0;
    }

    .one-defy-recent-products__slider .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        transform: none !important;
    }

    .one-defy-recent-products__slider .swiper-slide {
        width: auto !important;
        margin: 0 !important;
    }
}

@media (min-width: 992px) {
    .one-defy-account-sidebar {
        position: sticky;
        top: var(--one-defy-account-sticky-offset);
        z-index: 2;
        max-height: calc(100vh - var(--one-defy-account-sticky-offset) - 1rem);
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

@media (min-width: 1200px) {
    .one-defy-recent-products__slider .swiper-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .woocommerce-account .one-defy-account-shell {
        margin-top: 1.25rem;
        margin-bottom: 2.5rem;
    }

    .one-defy-account-dashboard {
        gap: 1.15rem;
    }

    .one-defy-account-dashboard__header {
        padding-top: 0;
    }

    .one-defy-account-card {
        min-height: 0;
    }

    .one-defy-account-panel__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .one-defy-account-panel__all-link {
        align-self: flex-start;
    }

    .one-defy-ambassador-balance {
        padding: 1.4rem;
    }

    .one-defy-recent-products__slider:not(.swiper-initialized) {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .one-defy-recent-products__slider:not(.swiper-initialized)::-webkit-scrollbar {
        display: none;
    }

    .one-defy-recent-products__slider:not(.swiper-initialized) .swiper-wrapper {
        gap: 1rem;
    }

    .one-defy-recent-products__slider:not(.swiper-initialized) .swiper-slide {
        width: 88% !important;
        flex: 0 0 88%;
        scroll-snap-align: start;
    }

    .one-defy-recent-products__slider.is-single-slide .swiper-slide {
        width: 100% !important;
        flex-basis: 100%;
    }
}

@media (max-width: 399.98px) {
    .one-defy-account-profile {
        align-items: flex-start;
    }

    .one-defy-ambassador-badge {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .one-defy-account-card,
    .one-defy-account-panel,
    .one-defy-recent-products {
        padding: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .one-defy-account-menu-toggle .bi-chevron-down,
    .one-defy-account-activity summary::after,
    .one-defy-account-nav__link {
        transition: none;
    }
}
