/* ============================================================
   Ventes en ligne — Styles front-end
   ============================================================ */

/* ── Page liste des ventes ── */
.hero {
    position: relative;
    background: transparent;
    overflow: hidden;
    padding: 24px 20px 10px;
    text-align: center;
}

.hero h1 {
    font-family: var(--font-display, "OpenSans-Black", sans-serif);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    color: var(--primary-dark, #232340);
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-bottom: 8px;
}

.hero h1 .accent {
    color: var(--accent, #454796);
    background: none;
    -webkit-text-fill-color: initial;
}

.hero-sub {
    font-family: var(--font-body, "OpenSans-Regular", sans-serif);
    font-size: 16px;
    color: var(--text-light, #6b6f8a);
    max-width: 480px;
    margin: 0 auto 16px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.ventes-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 5rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ventes-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, .25) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(16, 185, 129, .15) 0%, transparent 60%);
    pointer-events: none;
}

.ventes-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    position: relative;
}

.ventes-hero p {
    color: rgba(255, 255, 255, .75);
    font-size: 1.1rem;
    position: relative;
}

.ventes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2.5rem 0;
}

.vente-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .07);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}

.vente-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
}

.vente-card-header {
    background: linear-gradient(135deg, var(--primary-color, #1a1a2e), #0f3460);
    color: #fff;
    padding: 1.25rem 1.5rem;
    position: relative;
}

.vente-card-header .badge-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, .25);
    border: 1px solid rgba(16, 185, 129, .4);
    color: #a7f3d0;
    border-radius: 20px;
    padding: .25rem .75rem;
    font-size: .75rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.vente-card-header .badge-active::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(1.3);
    }
}

.vente-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.vente-card-ref {
    font-family: monospace;
    font-size: .8rem;
    opacity: .6;
    margin-top: .25rem;
}

.vente-card-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.vente-dates {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: #6b7280;
}

.vente-dates span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vente-description {
    font-size: .9rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tarifs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.tarif-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: .5rem .75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
}

.tarif-item .tarif-label {
    color: #6b7280;
    white-space: nowrap;
}

.tarif-item .tarif-price {
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.vente-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0f0;
}

/* ── Page achat ── */
.achat-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: #fff;
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.achat-hero h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
    font-weight: 800;
}

.achat-hero .ref-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 20px;
    padding: .3rem 1rem;
    font-family: monospace;
    font-size: .85rem;
    margin-bottom: 1rem;
}

.achat-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
}

@media (max-width: 860px) {
    .achat-layout {
        grid-template-columns: 1fr;
    }
}

.achat-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.achat-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color, #1a1a2e);
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchase-items {
    display: grid;
    gap: 1rem;
}

.purchase-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1rem .9rem;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.purchase-item__head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.purchase-item__title {
    font-weight: 800;
    color: #111827;
}

.purchase-item__meta {
    margin-top: .2rem;
    font-size: .78rem;
    color: #6b7280;
}

.purchase-item__price {
    font-weight: 800;
    color: var(--primary-color, #0f3460);
    white-space: nowrap;
}

.purchase-item__description {
    margin-top: .7rem;
    color: #4b5563;
    font-size: .88rem;
    line-height: 1.55;
}

.purchase-item__options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    margin-top: .85rem;
}

.purchase-item__qty,
.purchase-item__taille {
    display: grid;
    gap: .35rem;
    margin-top: 0;
    max-width: 190px;
    flex: 1 1 140px;
}

