

/*---------------------- start general classes ----------------------------*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: sans-serif;
}

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

.btn {
    margin: 5px auto;
    display: block;
    border: 1px solid black;
    background-color: white;
    border-radius: 25px;
    width: 150px;
    text-align: center;
    padding: 10px;
    cursor: pointer;
}

.icon {
    display: inline;
    font-size: 15px;
    text-align: center;
    padding: 5px;
    cursor: pointer;
    border: 2px solid black;
    border-radius: 25px;
}

.icon:hover {
    color: black;
    background-color: white;
}

a {
    text-decoration: none;
    outline: none;
    color: #000;
}


.btn:hover {
    background-color: #eee;
}

.animation {
    z-index: 1000 !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.bgCover {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    background-color: #000;
    opacity: 0.5;
    z-index: 40;
}

.alert {
    width: 40%;
    height: fit-content;
    background-color: #f7f7f7; 
    position: fixed;
    top: -15px;
    left: 35%;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease, top 0.5s ease; 
    color: #fff; 
    border-radius: 5px;
    z-index: 2000;
    padding: 10px;
}

.alert p {
    padding: 5px;
    padding-left: 15px;
    color: black; 
    margin: 0; 
}

.alert.active {
    opacity: 1; 
    top: 15px; 
}

.success {
    background-color: #c3e6cb;
}

.failed {
    background-color: #f5c6cb; 
}

@media (width < 768px) {
    .alert {
        width: 60%;
        left: 20%;
    }
}

@media (width < 560px) {
    .alert {
        width: 80%;
        left: 10%;
    }
}
/*---------------------- end general classes ----------------------------*/


/* --------------------------- Start header --------------------------------- */
header {
    background-color: gray;
    color: white;
    padding: 10px;
    width: 100%;
}

header .container {
    position: relative;
}

.logo {
    font-weight: bold;
    font-size: 25px;
}

@media (width < 560px) {

    header .container {
        flex-direction: column;
    }

    .account-container {
        justify-content: space-between;
        width: 100%;
    }
}

/*--------------------------- start time --------------------*/
.time {
    width: 100%;
    height: fit-content;
    margin-bottom: 10px;
}

.time h4 {
    margin: 0px;
    padding: 0px;
    padding-right: 5px;
    text-align: end;
    font-weight: bold;
    font-size: 15px;
}
/*--------------------------- end time --------------------*/



/*------------------------------------------ start account form -------------------------------*/

#accountForm {
    display: block; 
    border: black solid 1px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    z-index: 100;
    text-align: center;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    padding: 20px;
}

.present {
    width: 900px !important;
}

@media (max-width: 1100px) {
    .present {
        width: 90% !important;
    }
}
@media (max-width: 600px) {
    .present {
        width: 100vw !important; 
        left: 0; 
        transform: translate(0, -50%);
    }
}

.account-container {
    gap: 10px;
}

#accountUI {
    display: flex;
    width: 100%;
    height: 600px;
    background-color: #f7f7f7;
}


.accountForms {
width: 85%;
height: 100%;
position: relative;
}

.userUI {
width: 250px;
height: auto;
position: absolute;
left: 50%;
top: 30%;
transform: translate(-50%, -50%);
}
/*------------------------------------------*/

.iconsContainer {
    display: flex;
    width: auto;
    height: 100%;
}

.switch {
    list-style: none;
    width: fit-content;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #eee;
    font-size: 25px;
    padding: 0;
}

.switch li {
    flex: 1; 
    display: flex;
    align-items: center;
    justify-content: center; 
    padding: 30px; 
    cursor: pointer;
}

.switch li:not(.this):hover {
    background-color: gray;
}

.this {
    background-color: #f7f7f7;
}


@media (width < 1100px) {
    #accountUI {
        display: grid;
        grid-template-rows: 5% 15% 80%;
        width: 100%;
    }

    .deleteContainer.on{
        position: static !important;
        background-color: #e0e0e0;
        text-align: end;
    }
    
    .deleteContainer.on .delete {
        position: static !important;
        padding-right: 5px;
    }
    
    .userForms {
        grid-template-rows: 25% 75%;
    }

    .iconsContainer {
        height: fit-content;
    }

    .switch {
        flex-direction: row; 
        height: 50px;
        width: 100%;
    }

    .switch li {
        flex: 1; 
        padding: 10px;
    }
}

/*------------------------------------------*/





.userForms {
display: grid;
width: 100%;
height: 100%;
grid-template-rows: 30% 70%;
justify-items: center;
align-items: center;
overflow: hidden;
}

.userHead {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
}

