:root {
    --primary-color: #FFB800FF; /* Beige-marron du logo et boutons */
    --secondary-color: #F8F5F1; /* Arrière-plan clair */
    --text-color: #333;
    --light-grey: #E0E0E0;
    --dark-grey: #666;
    --green-success: #4CAF50;
    --red-error: #F44336;
    --border-radius: 8px;
    --padding-base: 15px;
}
body, body *{
    font-family: 'Montserrat', sans-serif !important;
}
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    /* background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><circle cx="50" cy="50" r="40" fill="none" stroke="%23A37F5A" stroke-width="2"/><path d="M50 10 L60 20 L50 30 L40 20 Z" fill="%23A37F5A"/><path d="M50 90 L60 80 L50 70 L40 80 Z" fill="%23A37F5A"/></svg>'); */
    background-size: 80px; /* Adjust as needed for the pattern */
    background-repeat: repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding-base);
}
.container-fluid{
     max-width: 100% ;
    margin: 0 ;
    padding: 0;
}
/* Header */
.header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.logo {
    flex: 1;
    text-align: center;
}
.logo img {
    height: 60px;
}

.categories {
    /*display: flex;*/
	display: none;
    gap: 10px;
    background-color: var(--secondary-color);
	padding: 10px;
    border-radius: var(--border-radius);
    justify-content: center;
    margin: 30px;
}

.category-btn {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    color: var(--dark-grey);
    transition: all 0.2s ease;
    white-space: nowrap; /* Prevent wrapping */
	background-color: #FFFFFF;
}

.category-btn:hover {
    background-color: rgba(var(--primary-color), 0.1);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--padding-base);
    padding-bottom: 80px; /* Space for the fixed footer */
}

.product-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
	border:1px solid #000;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, crop if necessary */
    display: block;
}

.product-details {
    padding: var(--padding-base);
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows details to take available space */
}

.product-category {
    background-color: var(--light-grey);
    color: var(--dark-grey);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    width: fit-content;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.product-price {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--padding-base);
}

.product-price .unit {
    font-size: 0.8em;
    font-weight: 400;
    color: var(--dark-grey);
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 120px; /* Fixed width for selector */
    margin-top: auto; /* Push to bottom */
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-selector button {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 1.1em;
    cursor: pointer;
    color: var(--primary-color);
    transition: background-color 0.2s ease;
}

.quantity-selector button:hover {
    background-color: rgba(var(--primary-color), 0.1);
}

.quantity-selector .quantity {
    padding: 0 10px;
    font-weight: 600;
    color: var(--text-color);
}

.footer {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100% - 20px);
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1000;
}

.total-display {
    font-size: 1.2em;
    font-weight: 700;
}

.view-cart-btn {
    background-color: #fff;
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-cart-btn:hover {
    background-color: var(--light-grey);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Initially hidden */
    width: 380px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    padding: var(--padding-base);
    box-sizing: border-box; /* Include padding in width */
    overflow-y: auto; /* Allow scrolling for long carts */
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--padding-base);
    border-bottom: 1px solid var(--light-grey);
    margin-bottom: var(--padding-base);
}

.cart-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-color);
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--dark-grey);
}

.cart-items {
    /*flex-grow: 1;  Allow cart items to take available space */
    margin-bottom: var(--padding-base);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--light-grey);
}

.cart-item:last-child {
    border-bottom: none;
}

.item-info .item-name {
    margin: 0;
    font-weight: 600;
}

.item-info .item-price {
    margin: 5px 0 0 0;
    font-size: 0.9em;
    color: var(--dark-grey);
}

