/**
 * Section Positioning Styles
 * Responsive positioning for homepage section SVG backgrounds and category images
 */

/* =====================================================
   Hero Section Responsive Height
   ===================================================== */
.hero-section {
    min-height: 40vh;
    /* Mobile: shorter hero */
}

@media (min-width: 769px) {
    .hero-section {
        min-height: 80vh;
        /* Desktop: taller hero */
    }
}

/* =====================================================
   Section Banner Container
   ===================================================== */
.section-banner {
    position: relative;
    overflow: visible;
    /* Allow image overflow on all screen sizes */

    /* Default heights - overridden by inline CSS variables */
    --height-xs: 80px;
    --height-sm: 100px;
    --height-md: 120px;
    --height-lg: 140px;
    --height-xl: 160px;
}

/* Responsive banner heights */
.section-banner {
    height: var(--height-xs);
}

@media (min-width: 481px) {
    .section-banner {
        height: var(--height-xs);
    }
}

@media (min-width: 769px) {
    .section-banner {
        height: var(--height-sm);
    }
}

@media (min-width: 1024px) {
    .section-banner {
        height: var(--height-md);
    }
}

@media (min-width: 1280px) {
    .section-banner {
        height: var(--height-lg);
    }
}

@media (min-width: 1536px) {
    .section-banner {
        height: var(--height-xl);
    }
}

/* =====================================================
   Positioned Elements (SVG & Image)
   ===================================================== */
.section-element {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* SVG element */
.section-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-svg svg {
    width: auto;
    height: 100%;
    max-width: none;
}

/* Image element - positioned at bottom-right, overflows upward */
.section-image {
    position: absolute;
    top: auto;
    bottom: 0;
    left: auto;
    right: 2rem;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: visible;
    height: auto;
    max-height: none;
}

/* Allow overflow on all screen sizes when class is present */
.section-image.allow-overflow {
    overflow: visible;
}

.section-image img {
    height: auto;
    width: auto;
    max-height: 200%;
    /* Image is 200% of banner height, so 50% extends above */
    object-fit: contain;
    transform: translateY(0);
    /* Image bottom aligns with banner bottom, top extends above */
}

/* =====================================================
   Scroll Animations
   ===================================================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
}

/* Fade In */
.animate-on-scroll.fade-in.visible {
    opacity: 1;
}

/* Slide Left (starts from left, slides to position) */
.animate-on-scroll.slide-left {
    transform: translateX(-50px);
}

.animate-on-scroll.slide-left.visible {
    transform: translateX(0);
}

/* Slide Right (starts from right, slides to position) */
.animate-on-scroll.slide-right {
    transform: translateX(50px);
}

.animate-on-scroll.slide-right.visible {
    transform: translateX(0);
}

/* Slide Up (starts from bottom, slides up) */
.animate-on-scroll.slide-up {
    transform: translateY(30px);
}

.animate-on-scroll.slide-up.visible {
    transform: translateY(0);
}

/* Scale In (starts smaller, scales to position) */
.animate-on-scroll.scale-in {
    transform: scale(0.8);
}

.animate-on-scroll.scale-in.visible {
    transform: scale(1);
}

/* =====================================================
   Section Title Layer
   ===================================================== */
.section-title-layer {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    height: 100%;
}

/* =====================================================
   Template Carousel
   ===================================================== */
.section-carousel {
    position: relative;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s ease-out;
}

/* Mobile: Horizontal scroll with snap */
@media (max-width: 768px) {
    .carousel-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .carousel-track::-webkit-scrollbar {
        display: none;
    }

    .carousel-item {
        scroll-snap-align: start;
    }
}

/* Desktop: Hidden overflow for slide animation */
@media (min-width: 769px) {
    .carousel-track {
        overflow: hidden;
    }
}

/* Carousel Items */
.carousel-item {
    flex-shrink: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Arrow Buttons */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: #f8fafc;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    left: -22px;
}

.carousel-next {
    right: -22px;
}

/* Hide arrows on mobile */
@media (max-width: 768px) {

    .carousel-prev,
    .carousel-next {
        display: none;
    }
}

/* Dot Indicators */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

/* Hide dots on mobile - using horizontal scroll instead */
@media (max-width: 768px) {
    .carousel-dots {
        display: none;
    }
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: var(--color-primary, #7f13ec);
}

/* Active dot is wider */
.carousel-dot.active {
    width: 24px;
}