:root {
    --primary: #1a3a52;
    --primary-dark: #0f2538;
    --secondary: #e91e63;
    --accent: #00bcd4;
    --light: #f5f7fa;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --border: #e1e8ed;
    --shadow: 0 2px 20px rgba(0,0,0,0.08);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafbfc;
    color: var(--dark);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header-top {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
}

.header-main {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo img { max-height: 45px; width: auto; }

.main-nav { display: flex; gap: 30px; align-items: center; }

.main-nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.main-nav a:hover { color: var(--secondary); }

.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.header-actions { display: flex; gap: 15px; align-items: center; }

.icon-btn {
    text-decoration: none;
    font-size: 22px;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover { background: var(--light); }

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--secondary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn { display: none; font-size: 24px; background: none; border: none; cursor: pointer; }

.mobile-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    padding: 20px;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(26,58,82,0.3); }

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover { background: #c2185b; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm { padding: 8px 18px; font-size: 14px; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 { font-size: 48px; font-weight: 700; margin-bottom: 20px; }

.hero p { font-size: 20px; opacity: 0.9; margin-bottom: 30px; }

/* Products */
.section { padding: 60px 0; }

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.product-image {
    height: 280px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img { transform: scale(1.05); }

.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-sale { background: var(--secondary); color: white; }

.badge-new { background: var(--accent); color: white; }

.product-info { padding: 20px; }

.product-category {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    text-decoration: none;
    display: block;
    line-height: 1.4;
}

.product-name:hover { color: var(--primary); }

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price { font-size: 22px; font-weight: 700; color: var(--primary); }

.old-price { font-size: 16px; color: var(--gray); text-decoration: line-through; }

.product-actions { display: flex; gap: 10px; }

.btn-add-cart {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart:hover { background: var(--primary-dark); }

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    color: var(--primary);
}

.category-card h3 { font-size: 18px; font-weight: 600; margin-top: 15px; }

/* Product Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 40px 0;
}

.product-gallery {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.product-gallery img {
    width: 100%;
    border-radius: 8px;
}

.product-meta h1 { font-size: 32px; font-weight: 700; margin-bottom: 15px; }

.product-meta .price { font-size: 36px; margin-bottom: 20px; }

.product-meta .description { color: var(--gray); margin-bottom: 30px; line-height: 1.8; }

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

/* Cart */
.cart-container { max-width: 900px; margin: 40px auto; }

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.cart-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }

.cart-item h3 { font-size: 18px; font-weight: 600; }

.cart-item .remove-btn {
    color: var(--secondary);
    cursor: pointer;
    font-size: 20px;
    background: none;
    border: none;
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-summary-row.total {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: none;
    margin-top: 10px;
}

/* Forms */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Footer */
.main-footer {
    background: var(--primary-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 10px; }

.footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }

.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: white;
    padding: 30px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .logo { padding: 0 25px 30px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }

.admin-sidebar .logo img { max-height: 40px; }

.admin-nav { list-style: none; }

.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.admin-nav li a:hover, .admin-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid var(--secondary);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f0f2f5;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.admin-content { padding: 30px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card h3 { font-size: 14px; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }

.stat-card .value { font-size: 32px; font-weight: 700; color: var(--primary); }

.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    background: var(--light);
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
}

.data-table td { padding: 15px 20px; border-bottom: 1px solid var(--border); }

.data-table tr:hover { background: var(--light); }

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending { background: #fff3cd; color: #856404; }

.status-processing { background: #cce5ff; color: #004085; }

.status-shipped { background: #d4edda; color: #155724; }

.status-delivered { background: #d1ecf1; color: #0c5460; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .mobile-menu.active { display: flex; }
    
    .hero h1 { font-size: 32px; }
    .hero { padding: 50px 0; }
    
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .product-image { height: 200px; }
    
    .product-detail { grid-template-columns: 1fr; gap: 30px; }
    
    .cart-item { grid-template-columns: 80px 1fr; gap: 15px; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    
    .admin-sidebar { width: 100%; position: relative; height: auto; }
    .admin-main { margin-left: 0; }
    .admin-layout { flex-direction: column; }
}