.userBody {
display: grid;
width: 100%;
grid-template-columns: 1fr; /* One column layout */
grid-row-gap: 15px; /* Adds spacing between grid rows */
justify-items: center;
height: 300px;
}

.paymentHistory {
width: 100%;
}

@media (width < 600px) {
    .paymentHistory, .history-card-name h4{
        font-size: 0.8rem;
    }
    .paymentHistory .history-card-img{
        display: none;
    }
    
    .historyHeaders {
        margin: 10px auto !important;
    }

    .historyHeaders ul {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .historyHeaders ul li:nth-child(3) {
        display: none;
    }

    .history-item {
        grid-template-columns: 1fr 1fr 0.5fr 1fr !important;
        padding: 20px 5px;
    }
}


.historyHeaders {
border-radius: 5px;
padding: 10px 0px;
background-color: #e0e0e0; /* Example background color for headers */
margin-bottom: 10px;
width: 87%;
margin: 10px auto;
margin-left: 35px;
}

.historyHeaders ul {
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
list-style: none;
margin-bottom: 0;
font-weight: bold;
padding: 0;
width: 100%;
}

.historyBody {
overflow-y: auto;
height: 200px;
border-radius: 5px;
padding: 10px 0px;
margin-bottom: 10px;
width: 90%;
margin: 10px auto;
}

.history-item {
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
align-items: center;
background-color: white;
border-radius: 5px;
margin-bottom: 10px;
margin-right: 5px;
}

.history-card-img img {
width: 50px;
height: 50px;
overflow: hidden;
}


.userSettings {
width: 50%;
margin: auto;
text-align: center;
}

.deleteContainer {
width: 100%;
height: 30px;
}

.account-info {
    gap: 10px;
}

.user-info {
    border-radius: 25px;
    padding: 10px;
    gap: 10px;
    transition: 0.3s;
    cursor: pointer;
    height: 40px;
    font-size: 14px;
    font-weight: bold;
    }
    
    .user-info:hover {
    color: black;
    background-color: white;
}

.user-icon {
    font-size: 20px;
}

.welcome {
    font-size: 13px;
    display: block;
    opacity: 0.8;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.form-group button {
    width: 100%;
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
}

.form-group button:hover {
    background-color: #0056b3;
}

#usernameDisplay {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #007BFF;
    text-align: center;
}

.link {
    text-align: center;
    color: #007BFF;
    cursor: pointer;
    margin-bottom: 10px;
    border: solid 2px black;
    padding: 7px;
}

.link:hover {
    background-color: #f7f7f7
}

#deleteAccountLink {
    background-color: rgba(255, 0, 0, 0.80);
    color: white;
    font-weight: bold;
}

#deleteAccountLink:hover {
    background-color: rgba(255, 0, 0, 0.95);
}

.invalid {
    color: red;
    margin: 5px 0px;
    width: 100%;
    display: none;
    font-size: 13px;
    cursor: default;
}



/*------------------------------------------  end account form -----------------------------------*/

/*------------------------------------------  Start cart  ----------------------------------------*/
.cart-icon {
    position: relative;
}
.cartCalc {
    color: white;
    font-weight: bold;
    width: auto;
    height: auto;
    position: absolute;
    top: -12px;
    right: -5px;
    background-color: red;
    border: red solid 1px;
    border-radius: 25px;
    font-size: 14px;
    cursor: default;
    display: none;
}



.cart {
    border-left: 1px solid black;
    width: 400px;
    max-width: 100%;
    position: fixed;
    background-color: #eee;
    right: 0;
    top: 0;
    z-index: -1;
    opacity: 0;
    height: 100%;
    transform: translateX(50%);
    transition: 0.3s;
}


