/* ================== Global Styles ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: #f5f6fa;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* ================== Header ================== */
.main-header {
    background: #1e1e1e;
    padding: 15px 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #fff;
    font-size: 26px;
    font-weight: bold;
    text-decoration: none;
}

.logo span {
    color: #fbc531;
}

/* Navbar links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative; /* for dropdown positioning */
}

.nav-links a, .nav-links .dropbtn {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    padding: 0 5px;
    display: inline-block;
}

.nav-links a:hover, .nav-links .dropbtn:hover {
    color: #fbc531;
}

/* ================== Dropdown ================== */
.nav-links .dropdown {
    position: relative;
    display: inline-block;
}

.nav-links .dropbtn::after {
    content: " ▼";
    font-size: 0.6em;
    margin-left: 5px;
}

.nav-links .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #333;
    min-width: 150px;
    border-radius: 5px;
    overflow: hidden;
    z-index: 1000;
}

.nav-links .dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links .dropdown-content a:hover {
    background-color: #555;
}

.nav-links .dropdown:hover .dropdown-content {
    display: block;
}

/* ================== Hero Section ================== */
.hero {
    background: linear-gradient(to right, #273c75, #40739e);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

/* ================== Products ================== */
.product-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 30px;
}

/* Category filter menu */
.category-filter {
    margin: 20px 0 40px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    font-weight: bold;
}

.category-filter a {
    display: inline-block;
    padding: 10px 20px;
    background: #0984e3;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.category-filter a:hover {
    background: #74b9ff;
    color: #fff;
    transform: translateY(-2px);
}

.category-filter a.active {
    background: #55efc4;  /* Highlight color */
    color: #2d3436;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, auto)); /* fix stretch for single product */
    gap: 25px;
    justify-content: center; /* center single product */
    opacity: 0;               /* start hidden for fade-in effect */
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-6px);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 6px;
}

.product-card h3 {
    margin: 15px 0 10px;
}

.price {
    color: #27ae60;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn {
    display: inline-block;
    background: #273c75;
    color: #fff;
    padding: 10px 18px;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: #40739e;
}

/* ================== Footer ================== */
.main-footer {
    background: #1e1e1e;
    color: #bbb;
    padding: 20px 0;
    margin-top: 60px;
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* ================== Product Details ================== */
.product-details {
    padding: 60px 0;
}

.product-flex {
    display: flex;
    gap: 50px;
    align-items: center;
}

.product-image img {
    width: 100%;
    max-width: 450px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-info h1 {
    font-size: 34px;
    margin-bottom: 15px;
}

.product-price {
    font-size: 26px;
    color: #27ae60;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-desc {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* ================== Cart Page ================== */
.cart-page {
    padding: 60px 0;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.cart-table th, .cart-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.cart-table th {
    background: #f1f2f6;
}

.cart-table img {
    width: 80px;
    border-radius: 6px;
}

.cart-summary {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary h3 {
    font-size: 24px;
}

.cart-table input[type=number] {
    width: 60px;
    padding: 6px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.remove-btn {
    padding: 6px 12px;
    background: #e84118;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.remove-btn:hover {
    background: #c23616;
}

.cart-summary button.btn {
    margin-right: 15px;
}

/* ================== Auth Pages ================== */
.auth-page {
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-box {
    background: #fff;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 25px;
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.auth-box button {
    width: 100%;
    cursor: pointer;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-link a {
    color: #273c75;
    text-decoration: none;
}

/* ================== Checkout Page ================== */
.checkout-page {
    padding: 60px 0;
}

.checkout-flex {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.checkout-summary,
.checkout-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    flex: 1;
    min-width: 300px;
}

.checkout-summary h3,
.checkout-form h3 {
    margin-bottom: 20px;
}

.checkout-summary ul {
    list-style: none;
    margin-bottom: 20px;
}

.checkout-summary li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.checkout-total {
    font-size: 20px;
    font-weight: bold;
    color: #27ae60;
}

.checkout-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.checkout-form button {
    width: 100%;
    padding: 12px;
    background: #273c75;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.checkout-form button:hover {
    background: #40739e;
}

/* ================== Page Wrapper ================== */
.page-wrapper {
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

/* ================== Footer ================== */
footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* ================== Admin Panel ================== */
.admin-login, .admin-dashboard {
    max-width: 900px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 25px;
}

.admin-login form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-login input[type="text"], 
.admin-login input[type="password"] {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.admin-login button {
    padding: 10px;
    background: #0984e3;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.admin-login button:hover {
    background: #74b9ff;
}

.admin-dashboard table, .admin-dashboard th, .admin-dashboard td {
    border: 1px solid #ddd;
    border-collapse: collapse;
    padding: 10px;
    text-align: center;
}

.admin-dashboard th {
    background-color: #0984e3;
    color: #fff;
}

.admin-dashboard tr:nth-child(even) {
    background-color: #f2f2f2;
}

.admin-dashboard a {
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: #fff;
    background-color: #00b894;
    margin: 2px;
    display: inline-block;
}

.admin-dashboard a:hover {
    opacity: 0.8;
}

.admin-dashboard a[href*="update_order"] {
    background-color: #d63031;
}

.admin-dashboard a[href*="add_product"] {
    background-color: #0984e3;
    margin-bottom: 15px;
    display: inline-block;
}

/* ================== Responsive ================== */
@media screen and (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    .nav-links a, .nav-links .dropbtn {
        padding: 10px 0;
    }
    .nav-links .dropdown-content {
        position: relative;
        top: 0;
        right: 0;
        border-radius: 0;
    }
    .admin-login, .admin-dashboard {
        width: 90%;
        padding: 20px;
    }
    .admin-dashboard table, .admin-dashboard th, .admin-dashboard td {
        font-size: 14px;
        padding: 8px;
    }
}
