/* ElectroShop - Modern Electronics Ecommerce */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0f172a;
    --accent: #22d3ee;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Top Bar */
.top-bar {
    background: var(--secondary);
    color: #94a3b8;
    font-size: 0.8125rem;
    padding: 0.5rem 0;
}

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

.top-bar a {
    color: #cbd5e1;
    margin-left: 1rem;
    transition: color var(--transition);
}

.top-bar a:hover {
    color: white;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.35rem;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text span {
    color: var(--primary);
}

.search-form {
    flex: 1;
    max-width: 480px;
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.65rem 1.25rem;
    font-size: 0.9375rem;
    outline: none;
}

.search-form button {
    background: transparent;
    border: none;
    padding: 0.65rem 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.search-form button:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

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

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 0.5rem;
}

/* Navigation */
.nav {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-list a {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all var(--transition);
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 600px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero h1 span {
    background: linear-gradient(90deg, #22d3ee, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

/* Sections */
.section {
    padding: 3.5rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.section-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.section-link:hover {
    text-decoration: underline;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all var(--transition);
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.category-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: #f1f5f9;
    overflow: hidden;
}

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

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

.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.product-badge.featured {
    background: var(--primary);
}

.product-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: var(--primary);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.stars {
    color: #fbbf24;
    letter-spacing: -1px;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.product-old-price {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .btn {
    flex: 1;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2.5rem 0;
}

.product-gallery {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.product-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.product-info h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.product-price-large {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.product-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.features-list {
    list-style: none;
    margin-bottom: 2rem;
}

.features-list li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.features-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.qty-selector label {
    font-weight: 500;
}

.qty-selector input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1rem;
}

/* Filters / Sidebar */
.products-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filters h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.filter-group label {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-group input[type="radio"],
.filter-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Cart */
.cart-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 2rem;
}

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

.cart-table th {
    background: var(--bg);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-product img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cart-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 360px;
    margin-left: auto;
}

.cart-summary h3 {
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 1rem;
}

/* Forms */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.9375rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: #94a3b8;
    padding: 4rem 0 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin: 1rem 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

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

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

.footer-col h4 {
    color: white;
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

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

.footer-col li {
    margin-bottom: 0.6rem;
}

.footer-col a {
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 0.875rem;
}

.newsletter-form input::placeholder {
    color: #64748b;
}

.newsletter-form button {
    padding: 0.65rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 900px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    .filters {
        position: static;
    }
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .mobile-menu-btn {
        display: flex;
    }
    .nav {
        display: none;
    }
    .nav.open {
        display: block;
    }
    .nav-list {
        flex-direction: column;
        padding: 1rem 0;
    }
    .search-form {
        display: none;
    }
    .header-inner {
        justify-content: space-between;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .top-bar .container {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
    }
    .cart-table {
        display: block;
        overflow-x: auto;
    }
}

/* Page title area */
.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    margin-bottom: 0;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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