.cart-head {
    height: 10%;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-head hr {
    position: absolute;
    bottom: 0;
    height: 3px;
    width: 100%;
}

.cart-body {
    height: 80%;
    overflow: auto;
    overflow-x: hidden;
}

.product-card {
    display: flex;
    border: 1px solid black;
    border-left: none;
    height: 150px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.cart-body .card-img {
    display: flex;
    align-items: center;
    margin-left: 5px;
    width: 40%;
}

.cart-body .card-img img{
    width: 80%;
    height: 80%;
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.card-name {
    padding: 6px;
    font-weight: bold;
    font-size: 17px;
    border: 1px solid black;
    margin-top: 5px;
}

.card-des {
    font-size: 15px;
    height: 75px;
    width: 200px; 
    overflow: scroll;
    overflow-x: hidden;
    margin: 10px 0;
    border: 1px solid black;
}


.card-pay {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}


.product-quantity input {
    width: 50px;
}

.card-price {
    font-weight: bold;
}

.card-pay .remove {
    margin-left: 5px;
    font-size: 17px;
    cursor: pointer;
    color: red;
}

.cart-footer {
    display: flex;
    border-top: 1px solid black;
    align-items: center;
    justify-content: space-around;
    gap: 10px;
    height: 10%;
}

.cart-footer h4 {
    display: inline-block;
}

.cart-footer input {
    width: 150px;
}

.pay-btn {
    padding: 10px 5px;
    font-size: 18px;
    font-weight: 700;
    width: 120px;
    height: 40px;
    border-radius: 25px;
    cursor: pointer;
    background-color: white;
}

.pay-btn:hover {
    background-color: #f7f7f7;
}


.empty {
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    overflow: hidden;
}


.active {
    display: block !important;
}

.delete {
    font-size: 25px;
    position: absolute;
    top: 0;
    right: 0;
    margin: 15px;
    cursor: pointer;
    z-index: 500;
}

.delete:hover {
    color: red;
}

@media (max-width: 1100px) {
    .cart {
        z-index: -1;
        opacity: 0;
        height: 100%;
        transform: translateX(50%);
        transition: 0.3s;
    }

    .product-card {
        margin-right: 5px;
        padding: 5px;
    }

    .cart-body .card-img img {
        width: 80%;
        height: 50%;
    }

    .pay-btn {
        margin-left: 25px;
        padding: 9px 5px;
        font-size: 15px;
        font-weight: 700;
        width: 80px;
        height: 35px;
        border-radius: 25px;
    }
}


@media (width < 560px) {
    .cart-footer h4 {
        display: block;
        margin-bottom: 4px;
        text-align: center;
    }
}
/*-------------------------------- end cart & header ------------------------------------*/

/* --------------------------- start body ---------------------------------- */

main {
    display: flex;
    gap: 5px;
}

/* ------------------------- Start filter form ----------------------- */

.filter {
    width: 400px;
    max-width: 80%;
    display: block;
    border: 1px solid black;
    background-color: #eee;
}

.filter h2 {
    margin: 0px auto;
    padding: 10px 0;
    width: fit-content;
}

hr {
    height: 3px;
    background-color: black;
}

.filter-type {
    text-align: center;
}

.filter .filter-topic {
    margin: 15px auto;
    text-align: center;
    font-weight: bold;
}

.filter-price {
    text-align: center;
}

.priceLabel {
    display: block;
    margin: 5px 0;
}

.priceInput {
    width: 75px;
}

/*------------------------ end filter form ---------------------------------------*/


/* ---------------------------- start line --------------------------------- */

.line {
    width: calc(100vw - 290px);
    background-color: silver;
    gap: 5px;
    margin-bottom: 5px;
    display: inline-block;
}


.line .line-options {
    display: flex;
    gap: 0 35px;
    padding: 5px;
    margin: 20px auto;
    width: fit-content;
    border-radius: 25px;
}

.product-line {
    position: relative;
}

.add-productSection {
    width: 300px;
    height: auto;
    box-shadow: 2px 2px  0px  4 px rgba(187, 178, 178, 0.363);
    position: absolute;
    background-color: #f7f7f7;
    top: 50px;
    right: -50px;
    z-index: -1;
    opacity: 0;
    transition: 0.3s;
}

@media (max-width: 560px) {
    .add-productSection {
        top: 50%;
        left: -3%;
        transform: translate(-50%, -50%);
    }
}


.section {
    z-index: 101;
    opacity: 1;
    top: 150px;
}

#addProductForm {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    margin-top: 30px;
}

#newIdButton , #backToFormButton {
    padding: 5px;
    cursor: pointer;
    text-decoration: underline;
    color: blue;
}


#customImageUpload {
    margin: 15px auto;
    width: 70%;
    display: block;
}


.pro-des textarea{
    resize: none;
    width: 80%;
    height: 150px;
    border-radius: 5px;
}


.confirm {
    width: fit-content;
    padding: 3px;
    margin: 15px;
}

.delete-product {
    color: red;
    font-weight: bold;
}

@media (width < 1170) {
    .add-product {
        display: flex;
        flex-direction: column;
    }
}


@media (max-width: 1100px) {
    .filter {
        position: fixed;
        z-index: -1;
        opacity: 0;
        height: 100%;
        transform: translateX(-50%);
        transition: 0.3s;
    }

    .line {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100vw;
    }

    .line .line-options {
        display: flex;
    }

}

