/**
 * AlloDentiste Overlap Panel Accordion Widget – Stylesheet
 */

/* ============================================================
   Outer wrapper — max-width container matching other widgets
   ============================================================ */
.allo-overlap-panel-accordion-widget {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px var(--allo-gutter);
    box-sizing: border-box;
}

/* ============================================================
   Top panel — teal background
   overflow:visible so the right photo can bleed below
   ============================================================ */
.opa-panel {
    position: relative;
    background-color: #DCF0F2;
    border-radius: 20px;
    overflow: visible; /* lets panel photo bleed below */
    z-index: 1;
}

.opa-panel-inner {
    display: flex;
    align-items: flex-start; /* text col sets panel height; photo can exceed it */
    gap: 40px;
    padding: 60px 48px;
}

/* ============================================================
   Panel text column
   ============================================================ */
.opa-panel-text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.opa-heading {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.opa-body {
    margin: 0;
}

.opa-body p {
    margin: 0 0 0.75em;
    font-size: 0.9375rem;
    color: #444444;
    line-height: 1.7;
}

.opa-body p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Panel photo — bleeds below the teal panel
   margin-bottom is set by Elementor control (default -120px)
   position:relative + z-index:2 so it sits above bottom section
   ============================================================ */
.opa-panel-photo {
    flex: 0 0 auto;
    width: 44%;
    position: relative;
    z-index: 2;
    margin-bottom: -120px; /* default bleed — overridden by Elementor control */
}

.opa-panel-photo img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 16px;
    object-fit: cover;
}

/* ============================================================
   Bottom section — white background
   padding-top is set by Elementor control (default 120px)
   to match the panel photo bleed
   ============================================================ */
.opa-bottom {
    position: relative;
    z-index: 0;
    padding-top: 120px; /* default — overridden by Elementor control alongside panel photo bleed */
    padding-bottom: 20px;
}

.opa-bottom-inner {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/* ============================================================
   Lower photo — overlaps up into the panel
   margin-top is set by Elementor control (default -80px)
   ============================================================ */
.opa-lower-photo {
    flex: 0 0 auto;
    width: 38%;
    position: relative;
    z-index: 2;
    margin-top: -80px; /* default overlap — overridden by Elementor control */
}

.opa-lower-photo img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 16px;
    object-fit: cover;
}

/* ============================================================
   Accordion column
   ============================================================ */
.opa-accordion {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}

/* ============================================================
   Accordion item card
   ============================================================ */
.opa-item {
    background-color: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

.opa-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* ============================================================
   Item header (button)
   ============================================================ */
.opa-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    white-space: normal; /* buttons can inherit nowrap — force wrapping */
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.opa-item-header:hover,
.opa-item-header:focus,
.opa-item-header:focus-visible {
    background: none !important;
    box-shadow: none !important;
    outline: none;
}

/* Teal circular badge */
.opa-item-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #00A1AD; /* overridden by Elementor control */
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.opa-item-title {
    flex: 1 1 0;
    min-width: 0; /* allow shrinking below text's intrinsic width */
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}

.opa-item-chevron {
    flex-shrink: 0;
    color: #666666;
    display: flex;
    align-items: center;
    transition: transform 0.25s ease;
}

.opa-item.is-open .opa-item-chevron {
    transform: rotate(180deg);
}

/* ============================================================
   Item body — CSS grid 0fr → 1fr transition
   ============================================================ */
.opa-item-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease;
}

.opa-item-body[hidden] {
    display: grid !important; /* override browser hidden to allow transition */
    grid-template-rows: 0fr;
}

.opa-item-body-inner {
    overflow: hidden;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 0 18px 18px;
}

.opa-item-desc {
    flex: 1 1 0;
    min-width: 0;
}

.opa-item-desc p {
    margin: 0 0 0.5em;
    font-size: 0.875rem;
    color: #555555;
    line-height: 1.65;
}

.opa-item-desc p:last-child {
    margin-bottom: 0;
}

.opa-item-thumb-wrap {
    flex-shrink: 0;
    width: 100px;
}

.opa-item-thumb {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    object-fit: cover;
}

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 1024px) {
    .opa-panel-inner {
        padding: 48px 36px;
        gap: 28px;
    }

    .opa-bottom-inner {
        gap: 28px;
    }

    .opa-panel-photo {
        width: 42%;
    }

    .opa-lower-photo {
        width: 36%;
    }
}

/* ============================================================
   Responsive — mobile: stack everything vertically,
   reset all overlap margins
   ============================================================ */
@media (max-width: 768px) {
    .allo-overlap-panel-accordion-widget {
        padding: 40px var(--allo-gutter);
    }

    .opa-panel-inner {
        flex-direction: column;
        align-items: stretch; /* prevent children from shrinking to content width */
        padding: 36px 24px;
        gap: 20px;
    }

    /* Reset panel photo bleed */
    .opa-panel-photo {
        width: 100%;
        margin-bottom: 0 !important;
    }

    /* Reset bottom padding and lower photo overlap */
    .opa-bottom {
        padding-top: 24px !important;
    }

    .opa-lower-photo {
        width: 100%;
        margin-top: 0 !important;
    }

    .opa-bottom-inner {
        flex-direction: column;
        align-items: stretch; /* accordion and photo both stretch to full width */
        gap: 20px;
    }

    .opa-accordion {
        width: 100%; /* explicit full width in column layout */
    }
}