.remove-item-btn {
    background-color: var(--red-error);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-item-btn:hover {
    background-color: darken(var(--red-error), 10%);
}

.delivery-info {
    background-color: var(--secondary-color);
    padding: var(--padding-base);
    border-radius: var(--border-radius);
    margin-bottom: var(--padding-base);
}

.delivery-info p {
    margin: 5px 0;
    font-size: 0.9em;
}

.free-delivery {
    color: var(--green-success);
    font-weight: 600;
}

.deposit-info {
    color: var(--dark-grey);
}

.delivery-zone {
    margin: 15px 0;
}

.delivery-zone label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.delivery-zone select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--light-grey);
    border-radius: 5px;
    background-color: #fff;
    font-size: 1em;
}

.delivery-details {
    border-top: 1px solid var(--light-grey);
    padding-top: var(--padding-base);
    margin-top: var(--padding-base);
}

.delivery-details p {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.delivery-details p span {
    font-weight: 600;
}

.cart-final-total {
    font-size: 1.2em;
    color: var(--primary-color);
}

.customer-info {
    margin-bottom: var(--padding-base);
}

.customer-info input,
.customer-info textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--light-grey);
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    box-sizing: border-box;
}
.order-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px var(--padding-base);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

/* Product modal styles moved from inline in index.php to global stylesheet
   So modal styles persist after AJAX content replacement */
.product-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 400px;
    width: 95vw;
    padding: 24px 18px 18px 18px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    animation: fadeIn 0.2s;
}
.product-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
}
.product-modal-image img {
    /* Contenir l'image entière sans la rogner */
    width: auto;
    max-height: 240px; /* hauteur maximale de l'image */
    object-fit: contain;
    border-radius: 12px 12px 0 0;
    margin-bottom: 12px;
    display: block;
}

.product-modal-image {
    /* Compense la padding horizontale du .product-modal-content pour un visuel "full-bleed" */
    margin-left: -18px;
    margin-right: -18px;
    margin-top: -24px; /* coller l'image en haut du modal */
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: #0b0b0b; /* fond sombre pour les images letterboxed */
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-modal-title {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}
.product-modal-price {
    font-size: 1.1em;
    color: #1ebe5b;
    font-weight: 700;
    white-space: nowrap;
}

.product-modal-header {
    display: flex;
    align-items: center; /* align price vertically with title */
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: nowrap; /* prevent wrapping so title and price stay on one line */
}
.product-modal-header .product-modal-title { flex: 1 1 auto; }
/* Force title and price to stay on one line; truncate long titles with ellipsis */
.product-modal-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* allow flex-shrink to work */
}
.product-modal-price {
    flex: 0 0 auto;
    margin-left: auto; /* push price to the far right */
}

/* Responsive: slightly reduce title size on very small screens to help keep single line */
@media (max-width: 420px) {
    .product-modal-title { font-size: 1.05em; }
    .product-modal-price { font-size: 1em; }
}
.product-modal-variation, .product-modal-supplements, .product-modal-salads {
    margin-bottom: 10px;
}
.product-modal-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    justify-content: center;
}
.qty-minus, .qty-plus {
    background: #eee;
    border: none;
        max-width: 480px; /* élargi pour accommoder image plus grande */
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
}
.qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 1.1em;
}
.product-modal-add {
    background: #1ebe5b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 0;
    width: 100%;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.product-modal-add:hover {
    background: #159c47;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.hidden {
    display: none;
}
header.header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header form {
    margin-left: auto;
}
header form select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
}
.fullwidth-slider {
    width: 100vw;
    margin: 0;
    padding: 0;
	margin-bottom: 60px !important;
}
.fullwidth-slider .slide,
.fullwidth-slider .slide img {
    width: 100%;
    object-fit: cover;
}
.fullwidth-slider .slick-dots li button:before {
    font-size: 16px;
    color: #FFB800FF;
    opacity: 1;
}
.fullwidth-slider .slick-dots li.slick-active button:before {
    color: #FFB800FF;
}
.main-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 70%;
    max-width: 350px;
    height: 100%;
    background: #fff;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    padding: 60px 20px;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
}
.main-menu.open {
    left: 0;
	z-index: 9999;
}

