.carousel-section {
    /* Wrapper */
    --content-inline-gutter: 10px;
    --content-max-width-after-gutter: 1192px;
    --content-max-width: calc(var(--content-max-width-after-gutter) + 2 * var(--content-inline-gutter));

    container: carousel-section / inline-size;
}

.custom-carousel {
    --slide-spacing: 1rem;
    --slide-size: 100%;
    --card-scale-side: 0.9;
    --card-scale-center: 1.1;
    --card-center-lift: 0.25rem;

    max-width: var(--content-max-width);
    margin: auto;
}

.carousel-viewport {
    /* overflow: hidden; */
    padding-block: 16px;
    padding-inline: 0;
}

.carousel-container {
    isolation: isolate;
    display: flex;
    touch-action: pan-y pinch-zoom;
    gap: var(--slide-spacing);
    padding-inline: var(--slide-spacing);
    box-sizing: border-box;
}

.carousel-slide {
    transform: translate3d(0, 0, 0);
    flex: 0 0 var(--slide-size);
    min-width: 0;
}

.carousel-card {
    --card-radius: 18px;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-radius: var(--card-radius);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
    overflow: visible;
    background: #fff;
    transition: transform 300ms ease-in-out;
    will-change: transform;
    max-height: 438px;
    transform-origin: center center;
    transform: scale(var(--card-scale-side));
}

.carousel-img {
    width: 100%;
    aspect-ratio: 3/2;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.carousel-card-body {
    padding: 16px 18px;
}

.carousel-card-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #212529;
}

.carousel-sub {
    font-size: .925rem;
    color: #6c757d;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 300ms ease, opacity 300ms ease;
}

.carousel-slide.is-center {
    z-index: 2;
}

.carousel-slide.is-center .carousel-card {
    transform: translateY(calc(-1 * var(--card-center-lift))) scale(var(--card-scale-center));
}

.is-center .carousel-sub {
    max-height: 180px;
    opacity: 1;
}

.carousel-controls {
    display: flex;
    grid-template-columns: auto 1fr;
    /* justify-content: flex-end; */
    justify-content: center;
    gap: 1.2rem;
    margin-top: 1.8rem;
}

.carousel-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    align-items: center;
}
.carousel-button {
    -webkit-tap-highlight-color: rgba(var(--text-high-contrast-rgb-value), 0.5);
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
    background: #fff;
    border: 3px solid #dee2e6;
    width: 40px;
    height: 40px;
    z-index: 1;
    border-radius: 50%;
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease, transform 150ms ease;
}

.carousel-button:hover {
    /* background: #f8f9fa; */
    background: #1C313E;
    transform: translateY(-1px);
}

.carousel-button:disabled {
    color: var(--detail-high-contrast);
}

.carousel-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #343a40;
    stroke-width: 2;
}

.carousel-button svg:hover {
    fill: #FFF;
}

.dd-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #9aa0a6;
    background: #FFF;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dd-btn:hover {
    background: #ccc;
}

.dd-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #000;
    stroke-width: 3;
}

.custom-carousel.is-transitioning .carousel-card {
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
}

.dd-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    z-index: 1055;
}

.dd-modal.show {
    display: flex;
}

.dd-dialog {
    position: relative;
    min-width: min(500px, 90vw);
    max-width: 90vw;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .12);
    /* padding: 20px 24px;*/
    transform: translateY(10px) scale(.98);
    opacity: 0;
    transition: transform 300ms ease, opacity 300ms ease;
}

.dd-dialog .dd-content {
    padding: 20px 24px;
}

.dd-modal.show .dd-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.dd-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dd-close svg {
    width: 20px;
    height: 20px;
    stroke: #6c757d;
    fill: none;
    stroke-width: 2;
}

/* ==========================================
   SERVICES SECTION
   ========================================== */

/* .services {
    padding: 80px 0;
    background-color: #ffffff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.section-header p {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
} */

.service-card {
    background-color: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative; /* Establish positioning context */
}

.service-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.service-icon {
    font-size: 40px;
}
.service-icon img {
    width: 100%;
    -webkit-border-bottom-right-radius: var(--card-radius);
    -webkit-border-bottom-left-radius: var(--card-radius);
    -moz-border-radius-bottomright: var(--card-radius);
    -moz-border-radius-bottomleft: var(--card-radius);
    border-bottom-right-radius: var(--card-radius);
    border-bottom-left-radius: var(--card-radius);    
}
.service-card-info {
    padding: 10px 20px 10px 20px;
    position: relative; /* Position context for dropdown */
}
.service-card-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.service-card-info-header h3 {
    margin-bottom: 0 !important;
}
.service-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.service-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.section-footer {
	margin-top:1rem;
    text-align: center;
}

.link-arrow {
    font-size: 16px;
    font-weight: 600;
    color: #313131;
    transition: all 0.3s ease;
}

.link-arrow:hover {
    gap: 10px;
}

.drop-down {
    position: static; /* Allow dropdown-menu to position relative to service-card */
    display: inline-block;
}

.carousel-slide .drop-down.dropdown {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.carousel-slide.is-center .drop-down.dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.dropdown-debug .carousel-slide.is-center .drop-down.dropdown {
    outline: 2px solid rgba(0, 200, 83, 0.6);
    outline-offset: 2px;
}

.drop-down .dd-btn { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    border: 2px solid #9aa0a6; 
    background: #FFF; 
    color: #000; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0; 
}
.drop-down .dd-btn:hover { background: #ccc; }
.drop-down .dd-btn svg { width: 20px; height: 20px; fill: none; stroke: #000; stroke-width: 3; }

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 50px; /* Adjust based on header height */
    right: 0;
    left: 0;
    width: auto;
    min-width: 249px;
    max-width: 100%;
    z-index: 999999999;
    padding: 8px 0;
    margin: 0;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    box-sizing: border-box;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #16181b;
    text-decoration: none;
    outline: none;
}


@container carousel-section (max-width: 1252px) {
    .carousel-controls {
        padding-inline: 16px;
    }
}

@media (min-width: 596px) {
    .carousel-section {
        --content-inline-gutter: 10px;
        --content-max-width-after-gutter: 1192px;
        --content-max-width: calc(var(--content-max-width-after-gutter) + 2 * var(--content-inline-gutter));
    }

    .custom-carousel {
        --slide-size: 50%;
        --card-scale-side: 0.9;
        --card-scale-center: 1.1;
        --card-center-lift: 0.25rem;

        min-height: 560px;
    }

    .carousel-viewport {
        padding-block: 64px;

    }
}

@media (min-width: 768px) {

    /* Tablet */
    .custom-carousel {
        --slide-size: 33.3333%;

        min-height: 480px;
    }
}

@media (min-width: 1024px) {

    /* Desktop */
    .custom-carousel {
        --slide-size: 25%;

        min-height: 400px;
    }
}

@media (orientation: landscape) {
    .carousel-img {
        aspect-ratio: 16/9;
    }
}

@media (prefers-reduced-motion: reduce) {

    .custom-carousel .carousel-container,
    .carousel-card,
    .dd-dialog,
    .dropdown-menu {
        transition-duration: 0ms;
    }
}

@media (max-width: 1024px) {

	.carousel-controls {
		display: flex;
    }
}
