/* 
 * DESOINCA - Industrial Precision Design System
 * Basado en el diseño de Stitch y el documento DESIGN.md
 */

:root {
    /* Colors */
    --desoinca-primary: #15157d;
    --desoinca-primary-dark: #04006d;
    --desoinca-secondary: #8DC63F;
    --desoinca-secondary-dark: #467000;
    --desoinca-background: #fcf8ff;
    --desoinca-surface: #ffffff;
    --desoinca-on-surface: #1b1b21;
    --desoinca-outline: #c7c5d4;
    --desoinca-text-muted: #464652;
    
    /* Spacing */
    --desoinca-gutter: 24px;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--desoinca-background);
    color: var(--desoinca-on-surface);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--desoinca-primary);
}

.headline-xl {
    font-size: 3rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Navbar Customization */
.navbar {
    background-color: var(--desoinca-surface);
    border-bottom: 1px solid var(--desoinca-outline);
    padding: 1rem 0;
    position: relative;
    z-index: 1110; /* Mayor que autocomplete-wrapper (1060) y autocomplete-suggestions (1100) para asegurar que siempre esté por encima */
}

.navbar-brand {
    font-weight: 900;
    color: var(--desoinca-primary) !important;
    letter-spacing: -0.05em;
    font-size: 1.5rem;
}

.navbar-logo {
    height: 45px;
    width: auto;
    display: block;
    transition: height 0.2s ease;
}

.footer-logo {
    height: 50px;
    width: auto;
    display: block;
    margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
    .navbar-logo {
        height: 35px;
    }
    .footer-logo {
        height: 40px;
    }
}

.nav-link {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--desoinca-text-muted);
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--desoinca-primary);
}

/* Buttons */
.btn-desoinca-primary {
    background-color: var(--desoinca-secondary);
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border: none;
    transition: background-color 0.2s;
}

.btn-desoinca-primary:hover {
    background-color: var(--desoinca-secondary-dark);
    color: #fff;
}

.btn-desoinca-outline {
    border: 2px solid var(--desoinca-primary);
    color: var(--desoinca-primary);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
}

.btn-desoinca-outline:hover {
    background-color: var(--desoinca-primary);
    color: #fff;
}

/* WhatsApp Button */
.btn-whatsapp {
    --bs-btn-bg: #25D366;
    --bs-btn-border-color: #25D366;
    --bs-btn-hover-bg: #1ebd56;
    --bs-btn-hover-border-color: #1ebd56;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-color: #ffffff;
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: filter 0.2s, background-color 0.2s;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus,
.btn-whatsapp:active {
    background-color: #1ebd56 !important;
    border-color: #1ebd56 !important;
    color: #ffffff !important;
    filter: brightness(0.95);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 500px;
    background-color: var(--desoinca-primary);
    display: flex;
    align-items: center;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .headline-xl {
        font-size: 2.25rem;
        line-height: 1.25;
    }

    .hero-section {
        height: auto;
        min-height: auto;
        padding: 4.5rem 0 3.5rem 0;
        overflow: visible;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(21, 21, 125, 0.7) 0%, rgba(21, 21, 125, 0.3) 100%);
    z-index: 1;
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    filter: brightness(0.8) contrast(1.1);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

/* Cards */
.industrial-card {
    background: var(--desoinca-surface);
    border: 1px solid var(--desoinca-outline);
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.3s;
    position: relative;
}

.industrial-card:hover {
    box-shadow: 0px 8px 24px rgba(46, 49, 146, 0.12);
}

.product-image-container {
    position: relative;
    overflow: hidden;
}

.product-image-container img {
    transition: transform 0.5s ease;
}

.industrial-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Utilities */
.mix-blend-multiply {
    mix-blend-mode: multiply;
}

.max-h-100 {
    max-height: 100%;
}

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

.tracking-widest {
    letter-spacing: 0.1em;
}

/* Sidebar Industrial */
.industrial-sidebar {
    height: auto;
}

.industrial-sidebar .nav-link {
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.industrial-sidebar .nav-link:hover {
    color: var(--desoinca-secondary) !important;
    padding-left: 10px !important;
    border-left: 2px solid var(--desoinca-secondary);
}

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

/* Infinite Scroll Spinner */
#load-more-sentinel .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(21, 21, 125, 0.1);
    border-left-color: var(--desoinca-secondary);
    border-radius: 50%;
    animation: spin-industrial 1s linear infinite;
    display: inline-block;
}

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

/* Animación de entrada para productos cargados por AJAX */
.industrial-card {
    animation: fadeInIndustrial 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes fadeInIndustrial {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* --- Autocomplete Suggestions (Industrial Precision) --- */
.autocomplete-wrapper {
    z-index: 1060;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #fff;
    border: 1px solid #15157d;
    border-top: none;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(21, 21, 125, 0.15);
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-top: 2px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    text-decoration: none;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: #f8f9fa;
    border-left: 4px solid #8DC63F;
    text-decoration: none;
    color: #15157d;
}

.suggestion-img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    object-fit: contain;
    margin-right: 15px;
    border: 1px solid #eee;
    padding: 4px;
    background: #fff;
    border-radius: 2px;
}

.suggestion-text {
    flex-grow: 1;
    overflow: hidden;
}

.suggestion-title {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-subtitle {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 0;
}

.suggestion-badge {
    font-size: 9px;
    font-weight: 900;
    padding: 2px 8px;
    background: #15157d;
    color: #fff;
    text-transform: uppercase;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.suggestion-item:hover .suggestion-badge {
    background: #8DC63F;
}

/* Corrección de bordes para Autocomplete dentro de Input Group */
.autocomplete-wrapper > .input-group {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.autocomplete-wrapper > .input-group:focus-within {
    border-color: #15157d;
    box-shadow: 0 0 0 0.25rem rgba(21, 21, 125, 0.1);
}

.autocomplete-wrapper > .input-group .form-control,
.autocomplete-wrapper > .input-group .input-group-text,
.autocomplete-wrapper > .input-group .btn {
    border: none !important;
}

.autocomplete-wrapper > .input-group .input-group-text {
    background-color: #fff;
    padding-right: 0;
}

.autocomplete-wrapper > .input-group .btn {
    border-radius: 0;
    margin: 0;
}

/* Evitar que el input-group-text tenga bordes internos si ya tiene el del wrapper */
.autocomplete-wrapper .input-group-text {
    border: none !important;
}

/* --- Home Search Section --- */
.search-home-container {
    margin-top: -60px; /* Overlap effect for visual bridge */
    position: relative;
    z-index: 10;
}

@media (max-width: 991px) {
    .search-home-container {
        margin-top: -30px;
    }
}

/* --- Contact Page Industrial Redesign --- */
.contact-dept-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--desoinca-primary);
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    transition: all 0.2s ease-in-out;
}

.contact-dept-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    border-left-color: var(--desoinca-secondary);
    box-shadow: 0 3px 10px rgba(21, 21, 125, 0.06);
    transform: translateY(-1px);
}

.contact-call-btn {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 4px;
    color: var(--desoinca-primary);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

.contact-call-btn:hover {
    background: var(--desoinca-primary);
    color: #ffffff;
    border-color: var(--desoinca-primary);
}

.contact-channel-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.contact-channel-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.contact-guarantee-badge {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 0.85rem 1rem;
}

