/* ==========================================
   Mecatex S.R.L. - Custom Styles
   ========================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Alpine.js cloak - hide elements until Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* ==========================================
   Custom Animations
   ========================================== */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse subtle */
@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Animation utility classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Stagger delays */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }

/* ==========================================
   Product Card Hover Effects
   ========================================== */

/* Card icon rotation on hover */
.group:hover .group-icon {
    transform: rotate(5deg) scale(1.05);
}

/* Card lift shadow effect */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   Form Styles
   ========================================== */

/* Focus ring override for better visibility */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1a1adb;
    box-shadow: 0 0 0 3px rgba(26, 26, 219, 0.15);
}

/* Select dropdown arrow */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Checkbox custom styling */
input[type="checkbox"] {
    accent-color: #cc0000;
}

/* ==========================================
   Scrollbar Styling
   ========================================== */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==========================================
   Header & Navigation
   ========================================== */

/* Sticky header shadow on scroll (handled by Tailwind, backup here) */
header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ==========================================
   Selection Color
   ========================================== */

::selection {
    background-color: rgba(204, 0, 0, 0.15);
    color: #0d1b3e;
}

::-moz-selection {
    background-color: rgba(204, 0, 0, 0.15);
    color: #0d1b3e;
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 640px) {
    /* Reduce padding on mobile */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ==========================================
   Loading States
   ========================================== */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
