﻿/* =========================================
   WPE — Responsive hardening
========================================= */

.container,
.container-fluid {
    width: min(100%, 1320px);
}

@media (max-width: 1399.98px) {
    .container,
    .container-fluid,
    .wpe-shell {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 575.98px) {
    .container,
    .container-fluid,
    .wpe-shell {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* -----------------------------------------
   Layout général
----------------------------------------- */

.wpe-main .row {
    --bs-gutter-y: 1.25rem;
}

@media (max-width: 991.98px) {
    .wpe-main .row {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

@media (max-width: 575.98px) {
    .wpe-main .row {
        --bs-gutter-x: 0.85rem;
        --bs-gutter-y: 0.85rem;
    }
}

/* -----------------------------------------
   Navbar mobile / tablette
----------------------------------------- */

@media (max-width: 991.98px) {
    #mainNavbar .navbar-nav {
        width: 100%;
    }

    #mainNavbar .nav-item {
        width: 100%;
    }

    #mainNavbar .nav-link {
        display: block;
        width: 100%;
    }

    #mainNavbar .wpe-nav-actions {
        padding-top: 0.2rem;
    }
}

@media (max-width: 767.98px) {
    #mainNavbar {
        margin-top: 0.75rem;
    }

        #mainNavbar .wpe-cart-link {
            margin-top: 4px;
        }

        #mainNavbar .btn.btn-link.nav-link {
            text-align: left;
        }
}

@media (max-width: 575.98px) {
    .navbar-brand.wpe-brand-text {
        align-items: center;
    }

    .wpe-toggler {
        padding: 0.3rem 0.5rem;
    }
}

/* -----------------------------------------
   Footer
----------------------------------------- */

