/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f5f5f5;
    color: #222;
    min-height: 100vh;
}

a {
    color: inherit;
}


/* =========================
   HEADER
========================= */

header {
    background: #FFD700;
    padding: 15px 30px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    display: block;
}

.logo h1 {
    color: #222;
    font-size: 24px;
}


/* =========================
   SEARCH
========================= */

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    width: 260px;
    padding: 11px 12px;

    border: none;
    outline: none;

    border-radius: 7px 0 0 7px;

    font-size: 15px;
}

.search-box button {
    padding: 11px 15px;

    border: none;

    background: #222;
    color: white;

    cursor: pointer;

    border-radius: 0 7px 7px 0;
}

.search-box button:hover {
    background: #444;
}


/* =========================
   HEADER CART
========================= */

.header-icons a {
    text-decoration: none;
    font-size: 29px;
    color: #222;
}

.header-icons a:hover {
    transform: scale(1.08);
    display: inline-block;
}


/* =========================
   NAVIGATION
========================= */

nav {
    background: #222;
}

nav ul {
    list-style: none;

    display: flex;
    justify-content: center;
    align-items: center;

    flex-wrap: wrap;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;

    padding: 15px 18px;

    color: white;
    text-decoration: none;

    font-weight: bold;
}

nav ul li a:hover {
    background: #333;
    color: #FFD700;
}


/* =========================
   HERO
========================= */

.hero {
    text-align: center;

    padding: 75px 20px;

    background: white;
}

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

.hero p {
    color: #666;
    font-size: 18px;
    margin-bottom: 25px;
}

.hero-button {
    display: inline-block;

    padding: 13px 25px;

    background: #FFD700;
    color: #222;

    border-radius: 8px;

    text-decoration: none;

    font-weight: bold;
}

.hero-button:hover {
    background: #f4c400;
}


/* =========================
   PRODUCTS SECTION
========================= */

.products {
    width: 100%;
    max-width: 1200px;

    margin: auto;

    padding: 40px 20px;
}

.products > h2 {
    text-align: center;
    margin-bottom: 30px;
}


/* =========================
   PRODUCT GRID
========================= */

.product-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );

    gap: 25px;
}

.product {
    background: white;

    padding: 15px;

    border-radius: 12px;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.1);

    text-align: center;

    transition: transform 0.2s ease;
}

.product:hover {
    transform: translateY(-4px);
}

.product img {
    width: 100%;
    height: 220px;

    object-fit: cover;

    border-radius: 10px;

    display: block;
}

.product h3 {
    margin: 15px 0 10px;
}

.product p {
    margin-bottom: 8px;
}

.price {
    color: #ff6600;

    font-size: 21px;

    font-weight: bold;
}


/* =========================
   PRODUCT BUTTON
========================= */

.product button {
    width: 100%;

    padding: 12px;

    margin-top: 10px;

    border: none;

    background: #FFD700;

    color: #222;

    cursor: pointer;

    border-radius: 8px;

    font-weight: bold;

    font-size: 15px;
}

.product button:hover {
    background: #f4c400;
}

.product button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================
   EMPTY / ERROR
========================= */

.empty-message,
.error-message {
    text-align: center;

    padding: 30px;

    background: white;

    border-radius: 10px;
}


/* =========================
   FOOTER
========================= */

footer {
    background: #222;

    color: white;

    text-align: center;

    padding: 20px;

    margin-top: 40px;
}


/* =========================
   ADMIN
========================= */

.admin {
    width: 92%;
    max-width: 1000px;

    margin: 40px auto;

    background: white;

    padding: 25px;

    border-radius: 12px;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.1);
}

.admin h1 {
    text-align: center;
    margin-bottom: 25px;
}

.admin h2 {
    margin-top: 35px;
    margin-bottom: 15px;
}


/* =========================
   ADMIN INPUTS
========================= */

.admin input {
    width: 100%;

    padding: 12px;

    margin: 8px 0;

    border: 1px solid #ccc;

    border-radius: 8px;

    font-size: 16px;

    outline: none;
}

.admin input:focus {
    border-color: #FFD700;
}


/* =========================
   ADMIN ADD BUTTON
========================= */

