@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    html {
        @apply overflow-x-hidden;
    }

    body {
        @apply bg-zinc-50 text-deep-text font-body overflow-x-hidden;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F8F8F8;
}

::-webkit-scrollbar-thumb {
    background: #e0d231;
    border-radius: 4px;
}

/* Animations & Effects */
.product-overlay {
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.whatsapp-float {
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

@keyframes pulse-slow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s infinite;
}

.speed-line {
    background: linear-gradient(90deg, transparent 0%, theme('colors.primary') 50%, transparent 100%);
}

.aspect-square-card {
    aspect-ratio: 1 / 1;
}

.brand-carousel-track {
    scrollbar-width: none;
}

.brand-carousel-track::-webkit-scrollbar {
    display: none;
}


.brand-carousel-row {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: brand-marquee var(--marquee-duration, 36s) linear infinite;
}


#main-header.main-header-hidden {
    opacity: 0;
    pointer-events: none;
}

.brand-carousel-track:hover .brand-carousel-row {
    animation-play-state: paused;
}

@keyframes brand-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Circuit Background Pattern from reparacion/diagnostico */
.circuit-bg-light {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg stroke='%23000000' stroke-width='0.5' stroke-opacity='0.05'%3E%3Cpath d='M50 0H2a2 2 0 0 0-2 2v48a2 2 0 0 0 2 2h48a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM9 39h32V9H9v30zM3 49h44V3H3v46z' /%3E%3Ccircle cx='25' cy='25' r='2' /%3E%3Ccircle cx='35' cy='15' r='2' /%3E%3Ccircle cx='15' cy='15' r='2' /%3E%3Ccircle cx='15' cy='35' r='2' /%3E%3Ccircle cx='35' cy='35' r='2' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.circuit-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg stroke='%23e0d231' stroke-width='0.5' stroke-opacity='0.1'%3E%3Cpath d='M50 0H2a2 2 0 0 0-2 2v48a2 2 0 0 0 2 2h48a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM9 39h32V9H9v30zM3 49h44V3H3v46z' /%3E%3Ccircle cx='25' cy='25' r='2' /%3E%3Ccircle cx='35' cy='15' r='2' /%3E%3Ccircle cx='15' cy='15' r='2' /%3E%3Ccircle cx='15' cy='35' r='2' /%3E%3Ccircle cx='35' cy='35' r='2' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.step-active {
    @apply border-primary shadow-[0_0_15px_rgba(224, 210, 49, 0.3)];
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9900;
}

.toast {
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animated Wave overlay */
.wave-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 15px,
            rgba(224, 210, 49, 0.05) 15px,
            rgba(224, 210, 49, 0.05) 30px);
    opacity: 0.6;
    animation: waveMove 20s linear infinite;
    pointer-events: none;
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, transparent, rgba(224, 210, 49, 0.8), transparent);
    box-shadow: 0 0 10px rgba(224, 210, 49, 0.5);
    animation: scanMove 4s ease-in-out infinite;
    opacity: 0.7;
    pointer-events: none;
}

@keyframes scanMove {
    0% {
        top: -10%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 110%;
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch-image-container {
    position: relative;
    overflow: hidden;
}

.glitch-image {
    animation: glitch-shake 4s infinite;
}

.glitch-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(224, 210, 49, 0.9);
    box-shadow: 0 0 10px rgba(224, 210, 49, 0.8);
    opacity: 0;
    animation: glitch-scan 5s infinite linear;
    z-index: 20;
}

@keyframes glitch-scan {
    0% {
        top: -10%;
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    41% {
        height: 2px;
    }

    42% {
        height: 20px;
        background: rgba(255, 255, 255, 0.2);
    }

    43% {
        height: 2px;
        background: rgba(224, 210, 49, 0.9);
    }

    100% {
        top: 110%;
        opacity: 0;
    }
}

@keyframes glitch-shake {

    0%,
    90% {
        transform: translate(0, 0);
        filter: none;
    }

    91% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(10deg);
    }

    92% {
        transform: translate(2px, -1px);
        filter: hue-rotate(-10deg) contrast(1.2);
    }

    93% {
        transform: translate(-2px, -1px);
        filter: none;
    }

    94% {
        transform: translate(2px, 1px);
        filter: hue-rotate(0deg);
    }

    95% {
        transform: translate(-2px, 0);
        filter: sepia(0.3);
    }

    100% {
        transform: translate(0, 0);
        filter: none;
    }
}

/* Page Fade In Effect */
.page-fade-in {
    opacity: 0;
    animation: pageFadeIn 0.8s ease-out forwards;
}

@keyframes pageFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
