/* ============================================================
   Docente Winery Slider — styles
   Units: rem everywhere · px only in media queries
   ============================================================ */

/* ── Elementor container — allow heading to overflow upward ── */
.elementor-widget-docente_wine_slider,
.elementor-widget-docente_wine_slider .elementor-widget-container {
    overflow: visible !important;
}

/* ── Wrapper ──────────────────────────────────────────────── */
.dws-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    padding-bottom: 3rem;
}

/* ── Viewport (holds arrows + track container) ────────────── */
.dws-viewport {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* ── Track container (clips the track) ───────────────────── */
.dws-track-container {
    overflow: hidden;
    width: 100%;
    padding: 2rem 0;
}

/* ── Track (flex row of slides) ──────────────────────────── */
.dws-track {
    display: flex;
    align-items: center;
    will-change: transform;
    user-select: none;
}

/* ── Individual slide ─────────────────────────────────────── */
.dws-slide {
    flex: 0 0 auto;
    width: 30rem;
    height: 29rem;
    padding: 0 0.75rem;
    box-sizing: border-box;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.84);
    opacity: 1;
    cursor: pointer;
}

.dws-slide.is-active {
    transform: scale(1.1);
    opacity: 1;
    cursor: default;
}

/* ── Slide inner (background image + content flex) ─────────── */
.dws-slide__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 0.375rem;
    overflow: hidden;
    height: 100%;
    padding: 2rem 1.75rem;
    box-sizing: border-box;
    position: relative;
}

/* ── Bottle (absolute) ────────────────────────────────────── */
.dws-slide__bottle {
    position: absolute;
    left: 2.5rem;
    top: 2rem;
    max-width: 80%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1;
}

.dws-slide__bottle img {
    display: block;
    width: auto;
    height: auto;
    max-height: 24rem;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0.25rem 0.75rem rgba(0,0,0,0.22));
}

/* ── Info panel ───────────────────────────────────────────── */
.dws-slide__info {
    max-width: 12rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    right: 4.5rem;
    top: -1.5rem;
    z-index: 2;
}

/* ── Wine name (name + year as one heading) ───────────────── */
.dws-wine-headline {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.dws-wine-name {
    display: block;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 2.3rem;
    font-weight: 500;
    line-height: 1;
    margin: 0;
    color: #4A0D17;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ── Wine size ────────────────────────────────────────────── */
.dws-wine-size {
    font-family: "Barlow Condensed", sans-serif;
    color: #000;
    font-weight: 500;
    letter-spacing: 0.06em;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: baseline;
    gap: 0;
}

.dws-size-num {
    font-size: 0.85rem;
}

.dws-size-unit {
    font-size: 0.6rem;
    text-transform: lowercase;
}

/* ── Appellation ──────────────────────────────────────────── */
.dws-appellation {
    margin: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: capitalize;
    color: #000;
    line-height: 0.8rem;
}

/* ── Description ──────────────────────────────────────────── */
.dws-description {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-size: 0.65rem;
    line-height: 1rem;
    color: #000;
}

/* ── Learn More button ────────────────────────────────────── */
.dws-learn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    padding: 0.25rem 1rem;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 0.25rem;
    min-width: 6.5rem;
    text-align: center;
}

.dws-learn-btn:hover,
.dws-learn-btn:focus,
.dws-learn-btn:visited {
    color: #fff;
    text-decoration: none;
    opacity: 1;
    filter: none;
}

/* Mobile bottle hidden above 767px; desktop bottle always shown */
.dws-bottle--mobile { display: none !important; }

/* ── Navigation arrows ────────────────────────────────────── */
.dws-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 0.125rem solid rgba(90,58,26,0.45);
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(0.25rem);
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.dws-arrow:hover {
    background: rgba(255,255,255,0.85);
    border-color: rgba(90,58,26,0.8);
    transform: scale(1.06);
}

.dws-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: #4a2c10;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

/* ── More Wines button ────────────────────────────────────── */
.dws-more-wines {
    text-align: center;
    margin-top: 1.5rem;
}

.dws-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    padding: 1rem 2.25rem;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    min-width: 9rem;
    text-align: center;
    transition: opacity 0.2s ease;
}

.dws-more-btn:hover,
.dws-more-btn:visited,
.dws-more-btn:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* ── Reversed layout (bottle right / text left) ──────────── */
.dws-slide--reversed .dws-slide__inner {
    justify-content: flex-start;
}

.dws-slide--reversed .dws-slide__bottle {
    left: auto;
    right: 1.5rem;
}

