/*
 * Catalog listing page styles
 * Loaded via @push('styles') — only on catalog pages.
 */

/* =================================================================
   1. HERO HEADER
   ================================================================= */
.catalog-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1a1a1a;
}

.catalog-hero__image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.catalog-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.catalog-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 1;
}

.catalog-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1rem;
}

.catalog-hero__title {
    font-weight: 900;
    font-size: 2.75rem;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.02em;
}

/* No-image fallback */
.catalog-hero--plain {
    min-height: 140px;
    background: #111;
}

.catalog-hero--plain .catalog-hero__title {
    text-shadow: none;
}

/* =================================================================
   2. BREADCRUMBS
   ================================================================= */
.catalog-breadcrumbs {
    padding: 0.875rem 0;
    border-bottom: 1px solid #eee;
}

.catalog-breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #666;
}

.catalog-breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.25rem;
    color: #aaa;
}

.catalog-breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.catalog-breadcrumbs a:hover {
    color: #c4161c;
    text-decoration: underline;
}

.catalog-breadcrumbs [aria-current="page"] {
    color: #333;
    font-weight: 600;
}

/* =================================================================
   3. CATEGORY INTRO (SEO / AEO description block)
   ================================================================= */
.catalog-intro {
    padding: 1.5rem 0 0.5rem;
}

.catalog-intro__description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #555;
    max-width: 72ch;
}

/* =================================================================
   4. PRODUCT GRID
   ================================================================= */
.catalog-grid {
    padding: 1.5rem 0 3rem;
}

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

.catalog-card {
    display: flex;
    flex-direction: column;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 4px;
}

.catalog-card:hover {
    transform: translateY(-4px);
}

.catalog-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.catalog-card__link:hover {
    text-decoration: none;
    color: inherit;
}

.catalog-card__link:focus-visible {
    outline: 2px solid #c4161c;
    outline-offset: 2px;
    border-radius: 4px;
}

.catalog-card__image {
    position: relative; /* ECOM-081: the flags are positioned against the image */
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.catalog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-card__image img {
    transform: scale(1.05);
}

/* Placeholder for items without images */
.catalog-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    border-radius: 4px;
}

.catalog-card__info {
    text-align: center;
    padding: 0 0.25rem;
}

.catalog-card__name {
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.catalog-card__description {
    font-size: 0.75rem;
    color: #6b6b75; /* 5.27:1 on white; #888 was 3.54:1 (WAVE contrast error, 2026-09-21) */
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =================================================================
   4b. CARD COMMERCE (price + add-to-cart)
   ================================================================= */
.catalog-card__commerce {
    text-align: center;
    padding: 0.5rem 0.25rem 0;
}

.catalog-card__price {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Affirm's line under the price (docs/features/affirm.md). Affirm's script
   writes the text and logo; this only sets its size and spacing. */
.catalog-card__affirm {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: #333;
}

/* The monthly amount Affirm writes (`.affirm-ala-price`), large and in the
   brand's accent text color as Magento showed it. --brand-accent-text is AA on
   white in every brand (BrandTokenTest). */
.catalog-card__affirm .affirm-ala-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--brand-accent-text);
}

.catalog-card__price--original {
    text-decoration: line-through;
    color: #6b6b75; /* was #999, 2.85:1 */
    font-weight: 400;
    margin-right: 0.35rem;
}

.catalog-card__price--sale {
    color: #c4161c;
}

/* ECOM-081: the card wears the PDP's badges — New, "15% off", a deal — top-left
   over the image. Brand fill + on-fill text, the same pair the PDP stage uses. */
.catalog-card__flags {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.catalog-card__flag {
    position: relative;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--brand-primary-fill, #c00c7f);
    color: var(--brand-on-primary, #fff);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* ECOM-083: Popular is deliberately neutral rather than a second sale colour.
   White on this dark fill clears AA at the badge's small type size. */
.catalog-card__flag--popular {
    background: #242424;
    color: #fff;
}

.catalog-card__flag:focus-visible {
    outline: 2px solid var(--brand-on-primary, #fff);
    outline-offset: 2px;
}

.catalog-card__flag-info {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 3;
    min-width: 180px;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.35;
    display: none;
}

.catalog-card__flag:hover .catalog-card__flag-info,
.catalog-card__flag:focus-within .catalog-card__flag-info {
    display: block;
}

.catalog-card__price--current {
    color: #333;
}

.catalog-card__price--range {
    color: #333;
}

.catalog-card__add-btn {
    display: inline-block;
    background: #ff10a4;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 0.4rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1.3;
}

.catalog-card__add-btn:hover {
    background: #e00e93;
}

.catalog-card__add-btn:active {
    transform: scale(0.97);
}

.catalog-card__add-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.catalog-card__add-btn:focus-visible {
    outline: 2px solid #ff10a4;
    outline-offset: 2px;
}

.catalog-card__out-of-stock {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b6b75; /* was #999, 2.85:1 on white */
    padding: 0.4rem 0;
}

.catalog-card__feedback {
    font-size: 0.6875rem;
    margin-top: 0.375rem;
    line-height: 1.3;
}

.catalog-card__feedback--success {
    color: #28a745;
}

.catalog-card__feedback--error {
    color: #c4161c;
}

/* =================================================================
   5. EMPTY STATE
   ================================================================= */
.catalog-empty {
    padding: 4rem 0;
    text-align: center;
    color: #6b6b75; /* was #999, 2.85:1 on white */
    font-size: 1.125rem;
}

/* =================================================================
   6. ABOUT / LONG DESCRIPTION (AEO-rich content block)
   ================================================================= */
.catalog-about {
    padding: 2.5rem 0 3rem;
    border-top: 1px solid #eee;
}

.catalog-about__heading {
    font-weight: 900;
    font-size: 1.125rem;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: #333;
}

.catalog-about__content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #555;
    max-width: 72ch;
}

.catalog-about__content p {
    margin-bottom: 1rem;
}

.catalog-about__toggle {
    background: none;
    border: none;
    color: #c4161c;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
}

.catalog-about__toggle:hover {
    text-decoration: underline;
}

.catalog-about__body--collapsed {
    max-height: 6em;
    overflow: hidden;
    position: relative;
}

.catalog-about__body--collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Tablet */
@media (max-width: 991.98px) {
    .catalog-hero {
        min-height: 220px;
    }

    .catalog-hero__title {
        font-size: 2rem;
    }

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

/* Mobile */
@media (max-width: 575.98px) {
    .catalog-hero {
        min-height: 180px;
    }

    .catalog-hero__title {
        font-size: 1.5rem;
    }

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

    .catalog-card__name {
        font-size: 0.75rem;
    }

    .catalog-card__description {
        display: none;
    }

    .catalog-card__add-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.625rem;
    }

    .catalog-card__price {
        font-size: 0.8125rem;
    }
}
