* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background: #f7f8fa;
    color: #222;
}

/* NAVBAR */

.navbar {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

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

.logo span {
    color: #2563eb;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

nav a:hover {
    color: #2563eb;
}

.cart-button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

#cart-count {
    background: white;
    color: #2563eb;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 5px;
    font-weight: bold;
}


/* HERO */

.hero {
    min-height: 520px;
    background: linear-gradient(
        135deg,
        #111827,
        #2563eb
    );

    display: flex;
    align-items: center;
    padding: 60px 7%;
    color: white;
}

.hero-content {
    max-width: 650px;
}

.hero-small {
    letter-spacing: 3px;
    font-size: 14px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 55px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero h1 span {
    display: block;
}

.hero p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 30px;
}

.hero-button {
    display: inline-block;
    background: white;
    color: #2563eb;
    padding: 14px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}


/* PRODUCTS */

.products-section {
    padding: 80px 7%;
}

.section-label {
    color: #2563eb;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
}

.section-heading h2 {
    font-size: 36px;
    margin-top: 10px;
}


/* CONTROLS */

.shop-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin: 35px 0;
}

.shop-controls input,
.shop-controls select {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 15px;
}


/* PRODUCTS GRID */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.product-image {
    height: 220px;
    width: 100%;
    object-fit: contain;
    padding: 20px;
    background: #f8fafc;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: #777;
    font-size: 13px;
    text-transform: capitalize;
}

.product-title {
    font-size: 17px;
    margin: 8px 0;
    height: 42px;
}

.product-rating {
    margin-bottom: 12px;
}

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

.product-price {
    font-size: 20px;
    font-weight: bold;
}

.add-button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
}

.add-button:hover {
    background: #1d4ed8;
}


/* LOADING */

.loading {
    text-align: center;
    padding: 50px;
    font-size: 18px;
}

.hidden {
    display: none !important;
}


/* ERROR */

.error-message {
    text-align: center;
    padding: 30px;
    color: #dc2626;
}


/* NO PRODUCTS */

.no-products {
    text-align: center;
    padding: 60px;
}

.no-products h3 {
    margin-bottom: 10px;
}


/* CART */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: white;
    z-index: 300;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #ddd;
}

.cart-header button,
.close-modal {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

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

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-controls button {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.remove-item {
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 8px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    margin-bottom: 15px;
}

.checkout-button,
.clear-cart {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
}

.checkout-button {
    background: #2563eb;
    color: white;
}

.clear-cart {
    background: #eee;
}


/* OVERLAY */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}

.overlay.active {
    display: block;
}


/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 800px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 30px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
}


/* PRODUCT DETAILS */

.details-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.details-image {
    width: 100%;
    height: 350px;
    object-fit: contain;
    background: #f8fafc;
}

.details-info h2 {
    font-size: 30px;
    margin-bottom: 15px;
}

.details-info p {
    line-height: 1.7;
    margin-bottom: 15px;
}

.details-price {
    font-size: 30px;
    font-weight: bold;
    margin: 20px 0;
}

.details-button {
    width: 100%;
    padding: 14px;
    border: none;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}


/* CHECKOUT */

.checkout-content {
    max-width: 600px;
}

.checkout-content h2 {
    font-size: 30px;
    margin-bottom: 8px;
}

.checkout-description {
    color: #777;
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 7px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.order-success {
    text-align: center;
    padding: 30px;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 8px;
    margin-top: 20px;
}


/* TOAST */

.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #111827;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* FOOTER */

footer {
    background: #111827;
    color: white;
    padding: 60px 7% 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-content h3,
.footer-content h4 {
    margin-bottom: 15px;
}

.footer-content p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-content a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    margin-bottom: 10px;
}

.copyright {
    text-align: center;
    border-top: 1px solid #374151;
    padding-top: 20px;
    color: #9ca3af;
}


/* TABLET */

@media (max-width: 1000px) {

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}


/* MOBILE */

@media (max-width: 700px) {

    .navbar {
        padding: 0 20px;
    }

    nav {
        display: none;
    }

    .hero {
        padding: 50px 25px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .products-section {
        padding: 50px 20px;
    }

    .shop-controls {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-image {
        height: 170px;
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .add-button {
        width: 100%;
    }

    .details-container {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

}