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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.03);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #b8b8c0;
    --accent: #8b5cf6;
    --accent-glow: #a78bfa;
    --gold: #fbbf24;
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 100%;
    padding: 0;
}

/* Header */
header {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    cursor: pointer;
}

.nav-icons {
    display: flex;
    gap: 1rem;
}

.nav-icon {
    width: 36px;
    height: 36px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-icon:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Shop Section */
.shop-section {
    padding: 1.5rem 1rem;
}

.shop-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Products Grid - Mobile First */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
    border-color: var(--accent);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.product-image::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
    pointer-events: none;
}

/* Fallback for when background image fails to load */
.product-image:not([style*="background-image"])::before,
.product-image[style*="background-image: url('')"]::before,
.product-image[style*="background-image: url(\"\")"]::before {
    content: '🖼️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

/* Ensure proper aspect ratio and image fitting */
.product-image,
.product-detail-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(251, 191, 36, 0.9);
    color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.form-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);
}

/* Cart */
.cart-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

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

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--accent);
    font-weight: 700;
}

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

.quantity-btn {
    width: 30px;
    height: 30px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--glass-hover);
}

.quantity-input {
    width: 50px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.25rem;
    color: var(--text-primary);
}

/* Product Detail - Mobile First */
.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
}

.product-detail-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.product-detail-info h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.product-detail-price {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Product Gallery Styles */
.product-gallery {
    width: 100%;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image-container:hover img {
    transform: scale(1.05);
}

.thumbnail-gallery {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    border-color: var(--accent);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--accent);
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.fullscreen-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.product-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Admin Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-nav a {
    background: var(--glass);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--accent);
    color: white;
}

.table-container {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

th, td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
}

tr:hover {
    background: var(--glass-hover);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-new {
    background: var(--accent);
    color: white;
}

.status-processing {
    background: var(--gold);
    color: var(--bg-primary);
}

.status-shipped {
    background: #10b981;
    color: white;
}

/* Mobile First Responsive Design */

/* Small screens (480px and up) */
@media (min-width: 30rem) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .cart-item img {
        width: 70px;
        height: 70px;
    }
}

/* Medium screens (640px and up) */
@media (min-width: 40rem) {
    nav {
        padding: 1rem 1.5rem;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .shop-section {
        padding: 2rem 1.5rem;
    }
    
    .shop-section h1 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-info {
        padding: 1.25rem;
    }
    
    .form-container {
        margin: 1.5rem auto;
        padding: 0 1.5rem;
    }
    
    .form-card {
        padding: 1.75rem;
        border-radius: 18px;
    }
    
    .cart-item {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .cart-item img {
        width: 75px;
        height: 75px;
    }
    
    .admin-container {
        padding: 1.5rem;
    }
    
    .admin-nav {
        gap: 0.75rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem;
    }
}

/* Large screens (768px and up) */
@media (min-width: 48rem) {
    .logo {
        font-size: 1.5rem;
    }
    
    .shop-section h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .product-image {
        height: 250px;
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem;
    }
    
    .product-detail-image {
        height: 400px;
    }

    .main-image-container {
        height: 400px;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .product-detail-info h1 {
        font-size: 2rem;
    }
    
    .product-detail-price {
        font-size: 2rem;
    }
    
    .form-container {
        margin: 2rem auto;
    }
    
    .form-card {
        padding: 2rem;
        border-radius: 20px;
    }
    
    .cart-item {
        padding: 1.5rem;
    }
    
    .cart-item img {
        width: 80px;
        height: 80px;
    }
    
    .admin-container {
        padding: 2rem;
    }
    
    .admin-nav {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    table {
        font-size: 1rem;
    }
    
    th, td {
        padding: 1rem;
    }
}

/* Extra large screens (1024px and up) */
@media (min-width: 64rem) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .product-image {
        height: 280px;
    }
    
    .product-detail-image {
        height: 450px;
    }
}