.admin #add-btn {
    width: 100%;

    padding: 14px;

    margin-top: 10px;

    background: #FFD700;

    color: #222;

    border: none;

    border-radius: 8px;

    font-size: 17px;

    font-weight: bold;

    cursor: pointer;
}

.admin #add-btn:hover {
    background: #f4c400;
}

.admin #add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================
   IMAGE PREVIEW
========================= */

#preview {
    display: none;

    width: 120px;
    height: 120px;

    object-fit: cover;

    border-radius: 10px;

    margin: 12px 0;
}


/* =========================
   TABLE WRAPPER
========================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    margin-top: 20px;
}


/* =========================
   TABLES
========================= */

table {
    width: 100%;

    border-collapse: collapse;

    background: white;
}

table th,
table td {
    border: 1px solid #ddd;

    padding: 12px;

    text-align: center;
}

table th {
    background: #222;
    color: white;
}

table tr:nth-child(even) {
    background: #fafafa;
}

table img {
    width: 70px;
    height: 70px;

    object-fit: cover;

    border-radius: 8px;
}


/* =========================
   DELETE BUTTON
========================= */

.delete {
    background: #e53935 !important;

    color: white !important;

    border: none;

    padding: 8px 14px !important;

    border-radius: 6px;

    cursor: pointer;
}

.delete:hover {
    background: #c62828 !important;
}


/* =========================
   ORDERS
========================= */

.orders-page {
    min-height: 60vh;
}

.orders-table {
    width: 100%;
}

.status {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 20px;

    background: #e8f5e9;

    color: #2e7d32;

    font-weight: bold;

    text-transform: capitalize;
}


/* =========================
   CART
========================= */

.cart-item {
    max-width: 500px;

    margin: 20px auto;
}

.cart-item img {
    max-width: 300px;
    margin: auto;
}


/* =========================
   QUANTITY CONTROLS
========================= */

.quantity-controls {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;

    margin: 15px 0;
}

.quantity-controls button {
    width: 42px !important;

    padding: 8px !important;

    margin: 0 !important;

    font-size: 20px;
}

.quantity-controls span {
    min-width: 30px;

    font-size: 18px;

    font-weight: bold;
}


/* =========================
   REMOVE BUTTON
========================= */

.product .remove {
    background: #e53935;
    color: white;
}

.product .remove:hover {
    background: #c62828;
}


/* =========================
   EMPTY CART
========================= */

.empty-cart {
    background: white;

    text-align: center;

    padding: 40px 20px;

    border-radius: 12px;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.08);
}

.empty-cart h3 {
    margin-bottom: 15px;
}

.empty-cart a {
    display: inline-block;

    background: #FFD700;

    padding: 12px 20px;

    border-radius: 8px;

    text-decoration: none;

    font-weight: bold;
}


/* =========================
   CHECKOUT BUTTON
========================= */

#checkout-btn {
    display: block;

    width: 100%;

    max-width: 500px;

    margin: 25px auto;

    padding: 15px;

    background: #FFD700;

    color: #222;

    border: none;

    border-radius: 8px;

    font-size: 17px;

    font-weight: bold;

    cursor: pointer;
}

#checkout-btn:hover {
    background: #f4c400;
}

#checkout-btn:disabled {
    opacity: 0.6;

    cursor: not-allowed;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    header {
        padding: 12px 15px;
    }

    .container {
        flex-direction: column;

        gap: 12px;
    }

    .logo h1 {
        font-size: 21px;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    nav ul {
        flex-direction: row;
    }

    nav ul li a {
        padding: 12px 10px;

        font-size: 14px;
    }

    .hero {
        padding: 55px 18px;
    }

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

    .hero p {
        font-size: 16px;
    }

    .products {
        padding: 30px 15px;
    }

    .product-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 15px;
    }

    .product {
        padding: 10px;
    }

    .product img {
        height: 170px;
    }

    .product h3 {
        font-size: 16px;
    }

    .product button {
        font-size: 14px;

        padding: 10px;
    }

    .admin {
        width: 95%;

        margin: 25px auto;

        padding: 15px;
    }

    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 8px;
    }

    table img {
        width: 55px;
        height: 55px;
    }

}


/* =========================
   VERY SMALL PHONES
========================= */

@media (max-width: 400px) {

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product img {
        height: 220px;
    }

    nav ul li a {
        padding: 10px 7px;

        font-size: 13px;
    }

}