/* =============================================
   CATÁLOGO DE PRODUCTOS — Estilos externos
   Laboratorios Gaher S.A.
   ============================================= */

/* ===== HERO ===== */
.cat-hero {
    position: relative;
    background: var(--primary-navy, #00173b);
    padding: 56px 0 48px;
    overflow: hidden;
}

.cat-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cat-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cat-hero-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    line-height: 1.6;
    margin: 0;
}

/* ===== BREADCRUMB ===== */
.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.cat-breadcrumb a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s;
}

.cat-breadcrumb a:hover {
    color: white;
}

.cat-breadcrumb span:last-child {
    color: white;
    font-weight: 600;
}

/* ===== FILTERS BAR ===== */
.cat-filters-section {
    padding: 24px 0;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.cat-filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-light, #f8f9fa);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
}

.cat-search-wrap {
    flex: 1;
    position: relative;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.cat-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #747780;
    z-index: 1;
}

.cat-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #c4c6d0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-family: inherit;
    font-size: 0.92rem;
    background: white;
    color: var(--text-dark, #1e293b);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.cat-search-input:focus {
    outline: none;
    border-color: #00a8e8;
    box-shadow: 0 0 0 2px rgba(0, 168, 232, 0.12);
}

.cat-select-wrap {
    position: relative;
    min-width: 200px;
}

.cat-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid #c4c6d0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    background: white;
    color: var(--text-dark, #1e293b);
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.cat-select:focus {
    outline: none;
    border-color: #00a8e8;
}

.cat-select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #747780;
    pointer-events: none;
}

.cat-btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: 1px solid #c4c6d0;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #44474f;
    text-decoration: none;
    background: white;
    white-space: nowrap;
    transition: background 0.2s;
}

.cat-btn-clear:hover {
    background: #e7e8e9;
}

/* ===== SEARCH BUTTON ===== */
.cat-btn-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: 0 8px 8px 0;
    background: var(--primary-navy, #00173b);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.cat-btn-search:hover {
    background: #002866;
}

/* ===== GRID ===== */
.cat-grid-section {
    padding: 40px 0 60px;
}

/* ===== PRODUCT CARD ===== */
.cat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 350px;
    cursor: pointer;
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.cat-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.cat-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-light, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
}

.cat-card-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.5s ease;
}

.cat-card:hover .cat-card-img img {
    transform: scale(1.08);
}

.cat-card-img-placeholder {
    font-size: 52px;
    color: #c4c6d0;
}

.cat-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    z-index: 3;
}

.cat-card-badge {
    position: static;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 50px;
    text-transform: capitalize;
}

.cat-badge-blue {
    background: rgba(0, 168, 232, 0.1);
    color: #0077b6;
    border: 1px solid rgba(0, 168, 232, 0.2);
}

.cat-card-body {
    flex: 1;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.cat-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-navy, #00173b);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-stock-ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.15);
}

.cat-badge-vet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fdf6e3, #fef3d9);
    color: #8a6d1d;
    border: 1px solid rgba(138, 109, 29, 0.25);
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.cat-card-desc {
    font-size: 0.84rem;
    color: #44474f;
    line-height: 1.55;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.cat-card-info-left {
    display: flex;
    flex-direction: column;
}

.cat-card-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #747780;
    letter-spacing: 0.3px;
}

.cat-card-info-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark, #1e293b);
}

.cat-card-pres-item {
    margin-right: 4px;
}

