:root {
    --text: #030b05;
    --background: #fefefe;
    --head-foot: #87CEFA;
    --primary: #55DD33;
    --secondary: #e4c6d4;
    --accent: #d2a365;

}



*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}


body {
    max-width: 1500px;
    direction: rtl;
    width: 90%;
    margin: 0;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--bbackground);
}


.container {
    display: flex;
    flex-direction: column;


}

header {
    display: flex;
    flex-direction: column;
    background-color: var(--bbackground);
    height: 100px;
}


.htop {
    display: flex;
    flex-direction: row;
    height: 70%;
    justify-content: center;
    align-items: center;
    padding-bottom: 10px;
}

.chap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 250px;
}

.chap-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    width: 90%;
    flex-direction: column;
}

.chap-icon .material-symbols-outlined {
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    color: #0008ff;

}

.user-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 0 1rem;
    margin-top: 25px;
}

.sabad {
    position: relative;
}

.sabad span {
    font-size: 1rem;
    position: absolute;
    background-color: red;
    border-radius: 50%;
    top: 25px;
    left: 30px;
    min-width: 20px;
    min-height: 20px;
    width: fit-content;
    height: fit-content;
    text-align: center;

}

/*.user-cart img {
    display: block;
    height: 100%;
    width: 100%;
}*/

.user_login {
    display: flex;
    align-items: center;
    width: fit-content;
    height: fit-content;
    white-space: nowrap;
    border: 3px solid #0008ff;
    border-radius: 12px;
    padding: 3px;

}
.user_login img , .material-symbols-outlined img{
    
    width:25px;
    height:25px;
    margin:5px;
}
.sabad img{
    width:50px;
    height:50px;
}
.user_navbar {
    display: none;
    flex-direction: column;
    background-color: #ded4fe;
    width: 200px;
    margin: 20px;
    border-radius: 5px;
    position: absolute;
    z-index: 2000;
    top: 10px;
    left: 100px;
    border-style:ridge;

}

.user_navbar-item {
    color: white;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border-top: 1px solid #444;
}

.user_navbar-item:hover {
    background-color: #bababa;
}

.user_navbar.hidden {
    display: none !important;
}

.toggle-link {
    cursor: pointer;
    background: none;
    border: none;
    margin: 20px;
    padding: 0;
}

.toggle-link img {
    width: 30px;
    height: 30px;

}

/* سرچ */

.vasat {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 60%;
    padding: 10px;
    border-radius: 10px;
    margin-top: 20px;
}

.searchbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: solid 1px #444;
    border-radius: 10px;
    padding: 5px;
    height: 40px;
    width: 40%;
    transition: 0.5s ease-in;
    position: relative;
    float: right;
}

.searchbox form {
    display: flex;
    justify-content: space-between;
    width: 100%;

}

.searchbox_input {
    border: none !important;
    background: none;

    font-size: 14px;
    flex: 1;
    margin-top: 10px;
    z-index: 1010;
    padding-bottom: 15px;
}


.searchbox input:focus {
    border: none;
    outline: none;
    z-index: 1010;
}

.searchbox:focus-within {
    width: 70%;

}

.searchbox form:focus-within {
    width: 100%;

}

.searchbox button {
    border: none;

    background-color: transparent;
    cursor: pointer;
    margin-top: 10px;
    padding-bottom: 10px !important;

}

.vasat form::placeholder {
    opacity: 0.6;
    color: #888;

}

.dropdown img {
    width: 50px;
    height: 50px;
}

.dropdown {
    display: none;
    flex-direction: column;

    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    z-index: 1010;

    width: 100%;
    overflow-y: auto;

}

.product-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0;
    list-style: none;
    margin: 0;

}

.sproduct {
    display: flex;
    flex-direction: row;
    width: 225px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
}

.product-name {
    font-weight: bold;
    margin-bottom: 5px;

}

.product-price {
    margin-top: 10px;

}


.rast {
    display: flex;
    justify-content: center;
    height: 100%;


}


.rast img {
    display: block;
    min-width: 250px;
    min-height: 80px;

}

.footer {
    max-width: 1500px;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    background-color: var(--background);
}


.fbottom {
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    text-align: center;
    justify-content: center;
    text-align: center;
    height: 4em;
    background-color: aquamarine;
    align-items: center;


}



.fmiddle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* ۴ ستون با عرض مساوی */
    gap: 1rem;
    padding: 1rem;
    background-color: #2d3748;
    color: white;
}

