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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f8f9fa;
}

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

/* Navbar */
.navbar {
    background: #ffffff;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    border-bottom: 3px solid #1a237e;
}

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

.nav-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-image {
    height: 40px;
    width: auto;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a237e;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #1a237e;
    background: rgba(26, 35, 126, 0.05);
}

.nav-links a.active {
    color: #1a237e;
    background: rgba(26, 35, 126, 0.08);
}

.nav-links a i {
    margin-right: 6px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 0.5rem 0;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content a {
    padding: 0.6rem 1.2rem;
    display: block;
    color: #333;
    font-weight: 400;
    border-radius: 0;
}

.dropdown-content a:hover {
    background: #f0f2f7;
    color: #1a237e;
}

.cart-link {
    position: relative;
    background: #1a237e;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 50px !important;
}

.cart-link:hover {
    background: #283593 !important;
    color: white !important;
}

.cart-badge {
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    position: absolute;
    top: -6px;
    right: -6px;
    border: 2px solid white;
}

.admin-link {
    background: #e8eaf6;
    color: #1a237e !important;
}

.admin-link:hover {
    background: #c5cae9 !important;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1a237e;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

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

.header-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.header-content .subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
}

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

.filter-sort select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1a237e;
    color: white;
}

.btn-primary:hover {
    background: #283593;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.3);
}

.btn-success {
    background: #25D366;
    color: white;
}

.btn-success:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-secondary {
    background: #e8eaf6;
    color: #1a237e;
}

.btn-secondary:hover {
    background: #c5cae9;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 0 2rem;
}

.section-header {
    text-align: center;
    margin: 2rem 0 1.5rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #1a237e;
    font-weight: 800;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background: #ff9800;
    color: white;
}

.badge-danger {
    background: #f44336;
    color: white;
}

.product-image {
    height: 220px;
    overflow: hidden;
    background: #f5f7fa;
    position: relative;
}

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

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

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    background: #f5f7fa;
}

.no-image i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.product-info {
    padding: 1rem 1.2rem 1.2rem;
}

.product-category {
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    min-height: 2.8rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.product-rating span {
    color: #666;
    margin-left: 0.25rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a237e;
    margin: 0.5rem 0;
}

.product-stock {
    margin-bottom: 0.75rem;
}

.in-stock {
    color: #4caf50;
    font-size: 0.85rem;
    font-weight: 500;
}

.out-of-stock {
    color: #f44336;
    font-size: 0.85rem;
    font-weight: 500;
}

.in-stock i, .out-of-stock i {
    margin-right: 0.25rem;
}

.add-to-cart-form {
    display: inline-block;
}

/* Features Section */
.features-section {
    background: white;
    padding: 3rem 0;
    margin-top: 2rem;
    border-top: 1px solid #eee;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 2.5rem;
    color: #1a237e;
    margin-bottom: 0.5rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.feature-item p {
    color: #666;
    font-size: 0.9rem;
}

/* Product List Layout */
.product-list-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    padding: 0 0 2rem;
}

.product-filters {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.filter-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.filter-card h4 {
    margin-bottom: 0.75rem;
    color: #1a237e;
    font-size: 1rem;
}

.filter-list {
    list-style: none;
    padding: 0;
}

.filter-list li {
    margin-bottom: 0.25rem;
}

.filter-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-list a:hover {
    background: #f0f2f7;
    color: #1a237e;
}

.filter-list a.active {
    background: #1a237e;
    color: white;
}

.filter-list .count {
    color: #999;
    font-size: 0.85rem;
}

.filter-list a.active .count {
    color: rgba(255,255,255,0.7);
}

.price-slider {
    width: 100%;
    margin: 0.5rem 0;
}

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

.price-inputs input {
    width: 70px;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

/* Cart Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    padding: 0 0 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.2rem;
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.cart-item-image {
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f7fa;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-header h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    flex: 1;
}

.btn-remove {
    color: #dc3545;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #fee;
    color: #c82333;
}

.cart-item-meta {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    align-items: center;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.1rem;
}

.btn-qty {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-qty:hover:not(:disabled) {
    background: #1a237e;
    color: white;
}

.btn-qty:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-subtotal {
    font-weight: 500;
}

.cart-item-subtotal strong {
    color: #1a237e;
}

/* Cart Summary */
.cart-summary {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.summary-card h3 {
    color: #1a237e;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.summary-divider {
    border-top: 1px solid #eee;
    margin: 0.5rem 0;
}

.summary-row.total {
    font-size: 1.2rem;
    color: #1a237e;
}

.summary-actions {
    margin-top: 1.5rem;
}

.checkout-note {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
}

.empty-cart-icon {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-cart h2 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.empty-cart p {
    color: #666;
    margin-bottom: 0.25rem;
}

.empty-cart-sub {
    color: #999 !important;
    margin-bottom: 2rem !important;
}

.empty-cart-actions {
    margin: 2rem 0;
}

.empty-cart-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.empty-cart-features .feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.empty-cart-features .feature i {
    color: #1a237e;
    font-size: 1.2rem;
}

/* Messages */
.messages-container {
    max-width: 1280px;
    margin: 1rem auto;
    padding: 0 20px;
}

.alert {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.5s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background: white;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #f0f2f7;
    border-color: #1a237e;
}

.page-link.active {
    background: #1a237e;
    color: white;
    border-color: #1a237e;
}

/* Footer */
footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-brand h3 {
    font-size: 1.3rem;
    color: white;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

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

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #1a237e;
    transform: translateY(-2px);
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section a {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin: 0.4rem 0;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #64b5f6;
}

.footer-section a i {
    margin-right: 0.5rem;
    font-size: 0.7rem;
}

.footer-section p {
    color: rgba(255,255,255,0.7);
    margin: 0.4rem 0;
}

.footer-section p i {
    margin-right: 0.5rem;
    color: #64b5f6;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .product-list-layout {
        grid-template-columns: 1fr;
    }
    
    .product-filters {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: relative;
        top: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        gap: 0.5rem;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .dropdown-content {
        position: relative;
        box-shadow: none;
        padding-left: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        padding: 0.8rem;
    }
    
    .cart-item-image {
        height: 80px;
    }
    
    .cart-item-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .feature-item {
        padding: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .empty-cart-features {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 0.6rem;
    }
    
    .product-info h3 {
        font-size: 0.85rem;
        min-height: 2.2rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .page-header {
        padding: 1.5rem 0;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
}