/**
 * New Products Carousel – Frontend Styles
 *
 * Mirrors the category carousel section layout and uses the
 * related-product-card design patterns for individual product cards.
 */

.ims-new-products-carousel-section {
    background: #e8eaed;
    padding: 1.5rem 2rem 1.25rem;
    margin: 0;
    position: relative;
}

/* Kill any Splide-generated pagination that may still appear */
.ims-new-products-carousel-section .splide__pagination {
    display: none !important;
}

/* ── Header ─────────────────────────────────────────────── */

.new-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto 0.5rem;
}

.new-products-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.new-products-header .carousel-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
}

.new-products-see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.new-products-see-all:hover {
    color: var(--color-cta);
}

.new-products-see-all svg {
    transition: transform 0.2s ease;
}

.new-products-see-all:hover svg {
    transform: translateX(3px);
}

/* ── Nav Buttons ────────────────────────────────────────── */

.new-products-header .header-right {
    display: flex;
    gap: 0.5rem;
}

.ims-new-products-carousel-section .carousel-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--color-dark);
}

.ims-new-products-carousel-section .carousel-nav-btn:hover {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: white;
}

.ims-new-products-carousel-section .carousel-nav-btn:active {
    transform: scale(0.95);
}

/* ── Subtitle ───────────────────────────────────────────── */

.ims-new-products-carousel-section .carousel-subtitle {
    max-width: 1400px;
    margin: 0 auto 0.75rem;
    color: #555;
    font-size: 0.95rem;
}

/* ── Splide Container ───────────────────────────────────── */

.new-products-splide {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 0 !important;
}

.new-products-splide .splide__track {
    overflow: hidden;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.new-products-splide .splide__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.new-products-splide .splide__slide {
    list-style: none !important;
    height: auto !important;
}

/* ── Product Grid (inside each slide) ───────────────────── */

.new-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 5), 1fr);
    gap: 0.625rem;
}

/* ── Product Card ───────────────────────────────────────── */

.new-product-card {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.new-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.new-product-card-inner {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* "NEW" badge */
.new-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-cta, #f9c457);
    color: var(--color-dark, #1a1a1a);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    line-height: 1;
    z-index: 1;
}

/* ── Product Image ──────────────────────────────────────── */

.new-product-image {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: #f9fafb;
    overflow: hidden;
}

.new-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.new-product-card:hover .new-product-image img {
    transform: scale(1.05);
}

/* ── Product Info ───────────────────────────────────────── */

.new-product-info {
    padding: 0.5rem 0.625rem 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

/* Name */
.new-product-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-dark-charcoal, #1a1a1a);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* SKU – gold pill matching the product listing page */
.new-product-sku {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-dark, #1a1a1a);
    background: var(--color-gold-light, #fef3c7);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    line-height: 1;
}

.new-product-sku svg {
    flex-shrink: 0;
    color: var(--color-dark, #1a1a1a);
}

.new-product-sku .sku-label {
    font-weight: 400;
    letter-spacing: 0.02em;
}

.new-product-sku .sku-value {
    font-weight: 400;
    letter-spacing: 0.04em;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

/* Price */
.new-product-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.125rem;
}

.new-product-price .price-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-dark, #1a1a1a);
}

.new-product-price .price-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

.new-product-price .price-call {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
}

/* ── Empty State ────────────────────────────────────────── */

.ims-new-products-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
    max-width: 1400px;
    margin: 2rem auto;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1400px) {
    .new-products-grid {
        --columns: 4 !important;
    }
}

@media (max-width: 1024px) {
    .new-products-grid {
        --columns: 3 !important;
    }
}

@media (max-width: 768px) {
    .new-products-grid {
        --columns: 2 !important;
    }

    .new-products-header {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .ims-new-products-carousel-section {
        padding: 1.25rem 1rem;
    }

    .new-products-grid {
        --columns: 2 !important;
        gap: 0.375rem;
    }

    .new-products-header .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .new-products-header .carousel-title {
        font-size: 1.4rem;
    }

    .ims-new-products-carousel-section .carousel-nav-btn {
        width: 36px;
        height: 36px;
    }

    .new-product-info {
        padding: 0.375rem 0.5rem 0.5rem;
    }

    .new-product-name {
        font-size: 0.7rem;
    }

    .new-product-price .price-amount {
        font-size: 0.9375rem;
    }
}
