/* CSS Variables for Theming */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #2c3e50;
    --accent-color: #f39c12;
    --text-color: #333333;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --header-bg: #ffffff;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --hover-bg: #f5f5f5;
}

/* Theme Variations */
body.theme-red { --primary-color: #e74c3c; }
body.theme-blue { --primary-color: #3498db; }
body.theme-green { --primary-color: #27ae60; }
body.theme-orange { --primary-color: #f39c12; }

/* Dark Mode */
body.dark-mode {
    --text-color: #ecf0f1;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --header-bg: #2d2d2d;
    --hover-bg: #3d3d3d;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.top-bar {
    background: var(--secondary-color);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.made-in-pk-badge {
    background: #27ae60;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Header */
.main-header {
    background: var(--header-bg);
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar form {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    background: var(--bg-color);
    color: var(--text-color);
}

.search-bar button {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.search-bar button:hover {
    opacity: 0.9;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.color-picker {
    display: flex;
    gap: 5px;
}

.color-dot {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-dot:hover {
    transform: scale(1.2);
    border-color: var(--text-color);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

.btn-login, .btn-register {
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-login {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: white;
}

.btn-register {
    background: var(--primary-color);
    color: white;
}

.btn-register:hover {
    opacity: 0.9;
}

.cart-icon {
    position: relative;
    color: var(--text-color);
    font-size: 24px;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* User Menu */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 20px;
    background: var(--hover-bg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: var(--shadow);
    min-width: 220px;
    display: none;
    z-index: 1000;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

/* Dropdown Menu Enhancements */
.dropdown-header {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.logout-link {
    color: #e74c3c !important;
}

.logout-link:hover {
    background: #fde8e8 !important;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: var(--hover-bg);
}

.dropdown-menu i {
    margin-right: 8px;
    width: 20px;
}

/* Navigation */
.main-nav {
    background: var(--secondary-color);
    padding: 10px 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a i {
    margin-right: 5px;
    font-size: 14px;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.nav-menu .dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: 5px;
    display: none;
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content li {
    list-style: none;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 10px 15px;
    display: block;
}

.dropdown-content a:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* Admin Quick Bar */
.admin-quick-bar {
    background: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding: 0;
}

.admin-quick-links {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.admin-badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 10px;
}

.admin-badge i {
    margin-right: 5px;
}

.admin-quick-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 3px;
    transition: all 0.3s;
}

.admin-quick-links a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-quick-links .view-site {
    margin-left: auto;
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 400px);
    padding: 40px 0;
}

/* Brand Section */
.brands-section {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 32px;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--primary-color);
    margin: 10px auto;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    align-items: center;
}

.brand-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    cursor: pointer;
}

.brand-card:hover {
    transform: translateY(-5px);
}

.brand-card img {
    max-width: 100%;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.brand-card h3 {
    font-size: 14px;
    color: var(--text-color);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #27ae60;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 15px;
}

.product-brand {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-price small {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.3s;
}

.btn-add-cart:hover {
    opacity: 0.9;
}

/* Made in Pakistan Banner */
.made-in-pk-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 10px;
    margin: 40px 0;
}

.made-in-pk-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.made-in-pk-header i {
    font-size: 40px;
}

.made-in-pk-header h2 {
    font-size: 32px;
}

/* Footer */
.main-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 0;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.contact-info i {
    width: 20px;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

table tr:hover {
    background: var(--hover-bg);
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }

/* Responsive Navigation */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary-color);
        padding: 20px;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        padding: 12px;
        display: block;
    }
    
    .dropdown-content {
        position: static;
        background: rgba(0,0,0,0.1);
        box-shadow: none;
        padding-left: 20px;
    }
    
    .dropdown:hover .dropdown-content {
        display: none;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
}

/* Admin Quick Bar Responsive */
@media (max-width: 768px) {
    .admin-quick-links {
        justify-content: center;
    }
    
    .admin-quick-links .view-site {
        margin-left: 0;
    }
}

/* Responsive Design - Mobile First */

/* Tablet Styles */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        margin-top: 15px;
    }
    
    .brand-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 22px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .theme-controls {
        display: none;
    }
    
    .btn-login, .btn-register {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .nav-menu {
        justify-content: center;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .made-in-pk-section {
        padding: 20px;
    }
    
    .made-in-pk-header h2 {
        font-size: 22px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .user-name span {
        display: none;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .brand-card {
        padding: 10px;
    }
    
    .brand-card h3 {
        font-size: 12px;
    }
}