/* =========================================
   RESET
========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f8f9fa;
}


/* =========================================
   NAVBAR
========================================= */

.navbar {
    width: 100%;
    height: 65px;

    background: #222;

    position: sticky;
    top: 0;

    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    height: 100%;

    margin: auto;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* LOGO */

.logo {
    color: white;
    text-decoration: none;

    font-size: 26px;
    font-weight: bold;
}

.logo:hover {
    color: #4da6ff;
}


/* DESKTOP NAVIGATION */

.nav-links {
    display: flex;
    align-items: center;

    gap: 25px;
}

.nav-links a {
    color: white;
    text-decoration: none;

    font-size: 18px;
}

.nav-links a:hover {
    color: #4da6ff;
}

.user-name {
    color: white;
    font-size: 18px;
}


/* CART COUNT */

#cart-count,
#mobile-cart-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 2px 6px;

    background: #dc3545;
    color: white;

    border-radius: 20px;

    font-size: 12px;
    font-weight: bold;
}


/* =========================================
   MOBILE MENU BUTTON
========================================= */

.menu-btn {
    display: none;

    border: none;
    background: transparent;

    color: white;

    font-size: 30px;

    cursor: pointer;

    padding: 5px;
}


/* =========================================
   MOBILE SIDEBAR
========================================= */

.mobile-sidebar {
    position: fixed;

    top: 0;
    left: -300px;

    width: 280px;
    height: 100vh;

    background: white;

    z-index: 2000;

    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);

    transition: left 0.3s ease;

    overflow-y: auto;
}


/* SIDEBAR OPEN */

.mobile-sidebar.active {
    left: 0;
}


/* =========================================
   SIDEBAR HEADER
========================================= */

.sidebar-header {
    height: 65px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #222;

    color: white;
}

.sidebar-header h2 {
    margin: 0;

    font-size: 22px;
}

.close-sidebar {
    border: none;

    background: transparent;

    color: white;

    font-size: 32px;

    cursor: pointer;
}


/* =========================================
   SIDEBAR LINKS
========================================= */

.sidebar-links {
    display: flex;

    flex-direction: column;
}

.sidebar-links a {
    display: block;

    padding: 18px 20px;

    color: #333;

    text-decoration: none;

    font-size: 17px;

    border-bottom: 1px solid #eee;
}

.sidebar-links a:hover {
    background: #f5f5f5;

    color: #198754;
}


/* MOBILE USER */

.mobile-user {
    padding: 18px 20px;

    background: #f5f5f5;

    border-bottom: 1px solid #eee;

    font-weight: bold;
}


/* =========================================
   SIDEBAR OVERLAY
========================================= */

.sidebar-overlay {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);

    z-index: 1500;

    display: none;
}

.sidebar-overlay.active {
    display: block;
}


/* =========================================
   PAGE CONTENT
========================================= */

#content {
    padding: 30px;
}


/* =========================================
   SLIDER
========================================= */

.slider {
    width: 100%;
    height: 400px;

    position: relative;
    overflow: hidden;

    background: #222;
}

.slide {
    width: 100%;
    height: 100%;

    position: absolute;

    top: 0;
    left: 0;

    display: none;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.slide-text {
    position: absolute;

    left: 50px;
    bottom: 50px;

    color: white;

    background: rgba(0, 0, 0, 0.6);

    padding: 20px 30px;

    border-radius: 8px;
}

.slide-text h1 {
    margin-bottom: 10px;
}

.slider-btn {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    border: none;

    background: rgba(0, 0, 0, 0.5);

    color: white;

    font-size: 25px;

    padding: 15px;

    cursor: pointer;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}


/* =========================================
   PRODUCTS
========================================= */

.products {
    max-width: 1200px;

    margin: 40px auto;

    padding: 0 20px;
}

.products h2 {
    text-align: center;

    margin-bottom: 30px;

    font-size: 30px;
}

.product-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 25px;
}

