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

/* ── Page liste des ventes ── */
.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 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;
    font-size: .82rem;
}
.tarif-item .tarif-label { color: #6b7280; }
.tarif-item .tarif-price { font-weight: 700; color: #111827; }

.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__qty {
    display: grid;
    gap: .35rem;
    margin-top: .85rem;
    max-width: 190px;
}

.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-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 1.5rem;
    position: sticky;
    top: 90px;
}
.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); }

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

.cotisation-check-block {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: .95rem 1rem;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 10px;
}

.cotisation-check-label {
    font-size: .92rem;
    color: #312e81;
    line-height: 1.45;
}

/* 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.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;
}
.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-card {
        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;
    }

    .purchase-item__qty {
        max-width: none;
    }

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

