/* ============================================================
   CATALOGO DE MAQUINARIA / PRODUCTOS - Next Soluciones
   ============================================================ */

.catalog-section {
        max-width: 1200px;
        margin: 0 auto;
        padding: 4rem 1.5rem;
        position: relative;
        z-index: 1;
}

.catalog-section::before {
        content: '';
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        width: min(1400px, 160%);
        height: 620px;
        background:
                radial-gradient(circle at 18% 0%, rgba(0, 74, 173, 0.07), transparent 55%),
                radial-gradient(circle at 82% 15%, rgba(0, 168, 232, 0.08), transparent 50%);
        pointer-events: none;
        z-index: -1;
}

.catalog-intro {
        max-width: 640px;
        color: #64748b;
        margin-top: 0.5rem;
        margin-bottom: 2rem;
        line-height: 1.6;
}

.catalog-toolbar {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-bottom: 1.5rem;
}

.catalog-search {
        flex: 1;
        min-width: 240px;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        padding: 0.75rem 1.1rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.catalog-search svg {
        width: 18px;
        height: 18px;
        color: #94a3b8;
        flex-shrink: 0;
}

.catalog-search input {
        border: none;
        outline: none;
        width: 100%;
        font-size: 0.95rem;
        color: #0f172a;
        background: transparent;
}

.catalog-toolbar .btn {
        white-space: nowrap;
}

.catalog-count {
        color: #64748b;
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
}

.catalog-count strong {
        color: #0f172a;
}

.catalog-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
}

.catalog-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
        display: flex;
        flex-direction: column;
}

.catalog-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.35);
        border-color: #fb923c;
}

.catalog-card-media {
        position: relative;
        width: 100%;
        height: 190px;
        background: #f1f5f9;
        overflow: hidden;
}

.catalog-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
}

.catalog-card-count {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(15, 23, 42, 0.72);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 600;
        padding: 3px 8px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        gap: 4px;
}

.catalog-badge {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 3px 10px;
        border-radius: 999px;
        background: rgba(16, 185, 129, 0.12);
        color: #059669;
}

.catalog-badge.estado-reservado {
        background: rgba(245, 158, 11, 0.14);
        color: #b45309;
}

.catalog-badge.estado-vendido {
        background: rgba(239, 68, 68, 0.12);
        color: #dc2626;
}

.catalog-card-body {
        padding: 1rem 1.1rem 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
}

.catalog-card-nombre {
        font-size: 1rem;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.3;
}

.catalog-card-precio {
        font-size: 1.15rem;
        font-weight: 800;
        background: linear-gradient(90deg, #2563eb, #f97316);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
}

.catalog-card-ubicacion {
        font-size: 0.8rem;
        color: #94a3b8;
        display: flex;
        align-items: center;
        gap: 4px;
}

.catalog-empty {
        text-align: center;
        color: #94a3b8;
        padding: 2.5rem 0;
}

/* ============================================================
   MODAL
   ============================================================ */

.catalog-modal {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(8, 11, 22, 0.72);
        backdrop-filter: blur(4px);
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
}

.catalog-modal.open {
        display: flex;
}

.catalog-modal-content {
        background: #fff;
        border-radius: 24px;
        width: min(960px, 100%);
        max-height: 92vh;
        overflow-y: auto;
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        position: relative;
}

@media (max-width: 760px) {
        .catalog-modal-content {
                grid-template-columns: 1fr;
        }
}

.catalog-modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 5;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: none;
        background: rgba(15, 23, 42, 0.06);
        color: #0f172a;
        font-size: 1.4rem;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s ease;
}

.catalog-modal-close:hover {
        background: rgba(15, 23, 42, 0.12);
}

.catalog-modal-gallery {
        position: relative;
        background: #0f172a;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 320px;
}

.catalog-modal-gallery img {
        width: 100%;
        height: 100%;
        max-height: 560px;
        object-fit: cover;
}

.catalog-modal-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.85);
        color: #0f172a;
        font-size: 1.4rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s ease;
}

