/* 
  ENDLESS ELECTRICALS - Premium CSS
  Enhanced | Responsive | Attractive Design
  Production Ready | SEO-Optimized
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', sans-serif;
}

/* ========================================
   ROOT VARIABLES & GLOBAL STYLES
   ======================================== */

:root {
    --primary: #1E3A8A;
    --primary-light: #3B5BDB;
    --secondary: #FF9500;
    --accent: #10B981;
    --accent-light: #34D399;
    --dark: #0F172A;
    --dark-light: #1a2540;
    --white: #ffffff;
    --gray-light: #F3F4F6;
    --gray-dark: #6B7280;
    --danger: #EF4444;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 50px rgba(30, 58, 138, 0.3);
    --transition-fast: all 0.2s ease;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    background: linear-gradient(135deg, #0F172A 0%, #1a2d5a 50%, #1E40AF 100%);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    animation: pageFadeIn 0.3s ease both;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    font-size: 1rem;
    opacity: 0.95;
}

/* ========================================
   GLASS MORPHISM EFFECT
   ======================================== */

.glass {
    backdrop-filter: blur(30px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
}

.gradient-bg {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #1E40AF 100%);
}

/* ========================================
   ANIMATIONS - Core Web Vitals Optimized
   ======================================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Animation Classes */
.float {
    animation: float 6s ease-in-out infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.loading {
    animation: pulse 1.5s infinite;
}

.hover-glow {
    transition: var(--transition-base);
}

.hover-glow:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Subtle gradient background animation for hero */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, rgba(255,255,255,0.05), rgba(16,185,129,0.08), rgba(245,158,11,0.08));
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
    pointer-events: none;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
    animation: slideDown 0.5s ease;
}

.header--scrolled {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

header nav a {
    position: relative;
    overflow: hidden;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--secondary);
    transition: left 0.3s ease;
}

header nav a:hover::after {
    left: 0;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-title {
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ========================================
   CATEGORY CARDS
   ======================================== */

.category-card {
    animation: scaleIn 0.5s ease;
}

.category-card:hover {
    background: rgba(30, 58, 138, 0.2) !important;
}

.category-icon {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-card:hover .category-icon {
    transform: rotate(12deg) scale(1.1);
}

/* ========================================
   PRODUCT CARDS - E-Commerce Optimized
   ======================================== */

.product-card {
    animation: fadeInUp 0.6s ease;
    transition: var(--transition-base);
    border-radius: 1.5rem;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(245, 158, 11, 0.3);
}

.hover-tilt {
    transition: transform 0.2s ease;
    transform-style: preserve-3d;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-image {
    transform: scale(1.15) rotate(2deg);
}

.product-rating {
    background: rgba(245, 158, 11, 0.9);
    color: #1E3A8A;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.product-price {
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: 700;
}

.product-button {
    transition: var(--transition-base);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.product-button:active {
    transform: scale(0.95);
}

/* ========================================
   FILTER BUTTONS - Sticky
   ======================================== */

.filter-section {
    position: sticky;
    top: 5.5rem;
    z-index: 10;
    animation: slideDown 0.5s ease;
}

.filter-btn {
    transition: var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: rgba(16, 185, 129, 0.2);
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.filter-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ========================================
   SEARCH INPUT - Focus States
   ======================================== */

input[type="text"],
input[type="email"],
input[type="tel"] {
    transition: var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

/* ========================================
   CONTACT SECTION
   ======================================== */

.contact-card {
    animation: fadeInUp 0.6s ease;
    transition: var(--transition-base);
}

.contact-card:hover {
    transform: scale(1.05) translateY(-8px);
    background: rgba(30, 58, 138, 0.3) !important;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: 1rem auto;
    border-radius: 1rem;
    font-size: 1.5rem;
}

/* ========================================
   MOBILE MENU - Responsive
   ======================================== */

#mobileMenu {
    animation: slideDown 0.3s ease;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary);
}

/* ========================================
   SCROLL REVEAL UTILS
   ======================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   BUTTON RIPPLE EFFECT
   ======================================== */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 9999px;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.btn-ripple:hover::after {
    animation: ripple 0.6s ease;
}

@keyframes ripple {
    0% { width: 0; height: 0; opacity: 0.6; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

/* ========================================
   PRODUCT CARD SHEEN
   ======================================== */

.product-card {
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.product-card:hover::before {
    left: 150%;
}

/* ========================================
   CATEGORY BUTTON ENHANCEMENTS
   ======================================== */

.category-filter-btn {
    box-shadow: var(--shadow-sm);
}

.category-filter-btn:hover {
    box-shadow: var(--shadow-lg);
}

/* ========================================
   FLOATING WHATSAPP BUTTON
   ======================================== */

.whatsapp-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    width: 4rem;
    height: 4rem;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
    animation: fadeInUp 1s ease 0.5s both;
}

.whatsapp-btn:hover {
    background: #16a34a;
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.6);
}

.whatsapp-btn svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
}

/* Back-to-top button */
.back-to-top {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: white;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 40;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First
   ======================================== */

/* Tablet & Small Screens (768px and below) */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Header Optimization */
    header {
        padding: 0.75rem 1rem;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 40;
    }

    header .max-w-7xl {
        flex-wrap: wrap;
    }

    /* Main Content */
    main {
        padding-top: 5.5rem;
        padding-bottom: 6rem;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Search Bar */
    .max-w-md {
        display: none !important;
    }

    /* Product Cards */
    .product-card {
        margin: 0 auto;
        border-radius: 1rem;
    }

    .product-image {
        height: 200px;
    }

    /* Filter Section */
    .filter-section {
        top: 7rem;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .filter-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Grid Adjustments */
    .grid {
        gap: 1rem !important;
    }

    .md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Contact Grid */
    .contact-grid {
        gap: 1.5rem;
        grid-template-columns: 1fr !important;
    }

    .contact-card {
        padding: 1.5rem;
    }

    /* Buttons */
    button, a.px-6, a.px-8 {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
    }

    .product-button {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.85rem;
    }

    /* Category Icons */
    .category-icon {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 1rem !important;
    }

    /* Floating WhatsApp Button */
    .whatsapp-btn {
        width: 3.5rem;
        height: 3.5rem;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }

    /* Mobile Menu */
    #mobileMenu {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        z-index: 35;
    }

    #mobileMenu.hidden {
        display: none !important;
    }

    #mobileMenu a {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Footer */
    footer {
        padding: 2rem 1rem;
        font-size: 0.85rem;
    }

    /* Spacing Adjustments */
    section {
        padding: 2rem 1rem !important;
    }

    .mx-auto {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Text Adjustments */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Form Elements */
    input, select {
        font-size: 16px !important;
        padding: 0.75rem !important;
        border-radius: 0.75rem !important;
    }

    /* Glass Effects - Subtle on Mobile */
    .glass {
        border-radius: 1rem;
        padding: 1.25rem;
    }

    /* Prevent Horizontal Scrolling */
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Touch-friendly sizes */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Image optimization */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    main {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
    }

    .glass {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    button, a {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.85rem;
    }

    .whatsapp-btn {
        width: 3rem;
        height: 3rem;
        bottom: 0.75rem;
        right: 0.75rem;
        font-size: 1.25rem;
    }

    section {
        padding: 1.5rem 0.75rem !important;
    }

    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .product-image {
        height: 150px;
    }

    .category-icon {
        width: 50px !important;
        height: 50px !important;
    }

    /* Single column layouts */
    .md\:grid-cols-2,
    .md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Compact footer */
    footer {
        padding: 1.5rem 0.75rem;
    }

    /* Alert notifications */
    .fixed {
        margin: 0.5rem;
    }

    /* Ensure buttons are always tappable */
    input[type="submit"],
    input[type="button"],
    button {
        min-height: 48px !important;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Lazy loading images */
img {
    loading: lazy;
    decoding: async;
}

/* Hardware acceleration */
.float,
.product-card,
.category-card {
    will-change: transform;
    transform: translateZ(0);
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #0F172A;
        color: #ffffff;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    header,
    footer,
    .whatsapp-btn,
    .filter-section {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.75;
}

.breadcrumb a {
    color: var(--secondary);
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========================================
   SMOOTH SCROLLING
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ========================================
   PAGE TRANSITIONS & ACCESSIBILITY
   ======================================== */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-out {
    opacity: 0 !important;
    transition: opacity 200ms ease;
}

/* Skip to content link */
.skip-link {
    position: fixed;
    left: 1rem;
    top: 0.5rem;
    background: #111827;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transform: translateY(-120%);
    transition: transform 0.2s ease;
    z-index: 100;
}
.skip-link:focus {
    transform: translateY(0);
}
