/* ============================================
   TRAILFIT - cart.css
   Panier, badge header, notification, boutique
   ============================================ */

/* ===== BADGE PANIER (header) ===== */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 8px;
    color: #fff;
    border-radius: 50%;
    transition: all .25s;
}

.cart-link:hover {
    color: #8BC53F;
    background: rgba(139, 197, 63, .12);
}

.cart-count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #8BC53F;
    color: #111;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border-radius: 50px;
    transition: transform .2s;
}

.cart-count.is-empty {
    transform: scale(0);
}

/* ===== NOTIFICATION D'AJOUT ===== */
.cart-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 420px;
    padding: 18px 22px;
    background: #1a1a1a;
    border: 1px solid rgba(139, 197, 63, .35);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}

.cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cart-toast-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cart-toast-body strong {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.cart-toast-body span {
    font-size: 13px;
    color: rgba(255, 255, 255, .55);
}

.cart-toast-cta {
    flex-shrink: 0;
    padding: 10px 18px;
    background: #8BC53F;
    color: #111;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 50px;
    white-space: nowrap;
    transition: background .2s;
}

.cart-toast-cta:hover { background: #9bd44f; }

/* ===== PAGE PANIER ===== */
.cart-page {
    padding: 140px 0 100px;
    background: #111;
    min-height: 70vh;
}

.cart-page h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 56px;
    line-height: 1;
    color: #fff;
    margin-bottom: 40px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

.cart-lines {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-row {
    display: grid;
    grid-template-columns: 96px 1fr auto auto;
    gap: 24px;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
}

.cart-row-img {
    display: block;
    width: 96px;
    height: 96px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.cart-row-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-row-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart-row-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    transition: color .2s;
}

.cart-row-name:hover { color: #8BC53F; }

.cart-row-unit {
    font-size: 13px;
    color: rgba(255, 255, 255, .45);
}

.cart-row-remove {
    align-self: flex-start;
    padding: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .35);
    font-size: 13px;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
    transition: color .2s;
}

.cart-row-remove:hover { color: #e05252; }

.cart-row-qty {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    overflow: hidden;
}

.cart-row-qty input {
    width: 48px;
    height: 44px;
    text-align: center;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    -moz-appearance: textfield;
}

.cart-row-qty input::-webkit-outer-spin-button,
.cart-row-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-row-total {
    min-width: 90px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    color: #8BC53F;
    text-align: right;
}

/* ===== RÉCAPITULATIF ===== */
.cart-summary {
    position: sticky;
    top: 100px;
    padding: 32px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
}

.cart-summary h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: 15px;
    color: rgba(255, 255, 255, .6);
}

.cart-summary-row strong {
    color: #fff;
    font-weight: 700;
}

.cart-summary-row strong.free { color: #8BC53F; }

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 20px 0 24px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, .6);
}

.cart-summary-total strong {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    color: #8BC53F;
    line-height: 1;
}

.cart-summary .btn-order { width: 100%; }

.cart-secure {
    margin-top: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, .4);
    text-align: center;
}

.cart-reassurance {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
}

.cart-continue {
    display: block;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    text-align: center;
    transition: color .2s;
}

.cart-continue:hover { color: #8BC53F; }

.cart-error {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(224, 82, 82, .1);
    border: 1px solid rgba(224, 82, 82, .3);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #ff9a9a;
}

/* ===== PANIER VIDE ===== */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
    color: rgba(255, 255, 255, .3);
}

.cart-empty h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    color: #fff;
    letter-spacing: 1px;
}

.cart-empty p {
    font-size: 16px;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 12px;
}

.cart-empty .btn-order { flex: none; }

/* ===== PAGE MERCI ===== */
.thanks-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 140px 20px 80px;
    background: #111;
    text-align: center;
}

.thanks-inner { max-width: 560px; }

.thanks-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 197, 63, .12);
    border: 2px solid #8BC53F;
    border-radius: 50%;
    color: #8BC53F;
}

.thanks-page h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 56px;
    line-height: 1;
    color: #fff;
    margin-bottom: 20px;
}

.thanks-page p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .6);
    margin-bottom: 16px;
}

