/* ==========================================
   MD CREATIVE - CATALOGO DE PRODUCTOS
   TARJETAS + MODAL DE DETALLES RESPONSIVE
========================================== */

/* ENCABEZADO */
.catalog-hero {
    padding: 85px 0 70px;
    background: radial-gradient(circle at 85% 20%, rgba(56, 189, 248, .12), transparent 50%), var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.catalog-hero h1 {
    margin-bottom: 18px;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.2;
}
.catalog-hero p {
    max-width: 650px;
    color: var(--muted);
}
.catalog-wa-link {
    margin-top: 26px;
}

/* SECCION PRINCIPAL */
.catalog-section {
    padding: 75px 0 100px;
}
.catalog-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 30px;
}
.catalog-heading h2 {
    font-size: clamp(26px, 4vw, 34px);
}
.catalog-heading p {
    color: var(--muted);
    font-size: 14px;
}

/* FILTROS POR CATEGORIA */
.catalog-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0 18px;
    margin-bottom: 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.catalog-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 42px;
    padding: 9px 20px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.catalog-filter:hover,
.catalog-filter.selected {
    background: var(--primary);
    color: #07111f;
    border-color: var(--primary);
}

/* CUADRICULA */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
}

/* TARJETAS DE PRODUCTOS */
.catalog-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.catalog-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.catalog-image {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #0d1929;
}
.catalog-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.catalog-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10233c, #1a3c58);
    color: var(--primary);
}
.catalog-placeholder strong {
    font-size: 55px;
    font-weight: 900;
    line-height: 1;
}
.catalog-placeholder span {
    margin-top: 7px;
    font-size: 15px;
    letter-spacing: 3px;
}
.catalog-featured {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--primary);
    color: #07111f;
    font-size: 11px;
    font-weight: 800;
}
.catalog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 24px;
}
.catalog-category {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.catalog-card h3 {
    margin: 11px 0;
    font-size: 20px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.catalog-description {
    margin-bottom: 25px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* PRECIO Y ACCIONES DE CADA TARJETA */
.catalog-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}
.catalog-price strong {
    color: var(--text);
    font-size: 20px;
    overflow-wrap: anywhere;
}
.catalog-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}
.catalog-card-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}
.catalog-details-button {
    border: 1px solid #47627b;
    background: #18283d;
    color: #e7f3ff;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.catalog-details-button:hover {
    background: #254360;
    border-color: #7dd3fc;
}
.catalog-buy,
.catalog-buy-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}
.catalog-buy {
    border: 1px solid #168449;
    background: #25d366;
    color: #062b16;
    transition: background .2s ease;
}
.catalog-buy:hover {
    background: #4ade80;
    color: #062b16;
}
.catalog-buy-disabled {
    border: 1px solid #3e526a;
    background: #26354a;
    color: var(--muted);
}

/* ESTADO VACIO */
.catalog-empty {
    grid-column: 1 / -1;
    padding: 65px 20px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    background: var(--card);
    text-align: center;
}
.catalog-empty-icon {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 55px;
}
.catalog-empty h3 {
    margin-bottom: 10px;
    font-size: 23px;
}
.catalog-empty p {
    margin-bottom: 25px;
    color: var(--muted);
}
.catalog-empty .btn-outline {
    display: inline-flex;
}

/* PAGINACION */
.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 45px;
}
.catalog-pagination a,
.catalog-pagination span {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
}
.catalog-pagination a {
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
}
.catalog-pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.catalog-pagination .disabled {
    color: #64748b;
}