@media (max-width: 560px) {
    .filter {
        position: fixed;
        height: 300px;
        max-width: 100% !important;
        margin: auto;
        bottom: 0;
        transform: translateY(50%);
        border: none;
        border-top: 1px solid black;
        width: 100%;
    }
    .line-options {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 350px) {
}



@media (width > 1100px) {
    #filter-delete {
        display: none;
    }

    .filter-open {
        display: none;
    }
}

/* ------------------------------ end line ---------------------------------*/

/*--------------------------------------------------- start products section --------------------------------------------------*/

.product-section {
    margin: 10px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product {
    display: flex;
    flex-wrap: wrap;
    height: fit-content;
    border: 1px solid black;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}

.product-img {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid black;
    width: 100%;
}

.product img {
    width: 80%;
    height: 160px;
}

.product-info {
    border-top: 1px solid black;
    padding: 5px;
    width: 100%;
}

.product-head {
    margin: 10px 0;
    width: 100%;
    word-break: break-all;
}

textarea {
    resize: none;
    overflow-wrap: break-word; 
    white-space: pre-wrap; 
    overflow: hidden; 
}

.product-des {
    margin: 10px 0;
    color: #777;
    font-size: 16px;
    line-height: 1.5; 
    overflow: auto;
    text-wrap: balance; 
    word-break: break-word;
    padding: 5px;
    height: 120px;
    width: 250px;
}


.product-price {
    display: block;
    border: 1px solid black;
    border-radius: 25px;
    font-weight: bold;
    font-size: 25px;
    margin: 10px 0;
    text-align: center;
}

@media (width < 560px) {
    .product {
        margin: 0px auto;
        width: 70vw;
    }

    .add-productSection {
        transform: translate(-22%, 5%);
    }
}


:root {
    --font-h1-size: clamp(2.5rem, 5vw + 1rem, 4rem);
    --font-h3-size: clamp(1.5rem, 3vw + 1rem, 2.5rem);
    --font-btn-size: clamp(1rem, 2.5vw, 1.5rem);
    --font-normal-size: clamp(0.9, 1rem , 1.2rem);
}
/*--------------------------------------------------- end products section --------------------------------------------------*/


/*--------------------------------------------------- start footer section --------------------------------------------------*/

/*------------------------- start currency ----------------------------*/

.currency-info {
    width: 400px;
    text-align: center;
    cursor: default;
}

.specificCurrencies {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.specificCurrencies button {
    width: 50px;
    cursor: pointer;
}

.currency-info h5 {
    margin: 10px auto;
}

#currency {
    cursor: pointer;
}


@media (width < 560px) {
    .currency-info {
        width: 350px;
        font-size: 14px;
        text-align: left;
        margin-bottom: 25px;
    }
}
/*------------------------- end currency ----------------------------*/


/*------------------------- start pagination ----------------------------*/

.pagination {
    margin: 10px 0;
    height: 50px;
    background-color: #f4f5f7;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination .next , .previous {
    width: fit-content;
    text-align: center;
    padding: 5px 10px;
    border: 1px solid black;
    background-color: white;
    cursor: pointer;
}

.pagination .disabled {
    background-color: #DDD;
    color: #B8B8B8;
    cursor: default;
}

.pagination ul {
    display: block;
    border: 1px solid black;
}

.pagination ul li {
    display: inline-block;
    list-style: none;
    padding: 5px;
    width: 50px;
    text-align: center;
    cursor: pointer;
}

.pagination ul li:not(:last-child) {
    border-right: 1px solid black;
}

.pagination .bullet {
    background-color: #707070;
    color: white;
}

#pagination .dots {
    cursor: default;
}

/*------------------------ end pagination ---------------------------------*/


/*------------------------ start footer icons -----------------------------------*/

footer {
    border-top: 1px solid black;
    width: 100%;
    background: grey;
    padding: 25px;
    overflow: hidden;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;}

.footer-items {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    cursor: default;
}

.footer-items span {
    margin-right: 10px;
}

.footer-items ul {
    display: flex;
    list-style: none;
}

.footer-items ul li {
    margin-right: 10px;
    
}

.footer-items ul li i {
    padding: 10px;
}


@media (width < 560px) {
    .footer-items {
        font-size: 14px;
        flex-direction: column;
        gap: 10px;
    }

    .pagination ul li {
        width: 40px;
    }

    .currency-info {
        text-align: center;
    }
}

@media (width < 768px) {
    footer {
        flex-direction: column;
        justify-content: center;
    }
}
/*------------------------------ end footer icons ------------------------------*/

/*--------------------------------------------------- end footer section --------------------------------------------------*/