.thanks-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ===== PAGE BOUTIQUE ===== */
.shop-page {
    padding: 140px 0 100px;
    background: #111;
}

.shop-header {
    max-width: 780px;
    margin-bottom: 56px;
}

.shop-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 64px;
    line-height: 1;
    color: #fff;
    margin-bottom: 20px;
}

.shop-header p {
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .6);
}

.shop-section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    letter-spacing: 1px;
    color: #fff;
    margin: 64px 0 8px;
}

.shop-section-title:first-of-type { margin-top: 0; }

.shop-section-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 32px;
    max-width: 720px;
    line-height: 1.7;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.shop-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    overflow: hidden;
    transition: transform .3s, border-color .3s;
}

.shop-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 197, 63, .35);
}

.shop-card-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: #fff;
    overflow: hidden;
}

.shop-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.shop-card:hover .shop-card-img img { transform: scale(1.05); }

.shop-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 14px;
    background: #8BC53F;
    color: #111;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
}

.shop-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px;
}

.shop-card-body h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 10px;
}

.shop-card-desc {
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 20px;
}

.shop-card-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
}

.shop-card-price .amount {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 34px;
    color: #8BC53F;
    line-height: 1;
}

.shop-card-price .ship {
    font-size: 12px;
    font-weight: 600;
    color: rgba(139, 197, 63, .8);
}

.shop-card-actions {
    display: flex;
    gap: 10px;
}

.shop-card-actions .btn-order {
    flex: 1;
    padding: 12px 20px;
    font-size: 13px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50px;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all .25s;
}

.btn-ghost:hover {
    border-color: #8BC53F;
    color: #8BC53F;
}

/* ===== ÉTAPE COORDONNÉES (commande.html) ===== */
.checkout-page {
    padding: 140px 0 100px;
    background: #111;
    min-height: 70vh;
}

.checkout-page h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 52px;
    line-height: 1;
    color: #fff;
    margin-bottom: 12px;
}

.checkout-intro {
    max-width: 640px;
    margin-bottom: 40px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .55);
}

/* Fil des étapes */
.checkout-steps {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    margin: 0 0 36px;
    padding: 0;
    flex-wrap: wrap;
}

.checkout-steps li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, .35);
}

.checkout-steps li + li::before {
    content: '';
    width: 28px;
    height: 1px;
    background: rgba(255, 255, 255, .18);
    margin-right: 3px;
}

.checkout-steps li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.checkout-steps li.done {
    color: rgba(139, 197, 63, .85);
}

.checkout-steps li.done span {
    background: rgba(139, 197, 63, .15);
    border-color: rgba(139, 197, 63, .5);
    color: #8BC53F;
}

.checkout-steps li.current {
    color: #fff;
}

.checkout-steps li.current span {
    background: #8BC53F;
    border-color: #8BC53F;
    color: #111;
}

/* Disposition */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Formulaire — reprend le langage du formulaire de contact :
   carte translucide, pas de libellés, placeholders seuls. */
.checkout-form {
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
}

/* Ligne à trois champs : code postal / ville / pays */
.form-row-3 {
    grid-template-columns: .8fr 1.3fr 1fr;
}

/* États d'erreur greffés sur les champs du formulaire de contact */
.checkout-form .form-group {
    position: relative;
    margin-bottom: 16px;
}

.checkout-form input.is-invalid,
.checkout-form select.is-invalid {
    border-color: rgba(224, 82, 82, .7);
    background: rgba(224, 82, 82, .06);
}

.field-error {
    display: block;
    margin: 6px 2px 0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #ff9a9a;
}

.field-error:empty { display: none; }

/* Acceptation des CGV */
.checkout-form .checkbox {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 4px 0 4px;
    cursor: pointer;
}

.checkout-form .checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #8BC53F;
    cursor: pointer;
}

.checkout-form .checkbox span {
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .65);
}

.checkout-form .checkbox a {
    color: #8BC53F;
    text-decoration: underline;
}

/* Actions */
.checkout-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* .btn-submit est en width:100% dans style.css — on le laisse
   se partager la ligne avec le lien de retour. */
.checkout-actions .btn-submit { flex: 1; width: auto; min-width: 260px; }