.fmenu {
    position: relative;

}

.fmenu h6 {
    border-bottom: 3px solid #d0ff00;
    font-family: sans-serif;
    padding: 5px;

}

.fmenu-list {
    display: block;
    list-style: none;
    padding: 0;
    margin: 0;
}

.fmenu-list li a {
    color: #ffffff;
    text-decoration: none;
}

.fmenu-list li {
    padding: 5px;
}

.fmenu-button {
    font-size: 1.5em;
    background-color: transparent;
    color: white;
    outline: none;
    border: none;
    padding: 0 40px;
    height: calc(1.5em + 5px);
}

.fmenu-button IMG {
    display: none;
}

.footerlogo img {
    width: 50%;

    height: calc(5em - 10px);


}


@media (max-width: 640px) {
    .footer {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
    }

    .fmiddle {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        align-items: center;
    }

    .fmenu {
        text-align: center;
    }

    .fmenu-list {
        display: none;
        list-style: none;
        padding: 12px 0;
        margin: 0;
        /* بدون border یا outline خارجی */
    }

    .fmenu-list.show {
        display: block;
    }

    .fmenu-button {
        font-size: 20px;
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        height: calc(1.5em + 5px);
        background-color: rgb(159, 167, 167);
        border: solid 0.5px black;
        padding: 0 2px;
    }

    .fmenu-button IMG {
        display: block;
        width: 30px;
    }

    .footerdesc {
        display: none;
    }
}



.table {
    width: 100%;

    border-collapse: collapse;

    margin: 20px 0;

    border: 2px solid #000;
}

/* استایل هدر جدول */
.table-dark {
    background-color: #343a40;
    color: #ffffff;
    border: #000;


}


th {
    padding: 10px;

    text-align: right;

}


td {
    padding: 10px;

    border: 1px solid #000000;

    text-align: right;


}


tr:hover {
    background-color: #b23232;

}

.about {
    display: flex;
    align-items: center;
}

.about p,
.about li {
    font-size: 1.2em;
    line-height: 2em;
}

.about strong {
    font-size: 1.3em;

}

/* پیام */

#message-container {
    width: 400px;
    position: fixed;
    z-index: 1200;
    top: 20px;
    right: 20px;
    justify-content: center;
    align-items: center;
    background: #11ff19;
    color: rgb(0, 0, 0);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}

.alert {
    padding: 15px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 5px;
    position: relative;
    display: inline-block;
    width: 100%;
    transition: opacity 0.7s ease;
    /* انیمیشن محو شدن */
}

.alert-info {
    color: #000000;
    font-size: 1.2rem;
}

.close {
    position: absolute;
    top: -25px;
    left: -20px;
    cursor: pointer;
    font-weight: bold;
    color: #000000;

}