.product-card {
    background: white;

    border: 1px solid #ddd;

    border-radius: 10px;

    overflow: hidden;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);

    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card > img {
    width: 100%;

    height: 220px;

    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 20px;

    margin-bottom: 10px;
}

.price {
    color: #e63946;

    font-size: 20px;

    font-weight: bold;

    margin-bottom: 10px;
}

.details {
    color: #666;

    line-height: 1.5;

    margin-bottom: 20px;
}


/* PRODUCT BUTTONS */

.product-buttons {
    display: flex;

    gap: 10px;
}

.product-buttons button {
    flex: 1;

    padding: 10px;

    border: none;

    border-radius: 5px;

    cursor: pointer;

    color: white;
}

.details-btn {
    background: #555;
}

.details-btn:hover {
    background: #333;
}

.cart-btn {
    background: #198754;
}

.cart-btn:hover {
    background: #146c43;
}


/* =========================================
   CART
========================================= */

.cart-section {
    max-width: 1200px;

    margin: 40px auto;

    padding: 0 20px;
}

.cart-section h1 {
    text-align: center;

    margin-bottom: 30px;

    font-size: 30px;
}

.cart-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 25px;
}

.cart-card {
    background: white;

    border: 1px solid #ddd;

    border-radius: 10px;

    overflow: hidden;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);

    transition: 0.3s;
}