.purchase-item__image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.purchase-item__image-wrap {
    display: inline-block;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Section Accompagnants ── */
.purchase-item__accompagnants {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.accompagnant-pair {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.accompagnant-pair__header {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.recap-items {
    display: grid;
    gap: .4rem;
    margin: .25rem 0 .35rem;
}

.recap-item-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .86rem;
    color: #374151;
}

/* Tarif selector */
.tarif-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 0;
}

@media (max-width: 500px) {
    .tarif-selector {
        grid-template-columns: 1fr;
    }
}

.tarif-option {
    position: relative;
}

.tarif-option input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tarif-option label {
    display: flex;
    flex-direction: column;
    padding: .9rem 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.tarif-option input:checked+label {
    border-color: var(--primary-color, #0f3460);
    background: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, .15);
}

.tarif-option label .tarif-name {
    font-weight: 700;
    font-size: .9rem;
    color: #111827;
}

.tarif-option label .tarif-desc {
    font-size: .76rem;
    color: #6b7280;
    margin-top: 2px;
}

.tarif-option label .tarif-amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color, #0f3460);
    margin-top: 6px;
}

.tarif-option.disabled label {
    opacity: .4;
    pointer-events: none;
    cursor: not-allowed;
}

/* Récapitulatif */
.recap-sticky-wrap {
    position: sticky;
    top: 90px;
    align-self: start;
}

.recap-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    padding: 1.5rem;
}

.recap-card h4 {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.recap-line {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.recap-line:last-of-type {
    border-bottom: none;
}

.recap-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 800;
    color: #111827;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 2px solid #e5e7eb;
}

.recap-total .amount {
    color: var(--primary-color, #0f3460);
}

.recap-card--spaced {
    margin-top: 1.5rem;
}

/* Conjoint toggle */
.conjoint-block {
    background: #f8fafc;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.vente-coords-readonly {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.vente-coords-readonly p {
    margin: 0 0 .3rem;
    color: #1f2937;
}

.vente-coords-readonly p:first-child {
    font-weight: 700;
}

.vente-coords-edit-link {
    display: inline-block;
    margin-top: .5rem;
    font-size: .85rem;
    font-weight: 600;
}

.cotisation-check-block {
    display: flex;
    gap: .8rem;
    align-items: center;
    margin-top: 1rem;
    padding: .95rem 1.1rem;
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cotisation-check-block:hover {
    border-color: #454796;
    background: #e0e7ff;
}

.cotisation-check-block input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-color: #ffffff;
    border: 2px solid #454796;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.2s ease;
    margin: 0;
}

.cotisation-check-block input[type="checkbox"]:checked {
    background-color: #454796;
    border-color: #454796;
}

.cotisation-check-block input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.cotisation-check-label {
    font-size: .95rem;
    font-weight: 600;
    color: #312e81;
    line-height: 1.45;
    cursor: pointer;
    user-select: none;
}

/* Alert */
.vente-alert {
    padding: .9rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.vente-alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border-left: 4px solid #3b82f6;
}

.vente-alert a,
.vente-login-link {
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.vente-alert a:hover,
.vente-login-link:hover {
    color: #1e40af !important;
    text-decoration: underline !important;
}

.vente-alert.success {
    background: #f0fdf4;
    color: #15803d;
    border-left: 4px solid #22c55e;
}

.vente-alert.danger {
    background: #fef2f2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

.vente-alert.warning {
    background: #fefce8;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* Submit btn */
.btn-achat {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
}

.btn-achat i,
.btn-achat svg {
    display: inline-flex;
    align-items: center;
    font-size: 1.15em;
    line-height: 1;
    margin-top: -1px;
}

.btn-achat:hover {
    opacity: .9;
    transform: translateY(-1px);
}

/* Confirmation */
.confirmation-wrap {
    max-width: 580px;
    margin: 4rem auto;
    text-align: center;
    padding: 0 1.5rem;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
}

.confirmation-icon.success {
    background: #dcfce7;
    color: #16a34a;
}

.confirmation-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Mobile fixes ── */
@media (max-width: 600px) {

    /* Reduce excessive hero padding on mobile */
    .ventes-hero {
        padding: 3rem 1rem 2rem;
    }

    /* Force single column product listing */
    .ventes-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem 0;
    }

    /* Remove sticky recap card — it blocks content on mobile */
    .recap-sticky-wrap {
        position: static;
        top: auto;
    }

    /* Tarifs grid wraps naturally */
    .tarifs-grid {
        grid-template-columns: 1fr;
    }

    /* Purchase layout full width */
    .achat-layout {
        padding: 1.5rem 1rem;
    }

    /* Section cards tighter */
    .achat-section {
        padding: 1.25rem;
    }

    .purchase-item__head {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .purchase-item__image-wrap {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .purchase-item__image {
        width: 140px;
        height: 140px;
        border-radius: 12px;
    }

    /* Tous les champs en plein écran sur mobile */
    .purchase-item__taille,
    .purchase-item__qty {
        max-width: 100%;
        width: 100%;
    }

    .purchase-item__taille select,
    .purchase-item__qty input {
        width: 100%;
    }

    .accompagnant-pair {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    /* Vente card body tighter */
    .vente-card-body {
        padding: 1rem;
    }

    .vente-card-header {
        padding: 1rem;
    }

    .vente-card-footer {
        padding: 0.75rem 1rem;
    }

    /* Hero badge smaller */
    .achat-hero {
        padding: 2.5rem 1rem 2rem;
    }
}

/* ── Modal (Payment) ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 32, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 460px;
    border-radius: 20px;
    padding: 40px;
    position: relative;
    box-shadow: 0 40px 80px rgba(12, 12, 32, 0.4);
    animation: slideUp 0.38s cubic-bezier(0.22, 0.68, 0, 1.2);
}

@keyframes slideUp {
    from {
        transform: translateY(32px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f5f6fc;
    border: 1px solid #e2e4f0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #6b6f8a;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.modal-close:hover {
    transform: rotate(90deg);
    color: #0f3460;
    background: #eef0ff;
}

.pay-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.22s;
    border: 2px solid transparent;
    cursor: pointer;
}

.pay-btn-outline {
    background: #fff;
    color: #1a1a2e;
    border-color: #e2e4f0;
}

.pay-btn-outline:hover {
    border-color: #0f3460;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 52, 96, 0.1);
}

.pay-btn-primary {
    background: #10b981;
    color: #fff;
}

.pay-btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

/* ── Coordonnées Grid & Phone Input ── */
.coords-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.coords-grid--full {
    grid-column: 1 / -1;
}

.coords-grid .iti,
#venteForm .iti {
    width: 100% !important;
    display: block !important;
}

.coords-grid .iti input.intl-phone,
#venteForm .iti input.intl-phone,
#venteForm input[type="tel"] {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 600px) {
    .coords-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Variantes de bandeau (page d'achat) ── */
.vente-alert.vente-alert--spaced {
    margin-top: 12px;
}

/* Offre « 1 € la première année » */
.vente-alert.vente-alert--offer {
    margin-top: 8px;
    border-color: #dc2626;
}

.vente-alert .vente-alert__accent {
    color: #dc2626;
}

/* ── Zoom sur l'image d'un produit ── */
.modal-overlay.image-zoom {
    z-index: 99999;
}

.image-zoom__dialog {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #181824;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.image-zoom__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    color: #181824;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.image-zoom__img {
    max-width: 85vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.image-zoom__caption {
    color: #ffffff;
    font-weight: 600;
    margin-top: 12px;
    font-size: 15px;
}

/* Article complet (stock total atteint, cf. Produit::stockMax) */
.purchase-item--complet {
    opacity: .55;
    filter: grayscale(1);
    pointer-events: none;
}
.purchase-item__complet {
    display: inline-block;
    margin-left: .5rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: #b91c1c;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}