/* پوشش پس‌زمینه مدال */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* خود مدال */
.modal {
    background: white;
    width: 95%;
    max-width: 600px;
    min-height: 220px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-body {
    padding: 24px;
    font-size: 16px;
    color: #555;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 0 20px 20px;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-continue {
    background: #e9ecef;
    color: #495057;
}

.btn-continue:hover {
    background: #dee2e6;
}

.btn-cart {
    background: #ff6b00;
    color: white;
}

.btn-cart:hover {
    background: #e05a00;
}

/* نمایش مدال */
.modal-overlay.active {
    display: flex;
}

@media (max-width: 1023px) {
    body {
        width: 100vw !important;
    }

    #message-container {
        width: 40vw;

    }

    .hbottop {
        display: block;

    }

    .hbotbot {
        display: none;
    }

    .hbotchap {
        display: none !important;
    }

    header {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .user-cart {
        justify-content: end;
    }


    .htop {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
        gap: 2px;
        padding: 0;
        align-items: start;
        min-width: 100vw;
        max-width: 100vw;
        margin: 0 auto;
        box-sizing: border-box;
        overflow: hidden;
        border-bottom: 1px solid #828181;
    }

    .htop>* {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        transition: transform 0.6s ease, opacity 0.6s ease;
    }


    .rast {
        grid-column: 1;
        grid-row: 1;
    }

    .daste {
        grid-column: 1;
        grid-row: 2;
    }



    .hbot {
        padding: 0 !important;
        margin-top: 0 !important;
        border-bottom: none !important;
    }

    .rast {
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .rast img {
        margin: 0 !important;
        display: block;
        max-width: 100%;
        max-height: 100%;
        height: auto;
        width: auto;
        object-fit: contain;
        padding-top: 10px;
        min-width: auto;
    }

    .chap {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        display: flex;
        align-items: flex-start;
        height: 50px;
        width: 100%;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .chap-icon {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 100%;
        width: 100%;
        padding-left: 8px;
    }
.user_navbar {
        position: fixed;
        top: 30px;
        left: 40px;
        width: 60vw;
        height: auto;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        z-index: 2000;
        background-color: #ded4fe;
        border-style: ridge;
        border-radius: 5px;

}
    .user-cart {
        display: flex;
        align-items: center;
        gap: 2px;
        height: 100%;
        white-space: nowrap;
        overflow: hidden;
        margin-top: 0px;
    }

    .user_login {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: inherit;
        white-space: nowrap;
        padding:0 3px;
        border: 1px solid #0008ff;
    }

    .user_login p {
        font-size: 0.8rem;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
        white-space: nowrap;
        direction: rtl;
    }

    .sabad {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .user_login img, .material-symbols-outlined img {
        width: 25px;
        height: 25px;
    }
    .close-s img{
        width: 40px;
        height: 40px;
    }

    .sabad span {
        position: absolute;
        top: 20px;
        left: 20px;
        background: red;
        color: white;
        border-radius: 50%;
        min-width: 16px;
        height: 16px;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sabad img {
        width: 30px;
        height: 30px;
    }

    .chap-icon .material-symbols-outlined {
        font-size: 1.8rem;
    }





    .daste {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: flex-start;
        justify-content: right;
        width: 100% !important;
        padding: 0;


    }

    .daste .category-link {
        padding: 0 !important;
        font-size: 1.2rem !important;

    }

    .daste .nav-item {

        font-size: 2rem;
    }

    .searchbox {
        width: 90% !important;
    }


    body.scrolled-mobile {
        padding-top: 80px;
        max-width: 100vw !important;

    }

    .htop.scrolled {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1020;
        background: white;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: flex-start;
        width: 100vw;
        box-sizing: border-box;
        height: 9vh;
        direction: rtl;
        overflow: hidden;
        border-bottom: 1px solid #6a6868;


    }

    .htop.scrolled .chap-icon .material-symbols-outlined {
        font-size: 1.5rem;
    }


    .htop.scrolled .sabad span {
        font-size: 0.8rem;
        top: 20px;
        left: 20px;
        min-width: 12px;
        min-height: 12px;


    }

    .htop .category-link {
        visibility: hidden !important;

    }

    .htop.scrolled .daste {
        justify-self: flex-start !important;
        transition: transform 1s ease, opacity 0.3s ease;
        z-index: 1019;
        padding-top: 0;

    }

    .htop.scrolled .hbot {
        border-bottom: none;

    }


    .htop.scrolled .user-cart {
        padding: 0px 0px 0px 5px;
        justify-content: end;
    }

    .htop.scrolled .nav-item {
        max-height: 98% !important;
        padding: 0 !important;
        margin: 0 5px !important;
        text-align: start;
        align-items: start !important;
        top: 0 !important;
    }

    .htop:not(.scrolled) .rast {
        transform: translateX(0);

        opacity: 1;
    }

    .htop.scrolled .rast {
        position: absolute;
        justify-content: center;
        left: 50%;
        transform: translateX(-50%);
        opacity: 1;
        text-align: center;
        z-index: 1020;
        height: 98% !important;
        align-items: center !important;
        transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 1s ease;

    }


    .htop.scrolled .rast img {
        margin: 0 !important;
        display: block;
        max-width: 100%;
        height: auto;
        min-width: auto;
        min-height: auto;

    }

    .htop .user_login span{
        display: none !important;
    }

 /*   .htop .user_login {
        border: none !important;
    }*/


    .htop.scrolled .vasat {
        display: none !important;
    }

    .vasat {
        margin: 0 !important;

        grid-column: 2;
        grid-row: 2;
        width: 100%;
        padding: 0;
        margin-top: 0;
        justify-content: flex-end;
        padding-left: 8px;


    }


    .htop.scrolled .daste {
        margin-right: auto;
        height: 98%;
        z-index: 1020;

    }


    .htop.scrolled .chap {
        margin-left: 0px;
        left: auto;
        display: flex;
        align-items: flex-start;
        gap: 12px;
        z-index: 1020;
        height: 98% !important;
        transition: transform 1s ease, opacity 0.3s ease
    }
}