/* Custom styles on top of Tailwind CSS */

/* Base styles and typography */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.text-regular {
    font-weight: 400;
}

.text-medium {
    font-weight: 500;
}

.text-semibold {
    font-weight: 600;
}

.text-bold {
    font-weight: 700;
}

.text-extrabold {
    font-weight: 800;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 0;
    width: 3rem;
    height: 0.25rem;
    background: #0071DC;
    border-radius: 9999px;
    transform: scaleX(0);
    transform-origin: left;
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Header shadow animation */
header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Product card hover effects */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Search suggestions animation */
.search-suggestions {
    opacity: 0;
    transform: translateY(-10px);
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* WhatsApp button styles */
.whatsapp-btn {
    transform-origin: center;
    transition: all 0.3s ease;
}

.whatsapp-btn img {
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    will-change: transform;
}

@keyframes gentle-pulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.1);
    }
}

.whatsapp-btn .blur-lg {
    animation: gentle-pulse 2s ease-in-out infinite;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0071DC;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile menu animation */
.mobile-menu {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

/* Notification animation */
.notification {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Cart badge bounce animation */
#cart-count {
    animation: bounce 0.3s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #0071DC;
    background: #3B82F6;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* Focus styles */
*:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

a:focus, a:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Engineering specific styles */
.hero-section {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/engineering-pattern.svg');
    background-size: cover;
    opacity: 0.1;
}

.feature-card {
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #3B82F6;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced link styles */
a {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: #0071DC;
}

/* Sticky site WhatsApp button (matches homepage sticky look) */
.site-whatsapp {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9999;
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    background: transparent; /* remove solid background so inner blurred ring shows */
    padding: 0;
    border: none;
}

.site-whatsapp .relative { position: relative; }
.site-whatsapp img { width: 56px; height: 56px; display: block; }

/* keep it hidden from print */
@media print {
    .site-whatsapp { display: none; }
}

/* Print styles */
@media print {
    header, footer, .whatsapp-btn {
        display: none;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
    
    .product-card {
        break-inside: avoid;
    }
}