:root {
    --primary-color: #556B2F; /* Vert sauge / cuisine saine */
    --primary-light: #F4F7F2;
    --accent-color: #D9A05B; /* Touche chaleureuse */
    --text-color: #2C3E50;
    --bg-color: #FAFAFA;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--white);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.hero-section {
    max-width: 1100px;
    margin: 50px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        margin: 30px auto;
    }
}

.book-cover-container {
    position: relative;
    box-shadow: var(--shadow);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    transition: transform 0.3s ease;
}

.book-cover-container:hover {
    transform: translateY(-5px);
}

.book-cover-container img {
    width: 100%;
    height: auto;
    display: block;
}

.book-details h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.author {
    font-size: 1.1rem;
    color: #7F8C8D;
    margin-bottom: 20px;
    font-weight: 500;
}

.description {
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
    text-align: justify;
}

@media (max-width: 768px) {
    .description {
        text-align: center;
    }
}

.price-tag {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cta-buttons {
        justify-content: center;
    }
}

.btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(85, 107, 47, 0.3);
}

.btn-primary:hover {
    background-color: #445825;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Modal pour feuilleter le livre */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 900px;
    height: 85vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 15px 20px;
    background-color: var(--primary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.modal-body {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* =========================================================
   LECTEUR PDF
========================================================= */

#pdfViewer {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background: #e5e5e5;
    padding: 20px;
}

.pdf-page {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto 20px auto;

    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdf-loading {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 0.95rem;
}


/* Mobile */

@media (max-width: 768px) {

    #pdfViewer {
        padding: 10px 5px;
    }

    .pdf-page {
        width: 100%;
        margin-bottom: 10px;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
    }

}

.preview-info {
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
    color: #666;
    background-color: #fff;
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid #eaeaea;
    margin-top: 60px;
}

/* =========================================================
   PAGE COMMANDE
========================================================= */

.order-page {
    width: 100%;
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
}

/* Carte principale */

.order-container {
    width: 100%;
    background: var(--white);
    padding: 45px 50px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Titre */

.order-title {
    text-align: center;
    margin-bottom: 40px;
}

.order-title h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.order-title p {
    color: #777;
    font-size: 0.95rem;
}


/* =========================================================
   SECTIONS DU FORMULAIRE
========================================================= */

.form-section {
    border-top: 1px solid #e8e8e8;
    padding-top: 30px;
    margin-top: 30px;
}

.form-section h2 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 22px;
    font-weight: 600;
}

.form-section h2 i {
    width: 25px;
    margin-right: 5px;
}


/* =========================================================
   CHAMPS
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 7px;
    font-size: 0.9rem;
    color: #444;
}

.form-group input {
    width: 100%;
    height: 46px;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background-color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:hover {
    border-color: #bbb;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.08);
}


/* =========================================================
   QUANTITE
========================================================= */

.quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.quantity-row > label {
    font-weight: 500;
    color: #444;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.quantity-control button {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-control button:hover {
    background: #e6ecdf;
}

.quantity-control input {
    width: 50px;
    height: 42px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    background: white;
}


/* =========================================================
   TOTAL
========================================================= */

.total-row {
    margin-top: 25px;
    padding: 20px 0 0;
    border-top: 1px solid #eee;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row span {
    font-size: 1.05rem;
    font-weight: 500;
    color: #555;
}

.total-row strong {
    color: var(--primary-color);
    font-size: 1.7rem;
    font-weight: 700;
}


/* =========================================================
   MODES DE PAIEMENT
========================================================= */

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.payment-option {
    display: block;
    cursor: pointer;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option-content {
    min-height: 100px;

    border: 2px solid #dedede;
    border-radius: 12px;
    padding: 18px 20px;

    display: flex;
    align-items: center;
    gap: 16px;

    transition: all 0.2s ease;
}

.payment-option-content:hover {
    border-color: #b9c4ad;
    background-color: #fcfdfb;
}

.payment-option-content i {
    flex-shrink: 0;
    width: 35px;
    text-align: center;
    font-size: 1.7rem;
    color: var(--primary-color);
}

.payment-option-content strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.98rem;
}

.payment-option-content small {
    display: block;
    color: #777;
    font-size: 0.78rem;
    line-height: 1.4;
}

.payment-option input:checked + .payment-option-content {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 3px 10px rgba(85, 107, 47, 0.08);
}


/* =========================================================
   BOUTON VALIDER
========================================================= */

.order-submit {
    text-align: center;
    margin-top: 40px;
}

.order-submit .btn {
    min-width: 250px;
    justify-content: center;
}

.required-info {
    text-align: center;
    margin-top: 15px;
    font-size: 0.78rem;
    color: #888;
}


/* =========================================================
   MESSAGE D'ERREUR
========================================================= */

.error-message {
    padding: 14px 18px;
    border-radius: 8px;
    background: #fff2f2;
    border: 1px solid #f2cccc;
    color: #b42318;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.error-message i {
    margin-right: 7px;
}


/* =========================================================
   CONFIRMATION DE COMMANDE
========================================================= */

.order-confirmation {
    width: 100%;
    background: var(--white);
    padding: 45px 50px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.success-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 20px;

    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.8rem;
}

.order-confirmation h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.confirmation-text {
    color: #666;
    margin-bottom: 5px;
}

.order-number {
    display: inline-block;
    margin: 18px 0 25px;
    padding: 7px 16px;

    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary-color);

    font-size: 0.9rem;
    font-weight: 600;
}


/* =========================================================
   INFORMATIONS DE PAIEMENT
========================================================= */

.payment-box {
    margin: 0 auto 30px;
    padding: 30px;
    max-width: 620px;

    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
}

.payment-box h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.payment-box > p {
    color: #666;
    font-size: 0.9rem;
}

.payment-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 15px 0 25px;
}

.payment-details {
    text-align: left;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 18px 20px;
    line-height: 2;
    font-size: 0.9rem;
}

.payment-details strong {
    display: inline-block;
    min-width: 130px;
    color: #444;
}

.iban {
    font-family: monospace;
    font-size: 0.95rem;
}

.twint-number {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 18px 0;
}

.payment-note {
    margin-top: 18px;
    color: #777;
    font-size: 0.85rem;
}

.payment-note i {
    color: var(--primary-color);
    margin-right: 5px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .order-page {
        margin: 25px auto;
        padding: 0 15px;
    }

    .order-container,
    .order-confirmation {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .order-title {
        margin-bottom: 30px;
    }

    .order-title h1 {
        font-size: 1.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }

    .quantity-row {
        align-items: center;
    }

    .total-row strong {
        font-size: 1.5rem;
    }

    .payment-box {
        padding: 22px 15px;
    }

    .payment-details {
        font-size: 0.85rem;
    }

    .payment-details strong {
        display: block;
        min-width: auto;
        line-height: 1.3;
        margin-top: 5px;
    }

    .order-confirmation h1 {
        font-size: 1.7rem;
    }

    .order-submit .btn {
        width: 100%;
    }
}