/* =====================================================
   REPUESTÍSIMOS - Estilos personalizados
   ===================================================== */

:root {
    --primary: #E63946;
    --secondary: #1D3557;
    --accent: #F4A261;
    --background: #F8F9FA;
    --white: #FFFFFF;
    --text: #212529;
    --text-muted: #6C757D;
    --success: #2A9D8F;
    --border: #DEE2E6;
}

/* ── Base ──────────────────────────────────────────── */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.font-mono, code {
    font-family: 'Roboto Mono', monospace;
}

.fw-500 {
    font-weight: 500;
}

/* ── Bootstrap overrides ──────────────────────────── */

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #cf2f3c;
    border-color: #cf2f3c;
}

.btn-primary:active {
    background-color: #b5222e;
    border-color: #b5222e;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.text-primary {
    color: var(--primary) !important;
}

.bg-secondary-custom {
    background-color: var(--secondary) !important;
}

.badge.bg-light {
    border: 1px solid var(--border);
}

/* ── Navbar ────────────────────────────────────────── */

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar-brand img {
    height: 28px;
    width: auto;
}

/* ── Hero ──────────────────────────────────────────── */

.hero-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #2a4a7f 100%);
    color: white;
}

.hero-section h1 {
    letter-spacing: -0.03em;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.8) !important;
}

.hero-section .card {
    border: none;
    border-radius: 12px;
}

.hero-section .form-label {
    color: var(--text);
}

/* ── Cards ─────────────────────────────────────────── */

.marca-card,
.modelo-card,
.motor-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.marca-card:hover,
.modelo-card:hover,
.motor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.marca-card .card-body {
    color: var(--text);
}

.modelo-card .card-title,
.motor-card .card-title {
    color: var(--text);
}

/* ── Pieza cards ───────────────────────────────────── */

.pieza-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
}

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

.pieza-card code {
    background: #f1f3f5;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.875em;
}

/* ── Affiliate buttons ─────────────────────────────── */

.btn-afiliado {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-afiliado:hover {
    opacity: 0.9;
    color: white;
    transform: translateY(-1px);
}

.btn-afiliado:active {
    transform: translateY(0);
}

/* ── Breadcrumb ────────────────────────────────────── */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ── Footer ────────────────────────────────────────── */

footer {
    margin-top: auto;
}

/* ── Utilities ─────────────────────────────────────── */

.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Loading spinner ───────────────────────────────── */

.spinner-inline {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-right-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Responsive ────────────────────────────────────── */

/* Mobile (< 576px) */
@media (max-width: 575.98px) {
    h1 {
        font-size: 1.5rem;
    }

    .hero-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .hero-section h1 {
        font-size: 1.4rem;
    }

    .hero-section .lead {
        font-size: 0.95rem;
    }

    .btn-afiliado {
        width: 100%;
        justify-content: center;
    }

    .pieza-card .d-flex.flex-wrap.gap-2 {
        flex-direction: column;
    }

    .pieza-card {
        padding: 1rem;
    }
}

/* Tablet (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section h1 {
        font-size: 1.6rem;
    }
}

/* Desktop hover effects only */
@media (hover: hover) {
    .marca-card:hover,
    .modelo-card:hover,
    .motor-card:hover {
        transform: translateY(-3px);
    }
}

/* Touch devices - no hover transform */
@media (hover: none) {
    .marca-card:hover,
    .modelo-card:hover,
    .motor-card:hover {
        transform: none;
    }
}