.checkout-back {
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    transition: color .2s;
}

.checkout-back:hover { color: #8BC53F; }

.checkout-legal {
    margin-top: 16px;
    font-size: 12.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .35);
}

.checkout-error {
    margin-top: 16px;
    padding: 13px 15px;
    background: rgba(224, 82, 82, .1);
    border: 1px solid rgba(224, 82, 82, .3);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #ff9a9a;
}


/* Récapitulatif */
.checkout-summary {
    position: sticky;
    top: 100px;
    padding: 28px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
}

.checkout-summary h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 20px;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.checkout-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 12px;
    align-items: center;
}

.checkout-item img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    background: #fff;
    border-radius: 8px;
}

.checkout-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.checkout-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
}

.checkout-item-qty {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .45);
}

.checkout-item-total {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    color: #8BC53F;
}

.checkout-summary .cart-summary-row:first-of-type {
    border-top: 1px solid rgba(255, 255, 255, .1);
}

/* ===== PAGES LÉGALES ===== */
.legal-page {
    padding: 140px 0 100px;
    background: #111;
}

.legal-inner {
    max-width: 820px;
}

.legal-inner h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 52px;
    line-height: 1.05;
    color: #fff;
    margin-bottom: 12px;
}

.legal-updated {
    font-size: 13px;
    color: rgba(255, 255, 255, .35);
    margin-bottom: 48px;
}

.legal-inner h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    letter-spacing: 1px;
    color: #8BC53F;
    margin: 44px 0 16px;
}

.legal-inner h3 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 28px 0 10px;
}

.legal-inner p,
.legal-inner li {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .65);
}

.legal-inner p { margin-bottom: 16px; }

.legal-inner ul,
.legal-inner ol {
    margin: 0 0 20px 22px;
}

.legal-inner li { margin-bottom: 8px; }

.legal-inner a {
    color: #8BC53F;
    text-decoration: underline;
}

.legal-inner strong { color: #fff; }

.legal-inner table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.legal-inner th,
.legal-inner td {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 14px;
    color: rgba(255, 255, 255, .65);
    text-align: left;
}

.legal-inner th {
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-weight: 700;
}

/* Encart signalant une information société à compléter */
.legal-todo {
    display: block;
    padding: 2px 8px;
    background: rgba(255, 193, 7, .15);
    border: 1px dashed rgba(255, 193, 7, .5);
    border-radius: 4px;
    color: #ffc107;
    font-family: monospace;
    font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); }

    /* Le récapitulatif passe au-dessus du formulaire :
       le client voit le montant avant de saisir ses coordonnées. */
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; order: -1; }
}

@media (max-width: 768px) {
    .cart-page { padding: 110px 0 70px; }
    .cart-page h1 { font-size: 40px; }

    .cart-row {
        grid-template-columns: 72px 1fr;
        gap: 16px;
    }

    .cart-row-img { width: 72px; height: 72px; }

    .cart-row-qty { grid-column: 1 / -1; justify-self: start; }

    .cart-row-total {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 26px;
    }

    .shop-grid { grid-template-columns: 1fr; }
    .shop-header h1 { font-size: 44px; }
    .shop-page { padding: 110px 0 70px; }

    .cart-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .cart-toast-cta { text-align: center; }

    .thanks-page h1 { font-size: 40px; }
    .legal-inner h1 { font-size: 38px; }
    .legal-page { padding: 110px 0 70px; }

    .checkout-page { padding: 110px 0 70px; }
    .checkout-page h1 { font-size: 38px; }
    .checkout-form { padding: 24px 20px; border-radius: 18px; }

    /* En mobile, chaque champ occupe toute la largeur */
    .checkout-form .form-row,
    .checkout-form .form-row-3 { grid-template-columns: 1fr; gap: 0; }

    .checkout-actions { flex-direction: column; align-items: stretch; gap: 14px; }
    .checkout-actions .btn-submit { min-width: 0; justify-content: center; }
    .checkout-back { text-align: center; }
    .checkout-steps li { font-size: 11px; letter-spacing: .5px; }
    .checkout-steps li + li::before { width: 14px; }
}