.cart-card:hover {
    transform: translateY(-5px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cart-card > img {
    width: 100%;

    height: 220px;

    object-fit: cover;
}

.cart-card-info {
    padding: 20px;
}

.cart-card-info h3 {
    font-size: 20px;

    margin-bottom: 10px;
}

.cart-price {
    color: #e63946;

    font-size: 20px;

    font-weight: bold;

    margin-bottom: 15px;
}

.cart-card-info p {
    margin-bottom: 10px;

    color: #555;
}


/* REMOVE BUTTON */

.remove-cart-btn {
    width: 100%;

    margin-top: 10px;

    padding: 10px;

    border: none;

    border-radius: 5px;

    background: #dc3545;

    color: white;

    cursor: pointer;
}

.remove-cart-btn:hover {
    background: #bb2d3b;
}


/* CART SUMMARY */

.cart-summary {
    margin-top: 40px;

    padding: 25px;

    background: #f5f5f5;

    border-radius: 10px;

    display: flex;

    justify-content: space-between;

    align-items: center;
}

.cart-summary h2 {
    margin: 0;
}


/* BUY BUTTON */

.buy-btn {
    padding: 14px 30px;

    border: none;

    border-radius: 6px;

    background: #198754;

    color: white;

    font-size: 18px;

    font-weight: bold;

    cursor: pointer;
}

.buy-btn:hover {
    background: #146c43;
}


/* EMPTY CART */

.empty-cart {
    text-align: center;

    font-size: 20px;

    color: #777;

    padding: 50px;
}


/* =========================================
   AUTHENTICATION
========================================= */

.auth-container {
    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    background: #f5f5f5;

    padding: 20px;
}

.auth-box {
    width: 100%;

    max-width: 450px;

    background: white;

    padding: 35px;

    border-radius: 10px;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.auth-box h1 {
    text-align: center;

    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: bold;
}

.form-group input {
    width: 100%;

    padding: 12px;

    border: 1px solid #ccc;

    border-radius: 5px;

    font-size: 16px;
}

.form-group input:focus {
    outline: none;

    border-color: #198754;
}

.auth-button {
    width: 100%;

    padding: 13px;

    border: none;

    border-radius: 5px;

    background: #198754;

    color: white;

    font-size: 17px;

    cursor: pointer;
}

.auth-button:hover {
    background: #146c43;
}

.auth-error {
    background: #f8d7da;

    color: #842029;

    padding: 12px;

    border-radius: 5px;

    margin-bottom: 20px;
}

.auth-success {
    background: #d1e7dd;

    color: #0f5132;

    padding: 12px;

    border-radius: 5px;

    margin-bottom: 20px;
}

.auth-link {
    text-align: center;

    margin-top: 20px;
}

.auth-link a {
    color: #198754;

    text-decoration: none;

    font-weight: bold;
}


/* =========================================
   QUANTITY
========================================= */

.quantity-control {
    display: flex;

    align-items: center;

    gap: 15px;

    margin: 15px 0;
}

.quantity-control button {
    width: 35px;
    height: 35px;

    border: none;

    border-radius: 5px;

    background: #198754;

    color: white;

    font-size: 20px;

    cursor: pointer;
}

.quantity-control button:hover {
    background: #146c43;
}

.quantity-control span {
    min-width: 30px;

    text-align: center;

    font-size: 18px;

    font-weight: bold;
}


/* =========================================
   CHECKOUT
========================================= */

.checkout-section {
    max-width: 1100px;

    margin: 40px auto;

    padding: 20px;
}

.checkout-section h1 {
    text-align: center;

    margin-bottom: 30px;
}

.checkout-grid {
    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 30px;

    align-items: start;
}

.checkout-items {
    background: white;

    padding: 25px;

    border-radius: 10px;

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.checkout-items h2 {
    margin-bottom: 20px;
}

.checkout-item {
    display: flex;

    align-items: center;

    gap: 20px;

    padding: 20px 0;

    border-bottom: 1px solid #eee;
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item img {
    width: 100px;
    height: 100px;

    object-fit: cover;

    border-radius: 8px;
}

.checkout-item h3 {
    margin: 0 0 10px;
}

.checkout-item p {
    margin: 5px 0;

    color: #666;
}


/* CHECKOUT SUMMARY */

.checkout-summary {
    background: white;

    padding: 25px;

    border-radius: 10px;

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);

    position: sticky;

    top: 85px;
}

.checkout-summary h2 {
    margin-bottom: 25px;
}

.checkout-total {
    font-size: 24px;

    font-weight: bold;

    margin-bottom: 25px;
}

.checkout-summary .buy-btn {
    width: 100%;

    padding: 14px;

    border: none;

    border-radius: 6px;

    background: #198754;

    color: white;

    font-size: 17px;

    cursor: pointer;
}

.checkout-summary .buy-btn:hover {
    background: #146c43;
}


/* =========================================
   RESPONSIVE
========================================= */

/* TABLET */

@media (max-width: 900px) {

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cart-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* PHONE */

@media (max-width: 768px) {

    /* NAVBAR */

    .nav-links {
        display: none;
    }

    .menu-btn {
        display: block;
    }


    /* PRODUCTS */

    .product-grid {
        grid-template-columns: 1fr;
    }


    /* CART */

    .cart-grid {
        grid-template-columns: 1fr;
    }


    /* CHECKOUT */

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
    }

    .checkout-item {
        align-items: flex-start;
    }

    .checkout-item img {
        width: 80px;
        height: 80px;
    }


    /* SLIDER */

    .slider {
        height: 300px;
    }

    .slide-text {
        left: 20px;
        bottom: 20px;

        padding: 12px 18px;
    }

    .slide-text h1 {
        font-size: 22px;
    }

    .slide-text p {
        font-size: 14px;
    }


    /* CART SUMMARY */

    .cart-summary {
        flex-direction: column;

        gap: 20px;

        text-align: center;
    }

    .buy-btn {
        width: 100%;
    }

}


/* SMALL PHONE */

@media (max-width: 480px) {

    #content {
        padding: 15px;
    }

    .slider {
        height: 250px;
    }

    .slide-text {
        left: 10px;
        bottom: 10px;

        padding: 10px 14px;
    }

    .slide-text h1 {
        font-size: 18px;
    }

    .slide-text p {
        font-size: 12px;
    }

    .checkout-section {
        padding: 10px;

        margin: 20px auto;
    }

    .checkout-items,
    .checkout-summary {
        padding: 15px;
    }

    .checkout-item {
        gap: 12px;
    }

    .checkout-item img {
        width: 65px;
        height: 65px;
    }

    .checkout-item h3 {
        font-size: 16px;
    }

    .checkout-total {
        font-size: 20px;
    }

}