.dws-slide--reversed .dws-slide__info {
    right: auto;
    left: 3.5rem;
    top: 4.5rem;
    max-width: 14rem;
}

/* ── Reversed & Custom — smaller wine name ────────────────── */
.dws-slide--reversed .dws-wine-name,
.dws-slide--custom .dws-wine-name {
    font-size: 1.7rem;
}

/* ── "Our Wines" decorated heading ───────────────────────── */
.dws-heading-area {
    position: absolute;
    top: -7.5rem;
    right: 4%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    pointer-events: none;
}

.decorated-heading {
    font-family: "Beneath The Silence", cursive;
    font-weight: 400;
    font-size: 6rem;
    line-height: 4rem;
    color: #fff;
    display: block;
}

.dws-wrapper .decorated-heading::after {
    content: '';
    display: block;
    width: 100%;
    height: 2rem;
    background-image: url('../images/slider-our-wines-graphic-decoration.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    margin-top: 0.5rem;
}

.dws-arrow-word-deco {
    display: block;
    position: relative;
    width: 4rem;
    height: auto;
    left: -29%;
    margin-top: -5.5rem;
    align-self: flex-start;
}

.decorated-heading-white {
    position: relative;
    top: -0.5rem;
    left: -4%;
}

/* ── Floating decorative arrows ───────────────────────────── */
.dws-arrow-deco {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    display: block;
}

.dws-arrow-deco--down {
    left: 26%;
    top: 1rem;
    width: 5.5rem;
    height: auto;
}

.dws-arrow-deco--up {
    left: 26%;
    bottom: 8.5rem;
    width: 5.5rem;
    height: auto;
}

/* ============================================================
   Responsive — slide reverts to stacked on mobile
   ============================================================ */

@media (max-width: 900px) {
    .dws-slide {
        width: 26rem;
        height: 25rem;
    }

    .dws-wine-name {
        font-size: 2.4rem;
    }
}

@media (max-width: 700px) {
    .dws-slide {
        width: 22rem;
        height: 22rem;
    }

    .dws-slide__info {
        right: 5rem;
        max-width: 10rem;
    }

    .dws-wine-name {
        font-size: 2rem;
    }
}

/* Stack layout on small screens */
@media (max-width: 540px) {
    .dws-slide {
        width: 18rem;
        height: auto;
    }

    .dws-slide__inner {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 1.25rem 1rem 1.5rem;
        height: auto;
        min-height: 22rem;
    }

    .dws-slide__bottle {
        position: relative;
        left: auto;
        top: auto;
        max-width: 60%;
        margin: 0 auto 1rem;
        justify-content: center;
    }

    .dws-slide__bottle img {
        max-height: 12rem;
    }

    .dws-slide__info {
        position: relative;
        right: auto;
        top: auto;
        max-width: 100%;
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .dws-wine-name {
        font-size: 2rem;
    }

    .dws-wine-size,
    .dws-appellation {
        justify-content: center;
    }

    .dws-learn-btn {
        align-self: center;
    }

    .dws-arrow {
        width: 2.25rem;
        height: 2.25rem;
    }

    .dws-arrow svg {
        width: 1rem;
        height: 1rem;
    }
}

@media (max-width: 400px) {
    .dws-slide {
        width: 16rem;
    }

    .dws-wine-name {
        font-size: 1.75rem;
    }
}

/* 320px minimum */
@media (max-width: 340px) {
    .dws-slide {
        width: 14rem;
        padding: 0 0.4rem;
    }

    .dws-description {
        font-size: 0.6rem;
    }

    .dws-arrow {
        width: 1.9rem;
        height: 1.9rem;
    }
}

/* ============================================================
   Tablet 768px–1024px: hide side slides, keep desktop sizes
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .dws-slide:not(.is-active) {
        visibility: hidden;
    }
}

/* ============================================================
   Single-slide mode — 767px and below only
   • Side slides hidden, arrows hidden, active slide fills width
   • Tablets (768px+) use normal desktop slider
   ============================================================ */
@media (max-width: 767px) {
    /* Hide arrows */
    .dws-arrow { display: none; }

    /* Hide decorative arrows and heading — too small to look right */
    .dws-arrow-deco,
    .dws-heading-area { display: none; }

    /* Full-width square, no scale, no padding gap */
    .dws-slide {
        width: 100vw;
        height: auto;
        aspect-ratio: 1 / 1;
        padding: 0;
        transform: scale(1);
    }

    .dws-slide.is-active {
        transform: scale(1);
    }

    /* Collapse side slides — keep in DOM so JS positioning still works */
    .dws-slide:not(.is-active) {
        visibility: hidden;
    }

    /* Edge-to-edge inner, restore horizontal layout (undo 540px stack) */
    .dws-slide__inner {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        padding: 2rem 1.5rem;
        height: 100%;
        min-height: unset;
        border-radius: 0;
        box-sizing: border-box;
    }

    /* Restore bottle to absolute positioning (undo 540px relative) */
    .dws-slide__bottle {
        position: absolute;
        left: 5vw;
        top: 8vw;
        max-width: 42%;
        margin: 0;
        justify-content: center;
    }

    .dws-slide__bottle img {
        max-height: 78vw;
        max-width: 100%;
    }

    /* Restore info panel (undo 540px full-width centered) */
    .dws-slide__info {
        position: relative;
        right: 4vw;
        top: 0;
        left: auto;
        max-width: 38%;
        width: 100%;
        align-items: flex-start;
        text-align: left;
        gap: 1vw;
    }

    .dws-wine-name {
        font-size: clamp(1.4rem, 5vw, 2.3rem);
    }

    .dws-wine-size {
        justify-content: flex-start;
    }

    .dws-size-num  { font-size: clamp(0.7rem, 1.4vw, 0.85rem); }
    .dws-size-unit { font-size: clamp(0.5rem, 1vw, 0.6rem); }

    .dws-appellation {
        justify-content: flex-start;
        font-size: clamp(0.55rem, 1.1vw, 0.7rem);
        line-height: 1.3;
    }

    .dws-description {
        font-size: clamp(0.5rem, 1vw, 0.65rem);
        line-height: clamp(0.8rem, 1.6vw, 1rem);
    }

    .dws-learn-btn {
        align-self: flex-start;
        font-size: clamp(0.6rem, 1.2vw, 0.8rem);
        padding: clamp(0.2rem, 0.4vw, 0.25rem) clamp(0.6rem, 1.5vw, 1rem);
        min-width: clamp(5rem, 10vw, 6.5rem);
    }
}

/* ============================================================
   Mobile stacked layout — 767px and below
   Order: title/appellation → bottle image → description
   Uses display:contents on .dws-slide__info so its children
   (.dws-slide__header, .dws-slide__desc) participate directly
   in the parent flex order alongside .dws-slide__bottle.
   ============================================================ */
@media (max-width: 767px) {
    /* Solid background — no slide image on mobile */
    .dws-slide__inner {
        background-image: none !important;
        background-color: #e6d9c6;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 2rem 2.5rem;
        gap: 1rem;
        aspect-ratio: unset;
        height: auto;
        min-height: unset;
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Bottle: back in normal flow, centered — !important beats custom inline styles */
    .dws-slide__bottle {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        max-width: 80%;
        margin: 0 auto;
        justify-content: center;
        order: 2;
    }

    .dws-slide__bottle img {
        max-height: 18rem;
        max-width: 100%;
    }

    /* Swap bottle images on mobile */
    .dws-slide__bottle .dws-bottle--desktop { display: none !important; }
    .dws-slide__bottle .dws-bottle--mobile  { display: block !important; margin: 0 auto; }

    /* Override square from 1024px block */
    .dws-slide {
        aspect-ratio: unset;
        height: auto;
    }

    /* Info wrapper becomes transparent — !important beats custom inline styles */
    .dws-slide__info {
        display: contents !important;
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        max-width: none !important;
    }

    /* Header (title + appellation): order 1 — above bottle */
    .dws-slide__header {
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1vw;
        width: 100%;
    }

    /* Desc (description + button): order 3 — below bottle */
    .dws-slide__desc {
        order: 3;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2vw;
        width: 100%;
    }

    .dws-wine-headline {
        justify-content: center;
        flex-wrap: wrap;
    }

    .dws-wine-name {
        font-size: 2rem;
        text-align: center;
    }

    .dws-wine-size {
        justify-content: center;
    }

    .dws-size-num  { font-size: 1.5rem; }
    .dws-size-unit { font-size: 1.1rem; }

    .dws-appellation {
        text-align: center;
        justify-content: center;
        font-size: 1.1rem;
        line-height: 1.4;
        letter-spacing: 0rem;
    }

    .dws-description {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: center;
    }

    .dws-learn-btn {
        align-self: center;
        font-size: 1rem;
        padding: 0.4rem 1.5rem;
        min-width: 8rem;
    }
}

