/* =============================================
   CAR SHOWCASE WIDGET v1.4 – Swaggos Gems
   - Rozmery fullscreen
   - Galeria fullscreen bez overlap
   - Farby = dokonale kruhy
   - Buttony = ovalne (pill)
   ============================================= */

/* ══ WRAPPER – spolocny kontext pre oba panely ══ */
.cs-showcase-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden !important;
    border-radius: 20px !important;
    box-sizing: border-box;
    font-family: inherit;
}

/* ══════════════════════════════════════════
   PREPINAC MODOV – pill, z-index nad panelmi
══════════════════════════════════════════ */
.cs-mode-toggle {
    position: absolute;
    z-index: 100;
    top: 20px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 5px;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 999px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

/* Pozicia */
.cs-toggle-top-right  .cs-mode-toggle { right: 20px; }
.cs-toggle-top-left   .cs-mode-toggle { left:  20px; }
.cs-toggle-top-center .cs-mode-toggle {
    left: 50%;
    transform: translateX(-50%);
}

/* OVAL – pill shape tlacidla */
.cs-mode-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 999px !important;          /* oval */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #ffffff;
    color: #222222;
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: background 0.22s ease,
                color      0.22s ease,
                box-shadow 0.22s ease;
}

.cs-mode-btn:hover:not(.is-active) {
    background: rgba(0,0,0,0.06);
}

.cs-mode-btn.is-active {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 2px 14px rgba(0,0,0,0.30);
}

