/* ==================== 1. RESET & BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    padding-top: 70px;
}

.hidden {
    display: none !important;
}

/* ===== NAVBAR ===== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 1000;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 90px;
    height: auto;
}

.desktop-menu {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 60px;
}

.nav-links,
.nav-options {
    display: flex;
    gap: 35px;
}

.nav-item {
    text-decoration: none;
    color: #000;
    font-weight: 600;
    font-size: 15px;
}

.menu-toggle {
    display: none;
}

.nav-item:hover {
    color: #000;
}

.admin-link {
    display: none;
    color: #e67e22;
    border: 1px solid #e67e22;
    padding: 4px 10px;
    border-radius: 4px;
}

.admin-link:hover {
    background-color: #e67e22;
    color: #fff;
}

/* ==================== 3. SYSTEME DE CARTES PRODUITS (GRID) ==================== */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.product-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    /* Ykhali tsawra dima mrigla */
}

.product-info {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 10px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
}

.btn-delete {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-delete:hover {
    background-color: #ff1a1a;
}

/* ==================== 4. MON COMPTE & FORMULAIRES ==================== */
.breadcrumb-container {
    background-color: #f1f2f6;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #777;
}

.account-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2d3436;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.required {
    color: #e74c3c;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #000;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: #333;
}

.lost-password-wrapper {
    text-align: center;
    margin-top: 15px;
}

.lost-password-link {
    font-size: 13px;
    color: #777;
    text-decoration: none;
}

/* ==================== 5. SEARCH MODAL ==================== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.search-modal-content {
    background-color: #fff;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close-search-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
}

.close-search-btn:hover {
    color: #000;
}

.search-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

.search-field:focus {
    border-color: #000;
}

.search-icon {
    position: absolute;
    right: 15px;
    pointer-events: none;
}

/* ==================== SECTION HERO (Bannière Home) ==================== */
.hero-section {
    position: relative;

    width: 100%;
    min-height: calc(100vh - 70px);

    background-image: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .3)), url('Grid front pic.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    display: flex;
    align-items: center;
    padding-left: 8%;
}

.hero-content {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    z-index: 2;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    /* Ombre bch l-ktiba tok3od thahra bahi 3al background */
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-hero {
    display: inline-block;
    padding: 15px 40px;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    border-radius: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: background 0.3s, transform 0.2s;
}

.btn-hero:hover {
    background-color: #f1f1f1;
    transform: scale(1.03);
}

/* ==================== MULTIPLE IMAGES HOVER EFFECT ==================== */
.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

/* Et-taswira l-thanya tkoun mkhbya (opacity 0) fil-loul */
.product-image-wrapper .img-hover {
    opacity: 0;
}

/* Ki t7ott el souris 3al card: el main tatkhba w l-hover tethhar */
.product-card:hover .img-main {
    opacity: 0;
}

.product-card:hover .img-hover {
    opacity: 1;
    transform: scale(1.02);
    /* Zoom sghir mte3 professional look */
}

/* ==================== POPUPS MODAL CSS ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #333;
}

/* ==========================================================================
   CSS MRYGEL LIL PANIER (YOUR CART) - BECH MA TJILES CHAY KBIR WLA MDA7ESS
   ========================================================================== */

.cart-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 50px;
    font-family: 'Arial', sans-serif;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
}

.cart-title {
    font-size: 36px;
    font-weight: 400;
    color: #222;
}

.continue-link {
    color: #000;
    text-decoration: underline;
    font-size: 14px;
}

.cart-table-labels {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    font-size: 11px;
    color: #999;
    letter-spacing: 1px;
    padding-bottom: 10px;
}

.cart-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 0 0 20px 0;
}

/* Item Row stylé en Grid */
.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 15px 0;
}

.product-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* !!! HEDHI L-AHM: BECH TSWIRA MA TATLA3CH KBYRA !!! */
.cart-product-img {
    width: 100px !important;
    /* Size sghira w ndhifa kima l-tswira */
    height: 100px !important;
    /* Becha ma takolch l-écran */
    object-fit: cover;
    background-color: #f5f5f5;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.product-price,
.product-meta {
    font-size: 14px;
    color: #555;
    margin: 0 0 3px 0;
}

/* Quantity Selector stylé line b line */
.product-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.quantity-selector {
    display: flex;
    border: 1px solid #ccc;
    background: #fff;
}

.qty-btn {
    background: none;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 16px;
}

.qty-input {
    width: 35px;
    text-align: center;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    outline: none;
    font-size: 14px;
    padding: 5px 0;
}

.delete-item-btn {
    cursor: pointer;
    font-size: 18px;
}

.product-total {
    text-align: right;
    font-size: 16px;
    font-weight: bold;
}

/* Footer / Checkout Button */
.cart-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 30px;
}

.subtotal-wrapper {
    margin-bottom: 20px;
    font-size: 20px;
}

.subtotal-label {
    color: #222;
    margin-right: 10px;
}

.subtotal-amount {
    font-weight: bold;
}

.btn-checkout {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 15px 45px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
}

.btn-checkout:hover {
    background-color: #333;
}

.admin-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-edit {
    background: #f39c12;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: .3s;
}

.btn-edit:hover {
    background: #d68910;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: .3s;
}

.btn-delete:hover {
    background: #c0392b;
}

#search-submit-btn {
    width: 55px;
    height: 55px;
    border: none;
    background: #000;
    color: #fff;
    font-size: 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: .3s;
}