.catalog-modal-arrow:hover {
        background: #fff;
}

.catalog-modal-prev { left: 12px; }
.catalog-modal-next { right: 12px; }

.catalog-modal-dots {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 5px;
}

.catalog-modal-dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.45);
}

.catalog-modal-dots span.active {
        background: #fff;
        width: 18px;
        border-radius: 999px;
}

.catalog-modal-info {
        padding: 1.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
}

.catalog-modal-info h3 {
        font-size: 1.4rem;
        font-weight: 800;
        color: #0f172a;
        margin: 0;
}

.catalog-modal-precio {
        font-size: 1.6rem;
        font-weight: 800;
        background: linear-gradient(90deg, #2563eb, #f97316);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        margin: 0 0 0.5rem;
}

.catalog-modal-ubicacion {
        font-size: 0.85rem;
        color: #64748b;
        margin: 0 0 0.5rem;
        display: flex;
        align-items: center;
        gap: 4px;
}

.catalog-modal-section {
        border-top: 1px solid #e2e8f0;
        padding-top: 0.85rem;
        margin-top: 0.35rem;
}

.catalog-modal-label {
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: #94a3b8;
        font-weight: 700;
        margin: 0 0 0.4rem;
}

.catalog-modal-info p {
        color: #334155;
        line-height: 1.55;
        margin: 0;
}

.catalog-modal-thumbs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
}

.catalog-modal-thumbs img {
        width: 56px;
        height: 56px;
        border-radius: 10px;
        object-fit: cover;
        cursor: pointer;
        border: 2px solid transparent;
        transition: border-color 0.15s ease;
}

.catalog-modal-thumbs img.active {
        border-color: #f97316;
}

.btn-whatsapp {
        margin-top: 0.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        background: #22c55e;
        color: #fff;
        border-radius: 12px;
        padding: 0.85rem 1.5rem;
        font-weight: 700;
        text-decoration: none;
        transition: background 0.15s ease;
}

.btn-whatsapp:hover {
        background: #16a34a;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
        .catalog-grid {
                grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        }
}

@media (max-width: 760px) {
        .catalog-section {
                padding: 2.5rem 1.25rem;
        }

        .catalog-modal-gallery {
                min-height: 240px;
        }

        .catalog-modal-gallery img {
                max-height: 320px;
        }

        .catalog-modal-info {
                padding: 1.35rem;
        }

        .catalog-modal-info h3 {
                font-size: 1.2rem;
        }

        .catalog-modal-precio {
                font-size: 1.35rem;
        }
}

@media (max-width: 600px) {
        .catalog-toolbar {
                flex-direction: column;
        }

        .catalog-toolbar .btn {
                width: 100%;
        }

        .catalog-grid {
                grid-template-columns: 1fr 1fr;
                gap: 0.85rem;
        }

        .catalog-card-media {
                height: 130px;
        }

        .catalog-card-body {
                padding: 0.75rem 0.85rem 0.9rem;
                gap: 0.35rem;
        }

        .catalog-card-nombre {
                font-size: 0.86rem;
        }

        .catalog-card-precio {
                font-size: 0.95rem;
        }

        .catalog-card-ubicacion {
                font-size: 0.7rem;
        }

        .catalog-modal {
                padding: 0;
        }

        .catalog-modal-content {
                border-radius: 0;
                max-height: 100vh;
                height: 100%;
                width: 100%;
        }

        .catalog-modal-gallery {
                min-height: 220px;
        }

        .catalog-modal-arrow {
                width: 32px;
                height: 32px;
                font-size: 1.2rem;
        }

        .catalog-modal-close {
                top: 10px;
                right: 10px;
        }

        .catalog-modal-thumbs img {
                width: 46px;
                height: 46px;
        }

        .btn-whatsapp {
                padding: 0.75rem 1.1rem;
                font-size: 0.88rem;
        }
}

@media (max-width: 380px) {
        .catalog-grid {
                grid-template-columns: 1fr;
        }
}