/* ══════════════════════════════════════════
   PANELY – spolocne
══════════════════════════════════════════ */
.cs-panel {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.cs-panel.is-active {
    display: block;
    animation: cs-fade 0.35s ease;
}

@keyframes cs-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   ROZMERY – fullscreen obrazok
══════════════════════════════════════════ */
.cs-rozmery-panel {
    position: relative;
    width: 100%;
    min-height: 480px;
    overflow: hidden;
    background: #eceef0;
    /* Ziadny padding – obrazok ide az k okrajom */
    padding: 0;
    box-sizing: border-box;
}

.cs-dim-single {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
}

/* Obrazok wrapper – fullscreen */
.cs-dim-image-wrap {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 340px;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Fullscreen obrazok */
.cs-dim-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    max-height: none !important;
    position: absolute !important;
    inset: 0 !important;
}

/* Prerushovaný ram */
.cs-dim-border {
    position: absolute;
    inset: 8px;
    border: 1.5px dashed #999999;
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

/* Zvislý rozmer */
.cs-dim-vertical {
    position: absolute;
    right: 24px;
    top: 8%;
    bottom: 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 3;
}

.cs-dim-v-line {
    flex: 1;
    width: 1.5px;
    background: #444;
    position: relative;
    min-height: 24px;
}
.cs-dim-v-line::before,
.cs-dim-v-line::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 1.5px;
    background: #444;
    left: 50%;
    transform: translateX(-50%);
}
.cs-dim-v-line::before { top: 0; }
.cs-dim-v-line::after  { bottom: 0; }

.cs-dim-v-value {
    font-size: 11px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.04em;
}

/* Horizontálne koty – overlay dole na obrazku */
.cs-dim-measurements {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 48px 20px;
    background: linear-gradient(to top, rgba(236,238,240,0.92) 60%, transparent 100%);
    box-sizing: border-box;
}

.cs-dim-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.cs-dim-arrow-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-dim-arrow-line {
    width: 100%;
    height: 1.5px;
    background: #444444;
    position: relative;
    display: block;
}

.cs-dim-arrow-line::before,
.cs-dim-arrow-line::after {
    content: '';
    position: absolute;
    width: 1.5px;
    height: 9px;
    background: #444444;
    top: 50%;
    transform: translateY(-50%);
}
.cs-dim-arrow-line::before { left: 0; }
.cs-dim-arrow-line::after  { right: 0; }

.cs-dim-value {
    font-size: 12px;
    font-weight: 600;
    color: #222222;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: nowrap;
}

/* ══════════════════════════════════════════
   GALERIA – fullscreen, ziadny overlap
══════════════════════════════════════════ */
.cs-galeria-panel {
    position: relative;
    width: 100%;
    height: 560px;
    overflow: hidden;
    background: linear-gradient(160deg, #cdd8e8 0%, #dde6f0 40%, #e8eaf0 100%);
    /* display: none je default, is-active = flex */
    display: none;
    flex-direction: column;
    box-sizing: border-box;
}

.cs-galeria-panel.is-active {
    display: flex;
    /* Galeria zaberá cely priestor – prepinac je absolutne pozicionovany navrch */
}

/* Hero obrazok */
.cs-gallery-hero {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.cs-gallery-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.45s ease,
                transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.cs-gallery-img.is-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* ── OVLADACIE PRVKY – pill kontajner dole ── */
.cs-gallery-controls {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px 26px;
    /* Galeria je fullscreen takze controls su navrch ako overlay */
}

/* Jednotny pill kontajner */
.cs-controls-pill {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px !important; /* velky oval */
    box-shadow: 0 4px 28px rgba(0,0,0,0.14);
    gap: 10px;
}

/* ══ FARBY – DOKONALE KRUHY ══ */
.cs-swatches-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.cs-swatch {
    /* Rovnake sirka aj vyska = kruh */
    width: 38px  !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    flex: 0 0 38px;                  /* nesmie sa nahatovat ani zmensovat */
    border-radius: 50% !important;   /* kruh */
    aspect-ratio: 1 / 1;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    display: block;
    box-sizing: border-box;
}

.cs-swatch:hover {
    transform: scale(1.12);
    box-shadow: 0 3px 14px rgba(0,0,0,0.32);
}

/* Aktivna farba – biely kruzok okolo */
.cs-swatch.is-active {
    transform: scale(1.10);
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 0 5px rgba(0,0,0,0.40),
        0 3px 14px rgba(0,0,0,0.22);
}

/* ── Divider ── */
.cs-controls-divider {
    width: 1px;
    height: 26px;
    background: rgba(0,0,0,0.18);
    flex-shrink: 0;
}

/* ══ POHLED TABS – OVALNE (pill) ══ */
.cs-view-tabs-row {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.cs-view-tab {
    padding: 10px 24px;
    border: none;
    border-radius: 999px !important;            /* oval */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #333;
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: background 0.22s ease,
                color      0.22s ease,
                box-shadow 0.18s ease;
}

.cs-view-tab:hover:not(.is-active) {
    background: rgba(0,0,0,0.08);
}

.cs-view-tab.is-active {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* ══════════════════════════════════════════
   RESPONZIVITA
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .cs-dim-measurements { 
        padding: 8px 16px 12px !important; 
        gap: 4px !important;
    }
    .cs-dim-vertical { right: 8px !important; }
    .cs-dim-v-value { font-size: 10px !important; }
    .cs-dim-value { font-size: 11px !important; }
}

@media (max-width: 640px) {
    .cs-rozmery-panel { min-height: 280px !important; }
    .cs-galeria-panel { height: 360px !important; }
    .cs-mode-btn { padding: 6px 16px !important; font-size: 11px !important; }
    
    /* Stack controls pill vertically on mobile for perfect fit – slightly enlarged size */
    .elementor-widget-car_showcase .cs-controls-pill,
    .cs-controls-pill {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 18px !important;
        width: auto !important;
        max-width: 95% !important;
        border-radius: 20px !important;
        position: static !important;
    }
    .cs-controls-divider { display: none !important; }
    .cs-view-tabs-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .elementor-widget-car_showcase .cs-swatch,
    .cs-swatch {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        flex: 0 0 28px !important;
    }
    .elementor-widget-car_showcase .cs-view-tab,
    .cs-view-tab {
        padding: 8px 16px !important;
        font-size: 11px !important;
    }
    .cs-dim-measurements {
        padding: 6px 10px 10px !important;
        gap: 3px !important;
    }
    .cs-dim-row {
        gap: 2px !important;
    }
    .cs-dim-value {
        font-size: 9.5px !important;
    }
    .cs-dim-arrow-line::before,
    .cs-dim-arrow-line::after {
        height: 6px !important;
    }
    .cs-dim-vertical {
        right: 4px !important;
        top: 15px !important;
        bottom: 15px !important;
    }
    .cs-dim-v-value {
        font-size: 9px !important;
    }
}

/* ══════════════════════════════════════════
   OVAL BUTTON OVERRIDES
   Prebiaju Elementor + ine pluginy
══════════════════════════════════════════ */

/* Rozmery / Galéria prepínač */
.elementor-widget-car_showcase .cs-mode-toggle,
.cs-mode-toggle {
    border-radius: 999px !important;
}

.elementor-widget-car_showcase .cs-mode-btn,
.cs-mode-btn {
    border-radius: 999px !important;
    padding: 8px 20px !important;
    font-size: 13px !important;
}

/* Pohľad spredu / Bočný pohľad */
.elementor-widget-car_showcase .cs-view-tab,
.cs-view-tab {
    border-radius: 999px !important;
    padding: 8px 18px !important;
    font-size: 12px !important;
}

/* Controls pill wrapper */
.elementor-widget-car_showcase .cs-controls-pill,
.cs-controls-pill {
    border-radius: 999px !important;
    padding: 6px 14px !important;
    gap: 12px !important;
}

/* Force perfect circles on swatches by overriding all button padding/margins */
.elementor-widget-car_showcase .cs-swatch,
.cs-swatch {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex: 0 0 28px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important;
}

.elementor-widget-car_showcase .cs-showcase-wrapper,
.cs-showcase-wrapper {
    position: relative !important;
    z-index: 1 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}