@media (max-width: 991.98px) {
    .wpe-footer-title {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .wpe-footer .row.g-4 {
        --bs-gutter-y: 1.25rem;
    }

    .wpe-footer-card {
        overflow: hidden;
    }
}

@media (max-width: 575.98px) {
    .wpe-footer-title {
        font-size: clamp(1.7rem, 9vw, 2.25rem);
    }

    .wpe-footer-links {
        gap: 0.45rem;
    }
}

/* -----------------------------------------
   Titres / sections
----------------------------------------- */

@media (max-width: 991.98px) {
    .wpe-display-title {
        font-size: clamp(2.4rem, 6vw, 4rem);
    }
}

@media (max-width: 767.98px) {
    .wpe-kicker {
        font-size: 0.92rem;
        letter-spacing: 0.12em;
    }

    .wpe-display-title {
        font-size: clamp(2.1rem, 9vw, 3rem);
    }
}

@media (max-width: 575.98px) {
    .wpe-title {
        font-size: clamp(2rem, 9vw, 2.4rem);
        line-height: 1.08;
    }

    .wpe-section-title {
        font-size: clamp(1.7rem, 8vw, 2.05rem);
        line-height: 1.08;
    }

    .wpe-lead {
        font-size: 0.95rem;
    }
}

/* -----------------------------------------
   Boutons mobile
----------------------------------------- */

@media (max-width: 767.98px) {
    .btn.btn-lg,
    .btn.w-100,
    .wpe-btn-block {
        min-height: 46px;
    }

    .d-flex.gap-2 > .btn,
    .d-flex.gap-3 > .btn {
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .d-flex.flex-wrap.gap-2 > .btn,
    .d-flex.flex-wrap.gap-3 > .btn {
        width: 100%;
    }

    .wpe-actions > .btn,
    .wpe-actions > a,
    .wpe-actions > form {
        width: 100%;
    }

    .wpe-actions form .btn {
        width: 100%;
    }
}

/* -----------------------------------------
   Cartes produits / boutique / promotions
----------------------------------------- */

.book-card,
.wpe-card-premium {
    min-width: 0;
}

    .book-card .card-body,
    .wpe-card-premium {
        overflow-wrap: anywhere;
    }

@media (max-width: 991.98px) {
    .book-card .card-title,
    .book-card .wpe-card-title {
        font-size: 1.35rem;
        line-height: 1.15;
    }
}

@media (max-width: 767.98px) {
    .book-card .btn,
    .book-card .wpe-btn-primary,
    .book-card .wpe-btn-secondary,
    .book-card .wpe-btn-ghost {
        width: 100%;
    }

    .book-card .price-display {
        gap: 0.35rem;
    }

    .book-card .price-new {
        font-size: 1.12rem;
    }
}

@media (max-width: 575.98px) {
    .book-card .card-img-top,
    .book-card img {
        width: 100%;
        object-fit: cover;
    }

    .book-card .card-body {
        padding: 1rem;
    }
}

/* -----------------------------------------
   Images et médias
----------------------------------------- */

img,
.card-img-top,
.book-cover-sm,
.book-details-image {
    max-width: 100%;
    height: auto;
}

@media (max-width: 767.98px) {
    .book-details-image {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}

/* -----------------------------------------
   Tables et tableaux admin
----------------------------------------- */

.table-responsive,
.wpe-table-wrap {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .wpe-table-wrap {
        overflow-x: auto;
    }
}

@media (max-width: 767.98px) {
    .table-responsive {
        overflow-x: auto;
    }

        .table-responsive > .table,
        .wpe-table-wrap > .table,
        .wpe-table-wrap > .wpe-admin-table {
            min-width: 700px;
        }

    .wpe-admin-table thead th,
    .wpe-admin-table tbody td {
        white-space: nowrap;
    }

    .table .btn-sm {
        min-height: 38px;
    }
}

@media (max-width: 575.98px) {
    .table-responsive > .table,
    .wpe-table-wrap > .table,
    .wpe-table-wrap > .wpe-admin-table {
        min-width: 640px;
    }
}

/* -----------------------------------------
   Panier
----------------------------------------- */

@media (max-width: 767.98px) {
    .book-cover-sm {
        width: 52px;
        height: 74px;
        object-fit: cover;
    }

    .table td .d-flex.align-items-center.gap-3 {
        min-width: 220px;
    }
}

@media (max-width: 575.98px) {
    .book-cover-sm {
        width: 46px;
        height: 66px;
    }
}

/* -----------------------------------------
   Checkout
----------------------------------------- */

@media (max-width: 767.98px) {
    .list-group-item .d-flex.justify-content-between,
    .list-group-item .d-flex.justify-content-between.gap-3 {
        flex-wrap: wrap;
        gap: 0.35rem !important;
    }

    .list-group-item .text-end {
        text-align: left !important;
    }
}

/* -----------------------------------------
   Formulaires
----------------------------------------- */

@media (max-width: 767.98px) {
    .form-control,
    .form-select,
    textarea {
        min-height: 48px;
        font-size: 16px !important;
    }

        textarea.form-control {
            min-height: 120px;
        }

    .wpe-form-panel .row,
    .wpe-admin-panel .row {
        --bs-gutter-y: 0.85rem;
    }
}

/* -----------------------------------------
   Admin forms
----------------------------------------- */

@media (max-width: 767.98px) {
    .wpe-admin-page {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .wpe-admin-header {
        margin-bottom: 1rem;
    }

    .wpe-admin-actions {
        flex-direction: column;
    }

        .wpe-admin-actions .btn {
            width: 100%;
        }
}

/* -----------------------------------------
   Blocs flex fréquents
----------------------------------------- */

@media (max-width: 767.98px) {
    .d-flex.justify-content-between.align-items-center.flex-wrap.gap-2,
    .d-flex.justify-content-between.align-items-center.mb-4.flex-wrap.gap-2,
    .d-flex.justify-content-between.align-items-center.mb-3.flex-wrap.gap-2 {
        align-items: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    .d-flex.justify-content-between.align-items-center.flex-wrap.gap-2 > .btn,
    .d-flex.justify-content-between.align-items-center.mb-4.flex-wrap.gap-2 > .btn,
    .d-flex.justify-content-between.align-items-center.mb-3.flex-wrap.gap-2 > .btn {
        width: 100%;
    }
}

/* -----------------------------------------
   Sécurité de débordement texte
----------------------------------------- */

.wpe-page,
.wpe-section,
.wpe-page-header,
.wpe-surface,
.wpe-card-premium,
.wpe-admin-panel,
.wpe-form-panel,
.wpe-footer-card,
.card,
.table td,
.table th {
    overflow-wrap: break-word;
}

@media (max-width: 575.98px) {
    .wpe-footer-bottom span,
    .wpe-meta,
    .wpe-muted {
        word-break: break-word;
    }
}

/* -----------------------------------------
   Home safety
----------------------------------------- */

@media (max-width: 991.98px) {
    .home-page {
        padding: 18px 0 52px;
    }

        .home-page::before {
            width: min(1220px, calc(100% - 16px));
        }

    .home-hero,
    .home-hero-content {
        min-height: 620px;
    }
}

@media (max-width: 767.98px) {
    .home-page {
        padding: 14px 0 40px;
    }

        .home-page::before {
            width: calc(100% - 12px);
            border-radius: 20px;
        }

    .home-stack {
        gap: 18px;
    }

    .home-section {
        padding: 18px 16px 20px;
        border-radius: 14px;
    }

    .home-hero,
    .home-hero-content {
        min-height: 540px;
        border-radius: 14px;
    }

    .home-hero-content {
        padding: 42px 18px 46px;
    }

    .home-btn-gold,
    .home-btn-outline,
    .home-btn-outline-large {
        width: 100%;
        min-width: 0;
    }

    .home-stack > .home-section:nth-child(2) .text-center.mt-4,
    .home-stack > .home-section:nth-child(2) .text-center.mt-4.mt-lg-5 {
        margin-top: 300px !important;
    }
}

@media (max-width: 575.98px) {
    .home-hero,
    .home-hero-content {
        min-height: 500px;
    }

    .home-hero-title {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .home-hero-subtitle {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    .home-stack > .home-section:nth-child(2) .text-center.mt-4,
    .home-stack > .home-section:nth-child(2) .text-center.mt-4.mt-lg-5 {
        margin-top: 220px !important;
    }
}