/* ==========================================
   MODAL - FICHA COMPLETA DEL PRODUCTO
========================================== */
.catalog-full-description[hidden],
.catalog-product-dialog [hidden] {
    display: none !important;
}
.catalog-product-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(900px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    max-height: min(90vh, 820px);
    max-height: min(90dvh, 820px);
    margin: auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #36536f;
    border-radius: 22px;
    background: #101b2e;
    color: #f8fafc;
    box-shadow: 0 28px 85px rgba(0, 0, 0, .6);
}
.catalog-product-dialog::backdrop {
    background: rgba(3, 9, 20, .78);
    backdrop-filter: blur(5px);
}
.catalog-modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    min-width: 0;
}
.catalog-modal-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 420px;
    padding: 24px;
    background: #0b1524;
    border-right: 1px solid #283b53;
}
.catalog-modal-visual img {
    display: block;
    width: 100%;
    max-height: 440px;
    object-fit: contain;
    border-radius: 12px;
}
.catalog-modal-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #91b7d0;
    text-align: center;
}
.catalog-modal-placeholder strong {
    font-size: 76px;
    line-height: 1;
    letter-spacing: -5px;
}
.catalog-modal-placeholder span {
    font-size: 17px;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.catalog-modal-info {
    min-width: 0;
    padding: 42px 34px 32px;
}
.catalog-modal-eyebrow {
    display: block;
    margin-bottom: 15px;
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}
.catalog-modal-category {
    display: inline-block;
    max-width: 100%;
    padding: 6px 11px;
    border: 1px solid #315a78;
    border-radius: 999px;
    background: #19334b;
    color: #bde6ff;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.catalog-modal-info h2 {
    margin: 14px 0 10px;
    color: #f8fafc;
    font-size: clamp(23px, 2.8vw, 30px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.catalog-modal-featured {
    display: inline-block;
    margin-bottom: 14px;
    color: #fde68a;
    font-size: 12px;
    font-weight: 700;
}
.catalog-modal-price {
    margin: 14px 0 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #2f4159;
    color: #7dd3fc;
    font-size: 25px;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.catalog-modal-description-title {
    margin: 0 0 9px;
    color: #f1f5f9;
    font-size: 15px;
    font-weight: 800;
}
.catalog-modal-description {
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.85;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.catalog-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 27px;
}
.catalog-modal-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 45px;
    padding: 10px 18px;
    border-radius: 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.catalog-modal-cancel {
    border: 1px solid #41566e;
    background: #24364d;
    color: #e2e8f0;
}
.catalog-modal-cancel:hover {
    background: #31455e;
}
.catalog-modal-whatsapp {
    flex: 1;
    border: 1px solid #13804a;
    background: #168449;
    color: #fff;
}
.catalog-modal-whatsapp:hover {
    background: #116c3c;
    color: #fff;
}
.catalog-modal-close {
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #44607b;
    border-radius: 12px;
    background: #1e3046;
    color: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}
.catalog-modal-close:hover {
    background: #304862;
}

/* ENFOQUE PARA NAVEGACION CON TECLADO */
.catalog-filter:focus-visible,
.catalog-buy:focus-visible,
.catalog-details-button:focus-visible,
.catalog-modal-cancel:focus-visible,
.catalog-modal-whatsapp:focus-visible,
.catalog-modal-close:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}

/* TABLETAS */
@media (max-width: 950px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* MODAL EN TABLETAS Y CELULARES */
@media (max-width: 720px) {
    .catalog-product-dialog {
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        border-radius: 17px;
    }
    .catalog-modal-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .catalog-modal-visual {
        min-height: 190px;
        max-height: 260px;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid #283b53;
    }
    .catalog-modal-visual img {
        max-height: 220px;
    }
    .catalog-modal-info {
        padding: 24px 20px 25px;
    }
}

/* CELULARES */
@media (max-width: 600px) {
    .catalog-hero {
        padding: 55px 0 45px;
    }
    .catalog-hero h1 {
        font-size: 32px;
    }
    .catalog-section {
        padding: 45px 0 100px;
    }
    .catalog-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    .catalog-card-body {
        padding: 20px;
    }
    .catalog-heading {
        align-items: flex-start;
    }
    .catalog-heading h2 {
        font-size: 27px;
    }
    .catalog-filter {
        min-height: 44px;
    }
    .catalog-wa-link {
        width: 100%;
        text-align: center;
    }
}

/* PANTALLAS MUY ESTRECHAS */
@media (max-width: 440px) {
    .catalog-card-actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .catalog-modal-actions > * {
        width: 100%;
        flex: 1 1 100%;
    }
    .catalog-modal-price {
        font-size: 22px;
    }
}

/* ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
    .catalog-card,
    .catalog-filter,
    .catalog-buy,
    .catalog-details-button {
        transition: none;
    }
}