.main-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
    margin: 0;
}
.main-menu ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 18px;
    transition: color 0.3s;
}
.main-menu ul li a:hover {
    color: #FFB800FF;
}
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
    }

    .categories {
        flex-wrap: wrap;
        justify-content: center;
    }

    .category-btn {
        margin: 5px;
    }

    .products-grid {
		grid-template-columns: repeat(2, 1fr);
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-sidebar.open {
        right: 0;
		z-index: 99999999;
    }

    .footer {
        padding: 10px;
        font-size: 0.9em;
    }

    .view-cart-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
	header form {
        top: 10%;
        right: 0;
        transform: none;
    }
}
header.header{
    display: grid !important;
    grid-template-columns: 56px 1fr 120px;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #000000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}
.hamburger{
    width: 56px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    justify-self: start;
    align-self: center;
    z-index: 1002;
    font-size: 30px;
    color: #FFF;
}
.hamburger span{
    display: block;
    width: 22px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.logo{
    justify-self: center;
    text-align: center;
    margin: 0;
}
.logo img{
    height: 60px;
    display: block;
    margin: 0 auto;
}
header.header form{
    position: static !important;
    justify-self: end;
    display: flex;
    align-items: center;
    margin: 0;
}
header.header form select{
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.header-bar {
    color: rgb(234, 171, 6);
    background-color: rgb(255 255 255);
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #000;
    font-size: 18px;
    font-weight: 600;
}
#main-menu .close-menu {
    background: none;
    border: none;
    color: black;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 30px;
}

.toggle-time {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.toggle-time input[type="radio"] {
    display: none;
}

.time-btn span {
    display: inline-block;
    padding: 10px 19px;
    border-radius: 14px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    min-width: 120px;
    transition: 0.2s;
}

.toggle-time input[type="radio"]:checked + span {
    background: #000;
    color: #fff;
    border-color: #000;
}

#pickup-fields select,
#pickup-fields input[type="date"] {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 12px;
    font-size: 14px;
}

.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.popup-box {
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: 10px;
}

.popup-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    background: #28a745;
    color: #fff;
    font-size: 16px;
    border-radius: 8px;
}

.popup-btn.cancel {
    background: #777;
}
.toggle-buttons {
    margin-bottom: 21px;
}
.titre-prod {
    display: flex;
    padding: 10px 0px;
}
div#pickup-fields {
    width: 100%;
}

div#pickup-fields input[type="date"] {
   width: 93%;
}

div#pickup-fields label {
   line-height: 34px;
}

@media (max-width: 991px){
    header.header{
        grid-template-columns: 48px 1fr 90px;
        padding: 8px 12px;
    }
    .logo img{
        height: 48px;
    }
    header.header form select{
        font-size: 13px;
        padding: 4px 8px;
    }
    .hamburger{
        width: 48px;
        height: 36px;
    }
}
@media (max-width: 768px) {
    .products-grid {
        padding-bottom: 180px;
    }
    div#pickup-fields input[type="date"] {
   width: 95%;
}

  /* Overlay */
    #product-modal {
        align-items: flex-start;
        padding: 10px;
        overflow: hidden;
    }

    /* Contenu du modal */
    #product-modal .product-modal-content {
        width: 100%;
        max-height: 95vh;          /* لا يتجاوز ارتفاع الشاشة */
        overflow-y: auto;          /* تفعيل السكرول */
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        margin-top: 70px;
        padding-bottom: 20px;
    }





    /* Actions restent visibles */
    #product-modal .product-modal-actions {
        position: sticky;
        bottom: 20px;
        background: #fff;
        padding-top: 10px;
        padding-bottom: 10px;
        z-index: 5;
    }
    .time-btn span{
        min-width: auto;
        padding:12px 12px
    }
    

}

/* === Mobile only === */


@media (max-width: 400px) {
span.add-label {
    font-size: 10px;
}
    #product-modal .product-modal-image img {
        height: auto;
        max-height: 30vh;
    }
span.add-total {
    font-size: 14px;
}
}