@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&family=Lemonada:wght@300..700&display=swap');

*, ::before, ::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-margin: 100px;
}

:root {
    --white: #fff;
    --pink: #e1007a;
    --green: #46a12a;
    --yellow: #ee8303;
    --blue: #009de0;
    --black: #111;
    --grey: #888;
    --navy: #0a192f;
}

body {
    font-family: "Cairo", serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--black);
    background-color: var(--white);
    direction: rtl;
    text-align: right;
}

main {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

main img {
    width: 100%;
}

.main_container {
    width: 100%;
    max-width: 800px;
    margin: 0px auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
}

.main_container_title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.main_container_title div {
    margin: 10px 0;
}

.main_container_title p,
.main_container_title p strong,
.main_container_title p span,
.main_container_title ul li {
    font-size: 1.8rem;
    line-height: 1.8;
}

.main_container_title p span {
    font-size: 2rem;
    color: #ff0000;
}

.main_container_title ul .red {
    color: #ff0000;
    font-size: 1.8rem;
}

.product_description {
    padding: 0 40px;
}

.main_container_title .product_description_text {
    font-size: 2.4rem;
    margin-top: 20px;
    text-align: center;
    color: #ff0000;
    font-weight: 900;
}


.main_container h1, .main_container h3 {
    color: #333;
    text-align: center;
}

.main_container h1 {
    font-size: 3.2rem;
}

.main_container h3 {
    font-size: 3rem;
}

form {
    margin-top: 10px;
    padding: 0 40px;
}

form div {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

label span {
    color: #ff0000;
    font-size: 1.6rem;
    margin: 0 3px;
} 

label .facultatif {
    font-size: 1.2rem;
    font-weight: 500;
    margin-right: 10px;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

select option {
    padding: 10px;
    font-size: 16px;
    text-align: center;
} 

input:focus,
select:focus {
    border-color: #888;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    resize: none;
}

/* Styles de base pour la table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    font-size: 16px;
    text-align: left;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* En-tête du tableau */
thead {
    background-color: #fff;
    color: #333;
}

thead th {
    padding: 10px;
    text-transform: uppercase;
    font-size: 1.6rem;
    text-align: center;
    border: 1px solid #ccc;
    white-space: nowrap;
}

/* Lignes du corps du tableau */


/* Cellules du tableau */
.products td, 
.products th {
    padding: 12px;
    border: 1px solid #ccc;
    font-size: 1.6rem;
}

.products td {
    text-align: right;

}

.products .quantity {
    text-align: center;
}

/* Champs d'entrée pour la quantité */
.products input[type="number"] {
    width: 80px;
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.products input[type="number"]:focus {
    border-color: #ccc;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}


.btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    display: block;
    width: 300px;
    padding: 10px;
    background-color: red;
    color: white;
    border: 1px solid red;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 30px;
    font-family: "Cairo", serif;
    transition: all 0.3s;
}

button:hover {
    background: rgb(196, 11, 11);
}

.books {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 500px;
}

.books input {
    width: 100px; 
    margin: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Arrière-plan assombri */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fond noir semi-transparent */
    display: none; /* Masqué par défaut */
    z-index: 999; /* Au-dessus de tout le contenu */
}

/* Conteneur du message */
#responseMessage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centrer le message */
    background: #fff; /* Fond blanc */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: none; /* Masqué par défaut */
    z-index: 1000; /* Au-dessus de l'overlay */
    width: 90%; /* Réduction sur petits écrans */
    max-width: 400px; /* Largeur maximale */
}

#responseMessage img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

#responseMessage p {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0;
}

#responseMessage.success {
    background: linear-gradient(135deg, #d4f3d4, #a4e4a4);
    color: #1a7f1a;
    border: 1px solid #8fd98f;
}

#responseMessage.error {
    background: linear-gradient(135deg, #f9dede, #f7aaaa);
    color: #a70000;
    border: 1px solid #f58b8b;
}

#responseMessage.active {
    opacity: 1;
    transform: translateY(0);
}

.error-message {
    color: #ff0000;
    font-size: 1.4rem;
    text-align: center;
}




@media screen and (max-width: 860px) {
    .main_container {
        box-shadow: none;
    }

    .main_container h1 {
        font-size: 3.4rem;
    }
}

@media screen and (max-width: 768px) {
    
  
    .main_container h1 {
        font-size: 3.2rem;
    }
}

@media screen and (max-width: 576px) {

    .main_container h1 {
        font-size: 3rem;
    }

    .main_container h3 {
        font-size: 3rem;
    }

    label {
        font-size: 1.6rem;
    }

    button {
        font-size: 1.6rem;
    }

    .product_description, form {
        padding: 0 20px;
    }

    .main_container_title p, .main_container_title p strong, .main_container_title p span, .main_container_title ul li {
        font-size: 1.7rem;
    }
}


@media screen and (max-width: 480px) {
    #responseMessage {
        max-width: 300px;
        padding: 15px;
    }

    #responseMessage p {
        font-size: 1.6rem;
    }
    
    .books {
        width: 100%;
    }
    
    .main_container_title p, .main_container_title p strong, .main_container_title p span, .main_container_title ul li {
        font-size: 1.6rem;
    }

    .product_description, form {
        padding: 0 10px;
    }
}