/**
 * Edufin - Product Section Styles
 * Product cards for EduFin Finance and Bill Agregator
 * Uses min/max sizing for consistent behavior across breakpoints
 */

/* ===================================
   SECTION CONTAINER
   =================================== */

.product-section {
    background-color: var(--color-base-white);
    padding: var(--space-30) var(--space-30);
}

/* ===================================
   SECTION HEADER
   =================================== */

.product-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
    margin-bottom: var(--space-6);
}

/* Badge */
.product-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) var(--space-4);
    border: 1px solid var(--color-base-white-stroke);
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1.71;
    color: var(--color-base-gray-text);
}

/* Title */
.product-title {
    font-family: var(--font-primary);
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    line-height: 1.17;
    color: var(--color-base-black);
    text-transform: capitalize;
    max-width: 50.625rem;
    margin: 0;
}

/* Subtitle */
.product-subtitle {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-regular);
    line-height: 1.8;
    color: var(--color-base-gray-text);
    margin: 0;
}

/* ===================================
   CONTENT CONTAINER
   =================================== */

.product-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.75rem;
}

/* ===================================
   CARDS SCROLL CONTAINER
   The wrapper handles horizontal scroll
   =================================== */

.product-cards-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-cards-wrapper::-webkit-scrollbar {
    display: none;
}

/* Inner flex container for cards */
.product-cards {
    display: inline-flex;
    gap: var(--space-5);
    padding: 1.625rem;
}

/* ===================================
   PRODUCT CARD
   Card sizing: min 288px, max 590px
   =================================== */

.product-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-8);
    background: var(--color-base-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    width: calc(2px + 50% - var(--space-6) / 2);
    flex-shrink: 0;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Card Header */
.product-card-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Tag (EduFin Finance / Bill Agregator) */
.product-card-tag {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: 1.625;
    color: var(--color-primary-orange);
}

/* Card Title */
.product-card-title {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: 1.3;
    color: var(--color-neutral-900);
    text-transform: capitalize;
    margin: 0;
}

/* ===================================
   CARD IMAGE
   =================================== */

.product-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 542 / 365;
    border-radius: 0.375rem;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

/* ===================================
   CARD BODY
   =================================== */

.product-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* Description */
.product-card-description {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: 1.625;
    color: var(--color-neutral-900);
    opacity: 0.6;
    margin: 0;
}

/* CTA Link */
.product-card-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-primary-green-dark);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1.43;
    color: var(--color-primary-green-dark);
    text-decoration: none;
    width: fit-content;
    transition: opacity var(--transition-fast);
}

.product-card-link:hover {
    opacity: 0.8;
}

.product-card-link svg {
    width: var(--space-5);
    height: var(--space-5);
    flex-shrink: 0;
}

/* ===================================
   SLIDER INDICATOR
   Hidden on desktop, always visible on tablet/mobile
   =================================== */

.product-slider-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.indicator-dot {
    width: var(--space-2);
    height: var(--space-2);
    padding: 0;
    border: none;
    background-color: var(--color-primary-green-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
}

.indicator-dot.is-active {
    width: var(--space-6);
    background-color: var(--color-primary-green-dark);
    border-radius: 6.25rem;
}

.indicator-dot:hover:not(.is-active) {
    opacity: 0.7;
}

.indicator-dot:focus {
    outline: 2px solid var(--color-primary-green-dark);
    outline-offset: 2px;
}

/* ===================================
   CTA BUTTON
   =================================== */

.product-cta {
    display: flex;
    justify-content: center;
}

.product-cta .btn-primary {
    background-color: var(--color-primary-orange);
    color: var(--color-base-white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    line-height: 1.67;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.product-cta .btn-primary:hover {
    background-color: #d94410;
    transform: translateY(-2px);
}

/* ===================================
   TABLET STYLES (769px - 1279px)
   =================================== */

@media (max-width: 80rem) and (min-width: 48.0625rem) {
    .product-section {
        padding: 3.75rem 0;
    }

    .product-header {
        max-width: 45.5rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5625rem;
        padding: 0 var(--space-5);
    }

    .product-title {
        font-size: var(--space-8);
        line-height: 1;
        max-width: 44.625rem;
    }

    .product-subtitle {
        font-size: var(--text-base);
        line-height: 1.625;
    }

    .product-content {
        gap: 1.5625rem;
    }

    .product-cards {
        gap: var(--space-4);
        padding: 1.625rem var(--space-5);
        /* Center when content fits, left-align when scrolling */
        width: fit-content;
        min-width: 100%;
        justify-content: center;
    }

    .product-card {
        width: 25.5625rem;
    }

    /* Always show indicator on tablet */
    .product-slider-indicator {
        display: flex;
    }

    .product-cta {
        padding: 0 var(--space-5);
    }

    .product-cta .btn-primary {
        width: 22.375rem;
    }
}

/* ===================================
   MOBILE STYLES (max-width: 768px)
   =================================== */

@media (max-width: 48rem) {
    .product-section {
        padding: var(--space-8) 0;
    }

    .product-header {
        gap: var(--space-4);
        margin-bottom: 1.5625rem;
        padding: 0 var(--space-4);
    }

    .product-title {
        font-size: var(--space-6);
        line-height: 1.25;
        letter-spacing: -1px;
    }

    .product-subtitle {
        font-size: var(--text-sm);
        line-height: 1.71;
    }

    .product-content {
        gap: 1.5625rem;
    }

    .product-cards {
        gap: var(--space-4);
        padding: 1.625rem var(--space-4);
        /* Center when content fits, left-align when scrolling */
        width: fit-content;
        min-width: 100%;
        justify-content: center;
    }

    .product-card {
        width: 18rem;
    }

    /* Always show indicator on mobile */
    .product-slider-indicator {
        display: flex;
    }

    .product-cta {
        padding: 0 var(--space-4);
        width: 100%;
    }

    .product-cta .btn-primary {
        width: 100%;
        max-width: 22.375rem;
    }
}

/* ===================================
   SMALL MOBILE STYLES
   =================================== */

@media (max-width: 480px) {
    .product-card {
        padding: var(--space-6);
        gap: var(--space-5);
    }

    .product-card-title {
        font-size: var(--text-lg);
    }

    .product-card-description {
        font-size: var(--text-sm);
    }
}
