/* ==========================================================================
   Haircare Affiliate Products - Responsive Styles
   Inherits CSS custom properties from Haircare theme
   ========================================================================== */

/* --- Global Disclosure (Amazon TOS) --- */

.hap-global-disclosure {
    font-size: 12px;
    color: var(--color-muted-steel, #6B7280);
    text-align: center;
    margin-bottom: 16px;
    font-style: italic;
}

/* --- Product Card --- */

.hap-product-card {
    display: flex;
    flex-direction: row;
    background: var(--color-canvas-white, #FFFFFF);
    border: 1px solid var(--color-whisper-border, #E5E7EB);
    border-radius: var(--radius-lg, 0.5rem);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    max-width: 700px;
    margin-bottom: 20px;
}

.hap-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* --- Product Image --- */

.hap-product-image {
    flex: 0 0 40%;
    max-width: 40%;
    overflow: hidden;
    background: var(--color-surface-container-low, #f4f3f6);
}

.hap-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hap-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 48px;
    color: var(--color-muted-steel, #6B7280);
}

.hap-no-image-icon {
    opacity: 0.4;
}

/* --- Product Body --- */

.hap-product-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hap-product-title {
    font-family: var(--font-headline, 'Plus Jakarta Sans', sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-charcoal-ink, #1A1A1A);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.hap-product-description {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 14px;
    color: var(--color-muted-steel, #6B7280);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* --- Price --- */

.hap-product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
}

.hap-price-value {
    font-family: var(--font-headline, 'Plus Jakarta Sans', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-charcoal-ink, #1A1A1A);
}

.hap-price-date {
    font-size: 11px;
    color: var(--color-muted-steel, #6B7280);
    font-style: italic;
}

/* --- CTA Button --- */

.hap-product-button {
    display: inline-block;
    background: var(--color-primary, #002444);
    color: var(--color-on-primary, #ffffff);
    font-family: var(--font-headline, 'Plus Jakarta Sans', sans-serif);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--radius-default, 0.25rem);
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-height: 48px;
    line-height: 1.4;
    align-self: flex-start;
}

.hap-product-button:hover {
    background: var(--color-crimson-bold, #B91C1C);
    color: #ffffff;
}

.hap-product-button:active {
    transform: scale(0.97);
}

.hap-product-button:focus-visible {
    outline: 2px solid var(--color-crimson-bold, #B91C1C);
    outline-offset: 2px;
}

/* --- Affiliate Link Badge --- */

.hap-affiliate-disclosure {
    font-size: 10px;
    color: var(--color-muted-steel, #6B7280);
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* --- Grid Layout --- */

.hap-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hap-products-grid .hap-product-card {
    max-width: 100%;
    flex-direction: column;
}

.hap-products-grid .hap-product-image {
    flex: none;
    max-width: 100%;
    max-height: 220px;
}

.hap-products-grid .hap-product-image img {
    height: 220px;
}

.hap-products-grid .hap-product-body {
    padding: 16px;
}

.hap-products-grid .hap-product-button {
    width: 100%;
    text-align: center;
}

.hap-no-products {
    text-align: center;
    color: var(--color-muted-steel, #6B7280);
    font-style: italic;
    padding: 40px 20px;
    background: var(--color-surface-container-low, #f4f3f6);
    border-radius: var(--radius-lg, 0.5rem);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet: 768px - 1024px */
@media ( max-width: 1024px ) {
    .hap-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: < 768px */
@media ( max-width: 768px ) {
    /* Single card stacks vertically */
    .hap-product-card {
        flex-direction: column;
        max-width: 100%;
    }

    .hap-product-image {
        flex: none;
        max-width: 100%;
        max-height: 260px;
    }

    .hap-product-image img {
        width: 100%;
        height: 260px;
        object-fit: cover;
    }

    .hap-product-body {
        padding: 16px;
    }

    .hap-product-title {
        font-size: 18px;
    }

    .hap-product-description {
        font-size: 13px;
    }

    .hap-price-value {
        font-size: 20px;
    }

    .hap-product-button {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Grid: single column */
    .hap-products-grid {
        grid-template-columns: 1fr;
    }

    .hap-products-grid .hap-product-card {
        flex-direction: column;
    }

    .hap-products-grid .hap-product-image {
        max-height: 240px;
    }

    .hap-products-grid .hap-product-image img {
        height: 240px;
    }
}

/* Small mobile: < 480px */
@media ( max-width: 480px ) {
    .hap-product-image {
        max-height: 200px;
    }

    .hap-product-image img {
        height: 200px;
    }

    .hap-product-title {
        font-size: 16px;
    }

    .hap-product-button {
        padding: 14px 16px;
        font-size: 15px;
    }
}