.cat-card-senasa {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 194, 0, 0.15);
    color: #00173b;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 194, 0, 0.35);
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cat-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 20px 20px;
    padding: 12px;
    background: var(--accent-yellow, #fbc02d);
    color: var(--primary-navy, #00173b);
    font-size: 0.8rem;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-card-btn:hover {
    background: #e6b000;
    box-shadow: 0 4px 12px rgba(255, 194, 0, 0.3);
    transform: translateY(-2px);
}

/* ===== PAGINATION ===== */
.cat-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.cat-pagination nav {
    background: white;
    padding: 8px 12px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.cat-pagination .pagination {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.cat-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-navy, #00173b);
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cat-pagination .page-item .page-link:focus {
    box-shadow: none;
    outline: none;
    background: #f1f5f9;
}

.cat-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.cat-pagination .page-item.active .page-link,
.cat-pagination .page-item.active .page-link:hover {
    background: var(--accent-yellow, #fbc02d);
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(251, 192, 45, 0.4);
    transform: scale(1.05);
    z-index: 2;
}

.cat-pagination .page-item.disabled .page-link {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
}

/* ===== EMPTY STATE ===== */
.cat-empty {
    text-align: center;
    padding: 72px 0;
}

.cat-empty h4 {
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 6px;
}

.cat-empty p {
    color: #747780;
}

/* ===== DETALLE — Image Box ===== */
.detail-img-box {
    background: var(--bg-light);
    border: 1px solid #f8f8f8;
    border-radius: 12px;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    position: sticky;
    top: 80px;
}

.detail-img-box img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

/* ===== DETALLE — Title ===== */
.detail-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 16px;
    line-height: 1.2;
}

/* ===== DETALLE — Blocks ===== */
.detail-block {
    margin-bottom: 28px;
}
detail-img-box .detail-block-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #747780;
    margin-bottom: 10px;
}

.detail-block-text {
    font-size: 0.95rem;
    color: #44474f;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ===== DETALLE — Presentations ===== */
.detail-presentations {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-pres-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 28px;
    text-align: center;
    min-width: 100px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}

.detail-pres-btn {
    cursor: pointer;
    font-family: inherit;
}

.detail-pres-btn:hover {
    border-color: #00a8e8;
}

.detail-pres-card.active {
    border-color: #00a8e8;
    box-shadow: 0 2px 10px rgba(0, 168, 232, 0.18);
    background: #f2fafe;
}

.detail-pres-card:hover {
    border-color: #00a8e8;
    box-shadow: 0 2px 8px rgba(0, 168, 232, 0.1);
}

.detail-pres-icon {
    color: #00a8e8;
    margin-bottom: 4px;
}

.detail-pres-qty {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1;
}

.detail-pres-unit {
    font-size: 0.78rem;
    color: #747780;
    margin-top: 2px;
}

/* ===== DETALLE — Actions ===== */
.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.detail-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary-navy);
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 23, 59, 0.2);
}

.detail-btn-primary:hover {
    background: var(--secondary-navy);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 23, 59, 0.25);
}

.detail-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: 1px solid #c4c6d0;
    background: white;
    color: #44474f;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.detail-btn-secondary:hover {
    border-color: #747780;
    background: var(--bg-light);
}

/* ===== CLEAR INPUT BUTTON ===== */
.cat-btn-clear-input {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #e1e3e4;
    color: #44474f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
    z-index: 2;
}

.cat-btn-clear-input:hover {
    background: #c4c6d0;
    color: #191c1d;
}

.cat-search-input.has-clear {
    padding-right: 42px;
}

/* ===== LOADING ANIMATION ===== */
.animate-spin {
    animation: cat-spin 1s linear infinite;
}

@keyframes cat-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .cat-hero {
        padding: 36px 0 32px;
    }

    .cat-hero-title {
        font-size: 1.6rem;
    }

    .cat-hero-desc {
        font-size: 0.9rem;
    }

    .cat-filters-section {
        padding: 16px 0;
    }

    .cat-filters-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .cat-search-wrap {
        min-width: 100%;
        width: 100%;
    }

    .cat-select-wrap {
        min-width: 100%;
        width: 100%;
    }

    .cat-btn-search {
        padding: 12px 20px;
    }

    .cat-btn-search-text {
        display: none;
    }

    .cat-btn-search .cat-btn-search-icon,
    .cat-btn-search .cat-btn-loading-icon {
        margin: 0;
    }

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

    .cat-card {
        max-width: 100%;
    }

    .cat-pagination nav {
        padding: 6px 10px;
    }

    .cat-pagination .page-item .page-link {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 0.82rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .cat-search-wrap {
        min-width: 280px;
    }

    .cat-select-wrap {
        min-width: 200px;
    }
}

@media (max-width: 991.98px) {
    .detail-img-box {
        position: static;
        min-height: 260px;
        background-color: white;
    }

    .detail-title {
        font-size: 1.5rem;
    }
}
