/* ═══════════════════════════════════════
   AA Moto - Custom Styles & Animations
   ═══════════════════════════════════════ */

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

/* Animations */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-up {
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    animation: fade-in 0.6s ease forwards;
}

.animate-slide-right {
    animation: slide-in-right 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered animations for grids */
.grid > *:nth-child(1) { animation-delay: 0ms; }
.grid > *:nth-child(2) { animation-delay: 80ms; }
.grid > *:nth-child(3) { animation-delay: 160ms; }
.grid > *:nth-child(4) { animation-delay: 240ms; }
.grid > *:nth-child(5) { animation-delay: 320ms; }
.grid > *:nth-child(6) { animation-delay: 400ms; }

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prose overrides */
.prose a { color: var(--color-accent); }
.prose a:hover { color: var(--color-accent-hover); }
.prose strong { color: var(--color-dark); }

/* Product description table - Modern override for legacy inline styles */
.product-desc-content div[style] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
.product-desc-content table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 0.9375rem !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    table-layout: auto !important;
    margin: 0 !important;
}
.product-desc-content table tbody tr:first-child td {
    background: var(--color-dark) !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 1rem 1.25rem !important;
    border: none !important;
    text-align: left !important;
}
.product-desc-content table tbody tr:nth-child(2) td {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 1.25rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}
.product-desc-content table tbody tr td {
    width: auto !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
}
.product-desc-content table tbody tr td:first-child {
    font-weight: 600 !important;
    color: var(--color-dark) !important;
    background: #fafbfc !important;
    width: 40% !important;
}
.product-desc-content table tbody tr:last-child td {
    border-bottom: none !important;
}
.product-desc-content table tbody tr:hover td {
    background: #f8fafc !important;
}
.product-desc-content table tbody tr:hover td:first-child {
    background: #f1f5f9 !important;
}

/* WooCommerce overrides */
.woocommerce-notices-wrapper,
.woocommerce-result-count,
.woocommerce-ordering {
    display: none !important;
}

.woocommerce .price del { opacity: 0.5; }
.woocommerce .price ins { text-decoration: none; }

/* Contact Form 7 styling */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea,
.wpcf7-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.wpcf7-form input[type="submit"],
.wpcf7-submit {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wpcf7-form input[type="submit"]:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
}

.wpcf7-form p { margin-bottom: 1.25rem; }
.wpcf7-form label { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.5rem; display: block; }

/* Header fixes */
header img {
    max-height: 36px !important;
    width: auto !important;
    object-fit: contain !important;
}
header .custom-logo {
    max-height: 36px !important;
}

/* Prevent header overflow */
header {
    overflow: visible;
}
header > div {
    overflow: hidden;
}
header .max-w-7xl {
    overflow: visible;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}
img[loading="lazy"] {
    opacity: 0;
}
img[loading="lazy"].loaded,
img[loading="lazy"][complete] {
    opacity: 1;
}

/* Print styles */
@media print {
    header, footer, .fixed, [x-data] { display: none !important; }
    body { font-size: 12pt; }
}
