/*
 * Template: Catalog / Shop
 *
 * Reuses .blog-* layout classes from archive.css.
 * Only catalog-specific overrides here.
 */

.template-catalog {
    background-color: #000;
}


/* ==========================================================================
   Sidebar heading with icon
   ========================================================================== */

.catalog-sidebar .blog-sidebar__heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Active category link in sidebar */
.blog-sidebar__cats-link.catalog-cat--active,
.blog-sidebar__cats-link.catalog-cat--active:hover {
    color: var(--color-green, #a6ce39);
    font-weight: 600;
}


/* ==========================================================================
   Price range filter
   ========================================================================== */

.catalog-price-filter {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.catalog-price-filter__range {
    width: 100%;
}

.catalog-price-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.catalog-price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-green, #a6ce39);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(166, 206, 57, 0.4);
}

.catalog-price-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-green, #a6ce39);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(166, 206, 57, 0.4);
}

.catalog-price-filter__labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.catalog-price-filter__min,
.catalog-price-filter__current {
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    color: #aaa;
}

.catalog-price-filter__current {
    color: var(--color-green, #a6ce39);
    font-weight: 600;
}


/* ==========================================================================
   Products grid
   ========================================================================== */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ==========================================================================
   Product card
   ========================================================================== */

.catalog-card {
    background: #0d0d0d;
    border: 1px solid #1e1e1e;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 16px rgba(166, 206, 57, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* needed for the full-card clickable overlay */
}

.catalog-card:hover {
    box-shadow: 0 6px 28px rgba(166, 206, 57, 0.13);
    transform: translateY(-2px);
}

/* Image */
.catalog-card__img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.catalog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.catalog-card:hover .catalog-card__img {
    transform: scale(1.04);
}

/* Badge */
.catalog-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
}

.catalog-card__badge--oferta {
    background: #e53e3e;
    color: #fff;
}

.catalog-card__badge--nuevo {
    background: var(--color-green, #a6ce39);
    color: #000;
}

.catalog-card__badge--exclusivo {
    background: var(--color-lime, #d7e61a);
    color: #000;
}

.catalog-card__badge--popular {
    background: #fff;
    color: #000;
}

/* Body */
.catalog-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1;
}

.catalog-card__title {
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.35;
    margin: 0;
}

.catalog-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.catalog-card__title a:hover {
    color: var(--color-green, #a6ce39);
    text-decoration: none;
}

/*
 * Full-card overlay: the ::before covers the entire .catalog-card surface
 * (which is now position:relative). Clicking anywhere on the card except
 * the "Agregar" button navigates to the single product page.
 */
.catalog-card__title a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Interactive elements must sit above the overlay */
.catalog-card__cart-btn {
    position: relative;
    z-index: 2;
}

.catalog-card__img-link {
    display: block;
    position: relative;
    z-index: 2; /* keep image link independently clickable */
}

.catalog-card__pricing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.catalog-card__price {
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-green, #a6ce39);
}

.catalog-card__old-price {
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 400;
    color: #555;
    text-decoration: line-through;
}

.catalog-card__cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: auto;
    padding: 8px 14px;
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
    background: var(--color-green, #a6ce39);
    border: 1px solid var(--color-green, #a6ce39);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(166, 206, 57, 0.2);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.catalog-card__cart-btn:hover {
    box-shadow: 0 4px 18px rgba(166, 206, 57, 0.35);
    transform: translateY(-1px);
}

/* State: product already in cart → outlined */
.catalog-card__cart-btn.is-in-cart {
    background: transparent;
    color: var(--color-green, #a6ce39);
    border-color: var(--color-green, #a6ce39);
    box-shadow: none;
}

.catalog-card__cart-btn.is-in-cart:hover {
    box-shadow: 0 3px 14px rgba(166, 206, 57, 0.2);
    transform: translateY(-1px);
}


/* ==========================================================================
   No results message
   ========================================================================== */

.catalog-no-results {
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.925rem;
    color: #555;
    text-align: center;
    padding: 3rem 0;
    margin: 0;
}


/* ==========================================================================
   Mobile (≤768px) — single column grid
   ========================================================================== */

@media (max-width: 768px) {

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .catalog-mobile-top {
        display: flex;
        flex-direction: column;
        gap: 0.875rem;
        margin-bottom: 1.5rem;
    }
}