#search-submit-btn:hover {
    background: #222;
}

#search-submit-btn {
    border-radius: 0 10px 10px 0;
}

#thank-you-page {
    padding: 60px;
    min-height: 100vh;
    background: #fff;
}

.thank-container {

    max-width: 700px;
    margin: auto;

}

.check-icon {

    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #2d7cff;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 35px;
    color: #2d7cff;

    margin-bottom: 30px;

}

#thank-title {

    font-size: 45px;
    margin-bottom: 15px;

}

.confirm-text {

    font-size: 20px;
    margin-bottom: 35px;

}

#order-details {

    margin-top: 30px;
    margin-bottom: 40px;

    line-height: 35px;

}

#continue-shopping-btn {

    background: black;
    color: white;

    border: none;

    padding: 18px 40px;

    cursor: pointer;

    font-size: 18px;

}

.admin-link {
    display: none;
}

@media screen and (max-width:768px) {

    .hero {
        height: 100vh;
        overflow: hidden;
    }

    .hero img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }

    .hero-content {
        left: 25px;
    }

    .hero h1 {
        font-size: 60px;
    }

    .hero button {
        width: 180px;
        height: 55px;
        font-size: 17px;
    }

}

@media screen and (max-width:768px) {

    .products-grid {

        display: grid;

        grid-template-columns: repeat(2, 1fr);

        gap: 15px;

        padding: 20px;

    }

}

@media screen and (max-width:768px) {

    .product-detail {

        flex-direction: column;

    }

    .product-images {

        width: 100%;

    }

    .product-info {

        width: 100%;

        padding: 20px;

    }

}

@media screen and (max-width:768px) {

    .checkout-container {

        width: 95%;

        padding: 20px;

    }

    .checkout-container input {

        width: 100%;

    }

}

@media screen and (max-width:768px) {

    .admin-panel {

        width: 95%;

    }

}

@media screen and (max-width:768px) {

    .thank-container {

        width: 95%;

        padding: 20px;

    }
}

@media (max-width:768px) {

    .hero-section {
        min-height: 100vh;
        background-size: cover;
        background-repeat: no-repeat;

        /* Baddel hedhi 7asb elli t7eb */
        background-position: 60% center;
    }

    .hero-content {
        left: 25px;
    }

    .hero-title {
        font-size: 58px;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
}

.mobile-menu-panel {
    display: none;
}

@media (max-width:768px) {

    .desktop-menu {
        display: none;
    }

    .navbar {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px 20px;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-logo {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .mobile-menu-panel {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        padding: 30px;
        box-sizing: border-box;
        z-index: 9999;
    }

    .mobile-menu-panel a {
        display: block;
        width: 100%;
        padding: 18px 20px;
        color: #000 !important;
        text-decoration: none !important;
        font-size: 18px;
        font-weight: 600;
        border-bottom: 1px solid #e5e5e5;
        background: #fff !important;
        box-sizing: border-box;
    }

    .mobile-menu-panel a:last-child {
        border-bottom: none;
    }

    .mobile-menu-panel a:hover {
        background: #f5f5f5;
        color: #000 !important;
    }

    .mobile-menu-panel a,
    .mobile-menu-panel a:link,
    .mobile-menu-panel a:visited,
    .mobile-menu-panel a:active {
        color: #000 !important;
        text-decoration: none !important;
    }

    .mobile-menu-panel.show {
        display: flex;
        flex-direction: column;
    }
}

/* ================= MOBILE PRODUCT PAGE ================= */

@media (max-width:768px) {

    .product-detail-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
    }

    .product-images-left {
        width: 100% !important;
    }

    .product-images-left img {
        width: 100% !important;
        height: auto;
        display: block;
    }

    .product-info-right {
        width: 100% !important;
    }

}

/* ================= MOBILE CHECKOUT ================= */

@media (max-width:768px) {

    #checkout-page {
        padding: 20px 15px !important;
    }

    #checkout-page>div {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }

    #checkout-page>div>div {
        width: 100% !important;
        flex: none !important;
    }

    #checkout-email,
    #address,
    #city,
    #phone,
    #first-name,
    #last-name {
        width: 100% !important;
        margin: 0 0 15px 0 !important;
    }

    #last-name {
        margin-bottom: 15px !important;
    }

    #checkout-summary {
        margin-top: 10px;
    }

    #complete-order-btn {
        width: 100%;
        font-size: 18px;
        padding: 18px;
    }

}

.checkout-row {
    display: flex;
    gap: 15px;
}

.checkout-row input {
    flex: 1;
    width: 100%;
    padding: 14px;
    height: 52px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

@media(max-width:768px) {

    .checkout-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .checkout-row input {
        width: 100%;
    }

}

.checkout-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.checkout-left {
    flex: 2;
}

.checkout-right {
    flex: 1;
}

@media (max-width:768px) {

    .checkout-container {
        flex-direction: column;
        gap: 30px;
    }

    .checkout-left,
    .checkout-right {
        width: 100%;
    }
}

@media (max-width:768px) {

    .checkbox-group {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        margin-top: 15px;
        margin-bottom: 20px;
    }

    .checkbox-group input {
        width: 18px !important;
        height: 18px;
        margin: 0;
        flex-shrink: 0;
    }

    .checkbox-group label {
        margin: 0;
        font-size: 14px;
        white-space: nowrap;
    }

}