/* ============================================================
   Ankaya Soğutma — Carousel System
   Reusable horizontal carousel for all sections
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
    outline: none;
}

.carousel-wrapper:focus-visible {
    outline: 2px solid var(--color-accent, #e8a020);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Track ───────────────────────────────────────────────── */
.carousel-track {
    display: flex;
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-track:active {
    cursor: grabbing;
}

/* ── Items ───────────────────────────────────────────────── */
.carousel-item {
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 0.625rem; /* 10px gap each side = 20px total between cards */
}

/* ── Navigation Buttons ──────────────────────────────────── */
.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.carousel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1.5px solid var(--color-primary, #1a3a5c);
    background: transparent;
    color: var(--color-primary, #1a3a5c);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
    flex-shrink: 0;
    font-size: 0.875rem;
    line-height: 1;
}

.carousel-btn:hover:not(:disabled) {
    background: var(--color-primary, #1a3a5c);
    color: #fff;
}

.carousel-btn:disabled,
.carousel-btn[aria-disabled="true"] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-btn:focus-visible {
    outline: 2px solid var(--color-accent, #e8a020);
    outline-offset: 2px;
}

/* ── Section header row with nav ─────────────────────────── */
.carousel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.carousel-header .section-header {
    margin-bottom: 0;
    text-align: left;
    flex: 1;
    min-width: 0;
}

.carousel-header .section-header .section-title {
    text-align: left;
}

/* ── Dots ────────────────────────────────────────────────── */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
}

.carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    border: none;
    background: var(--color-gray-300, #cbd5e1);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
    background: var(--color-primary, #1a3a5c);
    transform: scale(1.3);
}

.carousel-dot:focus-visible {
    outline: 2px solid var(--color-accent, #e8a020);
    outline-offset: 2px;
}

/* ── Product Cards in carousel ───────────────────────────── */
.carousel-item .product-card {
    height: 100%;
    margin: 0;
}

/* ── Service Cards in carousel ───────────────────────────── */
.carousel-item .service-card {
    height: 100%;
    margin: 0;
}

/* ── Why-Us Cards in carousel ────────────────────────────── */
.carousel-item .why-us-item {
    height: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid var(--color-gray-200, #e2e8f0);
    border-radius: var(--radius-xl, 1rem);
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
}

.carousel-item .why-us-item:hover {
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,.1));
}

/* ── Reference Cards in carousel ────────────────────────────*/
.carousel-item .reference-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--color-gray-200, #e2e8f0);
    border-radius: var(--radius-lg, 0.75rem);
    transition: box-shadow 0.2s;
}

.carousel-item .reference-item:hover {
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.08));
}

.carousel-item .reference-item img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.carousel-item .reference-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary, #1a3a5c);
    text-align: center;
}

/* ── Logo Marquee (Güvenilir Markalar) ───────────────────── */
.logo-marquee-outer {
    overflow: hidden;
    position: relative;
}

.logo-marquee-outer::before,
.logo-marquee-outer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4rem;
    z-index: 2;
    pointer-events: none;
}

.logo-marquee-outer::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg, #fff), transparent);
}

.logo-marquee-outer::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg, #fff), transparent);
}

.logo-marquee-track {
    display: flex;
    gap: 2rem;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

.logo-marquee-track:hover,
.logo-marquee-outer:hover .logo-marquee-track {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.logo-marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 160px;
    height: 80px;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--color-gray-200, #e2e8f0);
    border-radius: var(--radius-lg, 0.75rem);
}

.logo-marquee-item img {
    max-width: 100%;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-marquee-item .reference-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary, #1a3a5c);
    text-align: center;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 130px;
    line-height: 1.3;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none !important;
    }
    .logo-marquee-track {
        animation: none !important;
    }
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 639px) {
    .carousel-item {
        padding: 0 0.375rem;
    }
    .carousel-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    .carousel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .carousel-nav {
        margin-bottom: 0;
    }
}