/*
 * Ethan's Appliance Center - Main Site Styles
 * Modern, high-performance, brand-focused design
 * Version: 1.0.0
 */

/* ==========================================================================
   CSS Variables / Design Tokens
   ========================================================================== */

:root {
    /* Brand Colors */
    --primary-red: #C41E3A;
    --primary-dark: #8B0000;
    --primary-light: #E8505B;
    --primary-gradient: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-dark) 100%);
    
    /* Accent Colors */
    --accent-gold: #D4AF37;
    --accent-gold-light: #F4D03F;
    --accent-blue: #2563EB;
    --accent-green: #10B981;
    
    /* Neutral Colors */
    --dark: #1A1A2E;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    
    /* Functional Colors */
    --promo-badge: #FF6B35;
    --new-badge: #10B981;
    --sale-badge: #EF4444;
    --info-color: #3B82F6;
    --warning-color: #F59E0B;
    --success-color: #10B981;
    --error-color: #EF4444;
    
    /* Typography */
    --font-display: 'Bebas Neue', Impact, sans-serif;
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Outfit', system-ui, sans-serif;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-brand: 0 10px 40px -10px rgba(196, 30, 58, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-preloader: 9999;
}

/* ==========================================================================
   Base Styles / Reset
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-6);
    background: var(--primary-red);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary-red);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 576px) {
    .container {
        padding: 0 var(--space-6);
    }
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--white);
    box-shadow: var(--shadow-md);
}

/* Top Bar */
.header-topbar {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.topbar-text i {
    color: var(--primary-light);
}

.topbar-divider {
    color: var(--gray-600);
}

.topbar-link {
    color: var(--gray-300);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: color var(--transition-fast);
}

.topbar-link:hover {
    color: var(--white);
}

/* Main Header */
.header-main {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--gray-200);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-name {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--primary-red);
    letter-spacing: 0.02em;
}

.logo-tagline {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.search-wrapper:focus-within {
    background: var(--white);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-brand);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--gray-800);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-top: var(--space-2);
    display: none;
    z-index: var(--z-dropdown);
}

.search-suggestions.active {
    display: block;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    min-width: 70px;
}

.action-btn i {
    font-size: var(--text-xl);
    margin-bottom: var(--space-1);
}

.action-text {
    font-size: var(--text-xs);
    font-weight: 500;
}

.action-btn:hover {
    background: var(--gray-100);
    color: var(--primary-red);
}

.action-btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.action-btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    gap: 5px;
}

.toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.mobile-toggle.active .toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active .toggle-bar:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.header-nav {
    background: var(--primary-red);
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: var(--space-1);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    color: var(--white);
    font-weight: 500;
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-link i:not(.dropdown-icon) {
    font-size: var(--text-base);
}

.dropdown-icon {
    font-size: var(--text-xs);
    margin-left: var(--space-1);
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Promo Nav Link */
.nav-promo {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-gold);
    color: var(--gray-900);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu */
.mega-menu {
    min-width: 600px;
    padding: var(--space-6);
}

.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.mega-menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-700);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mega-menu-link:hover {
    background: var(--gray-100);
    color: var(--primary-red);
}

.mega-menu-link i {
    font-size: var(--text-xl);
    color: var(--primary-red);
    width: 30px;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-modal-backdrop);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: var(--white);
    box-shadow: var(--shadow-2xl);
    transition: right var(--transition-base);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gray-900);
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.mobile-nav-close:hover {
    background: var(--primary-red);
    color: var(--white);
}

.mobile-nav-search {
    padding: var(--space-4) var(--space-5);
    display: flex;
    gap: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-search-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
}

.mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.mobile-nav-list {
    list-style: none;
    padding: var(--space-4) 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav-list li a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    color: var(--gray-700);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.mobile-nav-list li a:hover {
    background: var(--gray-100);
    color: var(--primary-red);
}

.mobile-nav-list li a i {
    font-size: var(--text-lg);
    color: var(--primary-red);
    width: 24px;
    text-align: center;
}

.mobile-nav-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--gray-200);
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-4);
    background: var(--primary-red);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.mobile-login-btn:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.site-main {
    min-height: calc(100vh - 400px);
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    margin-top: auto;
}

.footer-main {
    padding: var(--space-16) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-10);
}

.footer-column {
    display: flex;
    flex-direction: column;
}

/* Footer About */
.footer-about {
    padding-right: var(--space-8);
}

.footer-logo {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-4);
}

.footer-logo-name {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    color: var(--white);
    letter-spacing: 0.02em;
    line-height: 1;
}

.footer-logo-tagline {
    font-size: var(--text-xs);
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.footer-description {
    color: var(--gray-400);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    color: var(--gray-400);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-red);
    color: var(--white);
    transform: translateY(-3px);
}

/* Footer Titles */
.footer-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-red);
    display: inline-block;
}

/* Footer Links */
.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--gray-400);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-links a::before {
    content: '';
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: width var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
    transform: translateX(5px);
}

.footer-links a:hover::before {
    width: 10px;
}

/* Footer Contact */
.footer-contact {
    list-style: none;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    color: var(--gray-400);
}

.footer-contact i {
    color: var(--primary-light);
    margin-top: 4px;
    width: 16px;
}

/* Footer Bottom */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-5) 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--gray-500);
    font-size: var(--text-sm);
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    list-style: none;
    gap: var(--space-6);
}

.footer-bottom-links a {
    color: var(--gray-500);
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
    color: var(--white);
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-primary { color: var(--primary-red) !important; }
.text-dark { color: var(--gray-900) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-white { color: var(--white) !important; }

.bg-primary { background-color: var(--primary-red) !important; }
.bg-dark { background-color: var(--gray-900) !important; }
.bg-light { background-color: var(--gray-100) !important; }
.bg-white { background-color: var(--white) !important; }

.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeIn { animation: fadeIn 0.6s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.6s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.6s ease forwards; }

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
