/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #ff4b2b;
    --secondary-color: #ff416c;
    --dark-color: #1a1a1a;
    --bg-color: #f7f9fc;
    --card-bg: #ffffff;
    --text-color: #333333;
    --gray-color: #666666;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: var(--card-bg);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    gap: 0.5rem;
}

.logo img {
    height: 40px;
}

header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-items {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--gray-color);
}

header nav a:hover,
header nav a.active {
    background-color: #f0f0f0;
    color: var(--dark-color);
}

.btn-login {
    background-color: #f0f0f0;
    color: var(--dark-color);
}

/* Hero Section */
.hero {
    padding: 2rem 5%;
    text-align: center;
}

.hero-banner {
    background: linear-gradient(90deg, #ff416c 0%, #ff4b2b 100%);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    gap: 1rem;
}

.hero-banner h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Products Grid */
.products-section {
    padding: 3rem 5%;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* Desktop default */
    gap: 1rem;
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .product-card {
        padding: 0.8rem 0.5rem;
    }

    .product-image {
        height: 120px;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .rating {
        font-size: 0.8rem;
    }

    .hero-banner h1 {
        font-size: 1.2rem;
    }
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #007bff;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.hot {
    background-color: #ffc107;
    color: black;
}

.badge.sale {
    background-color: #007bff;
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.product-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    background-color: #f0f0f0;
    /* Default background if image fails */
}

.product-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}


.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.2rem;
}

.rating {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating span {
    color: var(--gray-color);
    font-weight: 400;
}

.price-container {
    margin-bottom: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.btn-primary {
    background-color: var(--dark-color);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background-color: #333;
}

/* Product Detail Page */
.product-detail-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.detail-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.variations-container {
    margin-bottom: 2rem;
}

.variation-select {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Checkout Page */
.checkout-container {
    max-width: 600px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

/* Admin Panel */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--dark-color);
    color: white;
    padding: 2rem;
}

.sidebar a {
    display: block;
    padding: 1rem;
    color: #ddd;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }

    header {
        /* Allow wrapping */
        flex-wrap: wrap;
        padding: 0.8rem 5%;
        gap: 0.5rem;
        justify-content: center;
        /* Center everything */
    }

    .logo {
        font-size: 1.2rem;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .logo img {
        height: 30px;
    }

    header nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }

    .nav-items {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .auth-items {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    /* Small adjustments to buttons */
    .auth-items .btn-login {
        flex: 1;
        justify-content: center;
        text-align: center;
        max-width: 150px;
    }

    header nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    header nav a i {
        font-size: 0.8rem;
    }
}

/* Variation Cards */
.variation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.variation-card {
    border: 2px solid #eee;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.variation-card:hover {
    border-color: #ddd;
    transform: translateY(-2px);
}

.variation-card.selected {
    border-color: var(--primary-color);
    background-color: #fff0ed;
    box-shadow: 0 4px 12px rgba(255, 75, 43, 0.15);
}

.variation-card .v-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.variation-card .v-price {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.variation-card.selected .v-price {
    color: var(--primary-color);
    font-weight: 700;
}

/* Utility Visibility Classes */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}