/* --- Layout --- */
.container-Carousel {  
    padding: 0 1rem;
    position: relative;
    max-width: 90%;
    height: 100vh;

}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Main Content Container */
.main-content {
  max-width: 1512px;
  margin: 80pt auto;
  padding: 0 var(--container-padding-desktop);
  box-sizing: border-box;
}

.closing-section {
    margin-bottom: 20px;
}

/* --- Carousel Window --- */
.carousel-window {
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    overflow: hidden;
    border: 1px solid var(--border-color); 
 }

.carousel-track {
    display: flex;
    transition: transform var(--transition-speed) ease-in-out;
 }

/* --- Content Blocks --- */
.block {
    min-width: 100%;
    display: flex;
    padding: var(--spacing);
    min-height: 250px;
}

.block-left {
    width: 30%;
    border-right: 1px solid var(--border-color);
    padding-right: var(--spacing);
}

.block-right {
    width: 70%;
    padding-left: var(--spacing);
}

.block-name {
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 60px;
    margin: 40px auto ;
}

.item-list {
    list-style: none;
    margin: 2rem auto ;
}

.item-list ul, li { 
    color: var(--text-muted);
    text-align: left;
}

/* --- Controls --- */
.jump-dropdown {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-arrow:hover {
    background: var(--primary-color);
    color: white;
}

.arrow-prev {
    left: 10px;
}

.arrow-next {
    right: 10px;
}

/* --- Bottom Tabs --- */
.tab-bar { 
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 700px;
    height: 65px;
    background: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    z-index: 100;
    gap: 12px;
    overflow-x: auto;
    margin-top: 20px;
}

.tab-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    border-bottom: 4px solid transparent;

    border-radius: 12px;
    border: 1px solid;
 }

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--button-bg);
    color: var(--button-text-color);

}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .block {
        flex-direction: column;
    }

    .block-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .block-right {
        width: 100%;
        padding-left: 0;
    }

    .nav-arrow {
        width: 32px;
        height: 32px;
    }

    .container-Carousel {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    /* 1. Reset the main container spacing */
    .main-content {
        margin: 20px auto; /* Reduced from 80pt */
        padding: 0 15px;
    }

    /* 2. Fix the Block Layout */
    .block {
        flex-direction: column;
        padding: 1rem; /* Tighten up internal padding */
        min-height: auto; /* Allow content to dictate height */
    }

    /* 3. Normalize the Block Name (The biggest space hog) */
    .block-name {
        width: 100%;
        padding: 10px 0; /* Drastically reduced from 60px */
        margin: 0 0 10px 0; /* Reduced from 40px */
        text-align: center;
        font-size: 1.1rem;
    }

    /* 4. Adjust the List */
    .item-list {
        margin: 0; 
        padding: 0 10px;
    }

    /* 5. Reposition Arrows for better UX */
    .nav-arrow {
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(4px); /* Modern touch */
    }
    
    .arrow-prev { left: 5px; }
    .arrow-next { right: 5px; }

    /* 6. Fix the Tab Bar for small screens */
    .tab-bar {
        gap: 8px;
        height: auto;
        padding: 10px;
        grid-template-columns: repeat(2, 1fr); /* 2x2 grid is better than 4 cramped buttons */
        margin-bottom: 180px; 
    }

    .tab-btn {
        padding: 10px 5px;
        font-size: 0.85rem;
    }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 380px) {
    .tab-bar {
        display: flex; /* Switch to scrolling row if 2x2 is still too tight */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;

    }
    .tab-btn {
        flex: 0 0 120px; /* Force buttons to a readable width */
    }
}