/* ============================================
   E-COMMERCE COMPLETE STYLESHEET
   File: assets/css/style.css
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --text: #374151;
    --text-light: #6b7280;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    font-size: 16px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Top Bar */
.top-bar {
    background: var(--dark);
    color: var(--white);
    font-size: 0.875rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.3s;
}

.top-bar a:hover {
    color: var(--secondary);
}

.top-bar span {
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.top-bar i {
    font-size: 0.9rem;
}

/* Main Header */
.main-header {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar form {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 25px;
    overflow: hidden;
    background: var(--white);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    outline: none;
}

.search-bar button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    transition: 0.3s;
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 25px;
    align-items: center;
}

.header-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    position: relative;
    transition: color 0.3s;
}

.header-icon:hover {
    color: var(--primary);
}

.header-icon i {
    font-size: 1.5rem;
    margin-bottom: 3px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 5px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 5px;
}

/* Navigation */
.main-nav {
    background: var(--light);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: 0.3s;
}

.nav-menu > li > a:hover {
    background: var(--primary);
    color: var(--white);
}

.nav-menu > li > a i {
    margin-left: 5px;
    font-size: 0.75rem;
}

/* Dropdown Menu */
.has-dropdown {
    position: relative;
}

.has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
    border-radius: 0 0 8px 8px;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    border-bottom: 1px solid var(--border);
}

.dropdown li:last-child {
    border-bottom: none;
}

.dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    transition: 0.3s;
}

.dropdown a:hover {
    background: var(--light);
    padding-left: 25px;
    color: var(--primary);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--secondary);
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    padding: 0;
    margin-left: 15px;
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path fill="rgba(255,255,255,0.1)" d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero::before {
    z-index: 1;
}

.hero-content {
    z-index: 2;
    position: relative;
}

.hero-slides {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    opacity: 0.3; /* adjust as you want */
}




/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-cart {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cart:hover {
    background: var(--primary-dark);
}

/* ============================================
   SECTIONS
   ============================================ */

section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--dark);
    font-weight: 700;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.875rem;
    z-index: 2;
}

.btn-favorite {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 2;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite:hover {
    background: var(--danger);
    color: var(--white);
    transform: scale(1.1);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-info h3 a {
    text-decoration: none;
    color: var(--text);
    transition: color 0.3s;
}

.product-info h3 a:hover {
    color: var(--primary);
}

.product-price {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.original-price {
    font-size: 1.1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

/* ============================================
   CATEGORIES GRID
   ============================================ */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.category-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card h3 {
    padding: 15px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--dark);
    color: var(--white);
    margin-top: 60px;
}

.footer-main {
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h3, 
.footer-col h4 {
    margin-bottom: 20px;
    color: var(--white);
    font-weight: 600;
}

.footer-col p {
    color: rgba(255,255,255,0.8);
    line-height: 1.8;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-col a:hover {
    color: var(--white);
    padding-left: 5px;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    padding: 0;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
    font-size: 0.95rem;
}

.newsletter-form button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: 0.3s;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 30px;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-methods {
    display: flex;
    gap: 15px;
    font-size: 2rem;
    opacity: 0.8;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    z-index: 999;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Top Bar */
    .top-bar .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .top-bar-left,
    .top-bar-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .top-bar span,
    .top-bar a {
        margin: 0 10px;
    }
    
    /* Header */
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Navigation */
    .nav-menu {
        display: none;
        flex-direction: column;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu > li > a {
        padding: 12px 20px;
    }
    
    .has-dropdown .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.05);
        display: none;
    }
    
    .has-dropdown.active .dropdown {
        display: block;
    }
    
    /* Hero */
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Sections */
    section {
        padding: 40px 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .product-card img {
        height: 180px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-info h3 {
        font-size: 1rem;
    }
    
    .current-price {
        font-size: 1.25rem;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .payment-methods {
        font-size: 1.5rem;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card img {
        height: 150px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}