/* ============================================
   MODEX ECOMMERCE - PROFESSIONAL STYLES
   ============================================ */

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #334155; /* Modern Slate Text */
    background: #f8fafc; /* Very light cool grey */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
}

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

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   HEADER - FIXED & ANIMATED
   ============================================ */
.header {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    animation: fadeInDown 0.6s ease-out;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    color: #ef4444; /* Modern Red */
    text-decoration: none;
}

.logo h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.5px;
}

.header-search {
    flex: 1;
    max-width: 500px;
    min-width: 200px;
}

.header-search form {
    display: flex;
    background: #f1f5f9;
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.header-search form:focus-within {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.header-search input {
    flex: 1;
    padding: 12px 25px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #334155;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.header-search button {
    padding: 12px 28px;
    background: #ef4444;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.header-search button:hover {
    background: #dc2626;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.header-actions a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-actions a:hover {
    color: #ef4444;
    transform: translateY(-2px);
}

.header-actions a i {
    font-size: 18px;
}

.cart-count {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 3px;
    min-width: 20px;
    text-align: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-menu-btn {
    display: none;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    background: none;
    border: none;
    color: #1e293b;
    transition: color 0.3s;
}
.mobile-menu-btn:hover { color: #ef4444; }

/* Navigation */
.main-nav {
    background: #1e293b; /* Deep professional slate */
    width: 100%;
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav ul li {
    position: relative;
}

.main-nav ul li a {
    display: block;
    padding: 15px 25px;
    color: #f8fafc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.main-nav ul li a:hover {
    background: #334155;
    color: #ef4444;
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0;
    border-radius: 0 0 8px 8px;
    animation: fadeInUp 0.3s ease-out;
}

.sub-menu li {
    border-bottom: 1px solid #f1f5f9;
}

.sub-menu li:last-child {
    border-bottom: none;
}

.sub-menu li a {
    color: #475569;
    padding: 12px 20px;
    font-weight: 400;
}

.sub-menu li a:hover {
    background: #f8fafc;
    color: #ef4444;
    padding-left: 25px; /* Hover indentation animation */
}

/* Sub-Sub Menu specific */
.sub-sub-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 101;
    border-radius: 8px;
    animation: fadeInUp 0.3s ease-out;
}

/* Hover triggers */
@media (min-width: 769px) {
    .main-nav li:hover > .sub-menu,
    .main-nav .sub-menu li:hover > .sub-sub-menu {
        display: block;
    }
}

/* ============================================
   RESPONSIVE HEADER
   ============================================ */
@media (max-width: 992px) {
    .header-search { max-width: 300px; }
}

@media (max-width: 768px) {
    .header-top { flex-wrap: wrap; padding: 12px 0; }
    .logo h1 { font-size: 26px; }
    .header-search { order: 3; flex: 1 1 100%; margin: 10px 0 0; max-width: 100%; }
    .header-actions { gap: 15px; }
    .header-actions a span { display: none; }
    .header-actions a i { font-size: 22px; }
    .mobile-menu-btn { display: block; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1e293b;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        z-index: 999;
    }
    
    .main-nav.open { display: block; animation: fadeInDown 0.3s ease-out; }
    .main-nav ul { flex-direction: column; }
    .main-nav ul li { display: block; border-bottom: 1px solid rgba(255,255,255,0.05); }
    
    .sub-menu, .sub-sub-menu {
        position: static;
        box-shadow: none;
        background: #0f172a;
        width: 100%;
    }
    
    .main-nav li.active > .sub-menu,
    .main-nav li.active > .sub-sub-menu { display: block; }
    
    .sub-menu li a { color: #94a3b8; padding: 12px 20px 12px 40px; }
    .sub-menu li a:hover { background: #1e293b; padding-left: 45px; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

.btn-primary:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.35);
}

.btn-secondary {
    background: #1e293b;
    color: #fff;
}

.btn-secondary:hover {
    background: #0f172a;
    transform: translateY(-2px);
}

.btn-cart {
    background: #10b981; /* Professional Emerald */
    color: #fff;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cart:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-block { display: block; width: 100%; }

/* ============================================
   PRODUCT GRID & CARDS
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin: 40px 0;
    animation: fadeInUp 0.8s ease-out;
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f1f5f9;
}

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

.product-image {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.5s ease;
}

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

.discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(239,68,68,0.3);
    z-index: 2;
}

.product-info {
    padding: 22px;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 12px;
    height: 48px;
    overflow: hidden;
    font-weight: 600;
    line-height: 1.5;
}

.product-info h3 a {
    color: #1e293b;
}

.product-info h3 a:hover {
    color: #ef4444;
}

.product-price {
    margin: 10px 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
}

.original-price {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
}

/* ============================================
   SLIDER
   ============================================ */
.slider-section { margin: 30px 0; }
.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.slider { display: flex; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; height: 450px; object-fit: cover; opacity: 0.8; }
.slide-content {
    position: absolute;
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    color: #fff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
    animation: fadeInUp 1s ease-out;
}
.slide-content h2 { font-size: 48px; margin-bottom: 15px; font-weight: 800; }
.slide-content p { font-size: 20px; margin-bottom: 25px; opacity: 0.9; }

/* ============================================
   SECTIONS
   ============================================ */
.section-title {
    font-size: 32px;
    font-weight: 700;
    margin: 50px 0 30px;
    color: #1e293b;
    border-left: 5px solid #ef4444;
    padding-left: 20px;
}

.flash-deals {
    background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
    padding: 40px 0;
    margin: 40px 0;
    border-radius: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #0f172a;
    color: #f8fafc;
    padding: 70px 0 0;
    margin-top: 70px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 25px;
    color: #f87171;
    font-size: 20px;
    font-weight: 600;
}

.footer-section p, .footer-section ul li a {
    color: #cbd5e1;
    line-height: 1.8;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 12px; transition: transform 0.3s; }
.footer-section ul li:hover { transform: translateX(5px); }
.footer-section ul li a:hover { color: #fff; }

.newsletter-form { display: flex; margin-top: 15px; }
.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #fff;
    border-radius: 6px 0 0 6px;
    outline: none;
}
.newsletter-form button {
    padding: 12px 25px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.3s;
}
.newsletter-form button:hover { background: #dc2626; }

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 25px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}