/* File: /css/accordion.css */

/* ========================================= */
/* 1. SHARED SEARCH INPUT DESIGN             */
/* ========================================= */
.clinic-accordion-search {
    width: 100%;
    /* Keep right padding to prevent text overlap with the icon */
    padding: 10px 40px 10px 0;
    margin-bottom: 40px;

    border: none;
    border-bottom: 1px solid #eaeaea;
    border-radius: 0;

    font-size: 18px;
    font-family: inherit;
    color: #111;
    background-color: transparent;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 18px;

    transition: border-color 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.clinic-accordion-search::placeholder {
    color: #999;
    font-weight: 600;
}

.clinic-accordion-search:focus {
    border-bottom: 1px solid #111;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

/* =========================================
   2. SHARED CATEGORY & ANIMATED ICON
   ========================================= */
.clinic-accordion-title {
    font-size: 22px;
}

.clinic-accordion-item {
    margin-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
    background: #fff;
}

.clinic-accordion-item summary {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-radius: 4px;
    transition: background-color 0.2s ease;

    position: relative;
    z-index: 2; /* Keeps the summary and its border ABOVE the sliding content */
}

/* Hide default browser arrow */
.clinic-accordion-item summary::-webkit-details-marker {
    display: none;
}

/* The Animated Icon Container */
.clinic-icon {
    display: block; /* Forced block to prevent theme overrides */
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-left: 15px;
}

/* Creating the '+' using two overlapping lines */
.clinic-icon::before,
.clinic-icon::after {
    content: '';
    position: absolute;
    background-color: #333;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    margin-top: -1px; /* Centers the 2px height */
    transition: transform 0.35s ease-in-out;
    border-radius: 2px;
}

/* Vertical line of the plus */
.clinic-icon::after {
    transform: rotate(90deg);
}

/* =========================================
   3. OPEN STATE & SLIDE DOWN ANIMATION
   ========================================= */
.clinic-accordion-item[open] {
    /* Change border to transparent to remove it without layout jumping */
    border-bottom-color: transparent;
}

.clinic-accordion-item[open] summary {
    /* Remove the line under the open title */
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Morph '+' to '-' smoothly */
.clinic-accordion-item[open] .clinic-icon::before {
    transform: rotate(180deg);
}

.clinic-accordion-item[open] .clinic-icon::after {
    transform: rotate(180deg) scaleX(0);
}

/* Slide Down Reveal Effect */
.clinic-accordion-item[open] .clinic-accordion-inner {
    animation: clinicSlideDown 0.35s ease-out;
}

@keyframes clinicSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   4. SHARED INTERNAL CONTENT AREA
   ========================================= */
.clinic-accordion-inner {
    padding: 20px 25px 30px 25px;
    background: #F6F8FA; /* Restores the grey background */
    border-radius: 12px;
    position: relative;
    z-index: 1; /* Keeps the animating content BELOW the summary border */
}

/* =========================================
   5. PRICING SPECIFIC STYLES
   ========================================= */
.clinic-sub-block {
    margin-top: 35px;
}

.clinic-sub-block:first-child {
    margin-top: 0;
}

.clinic-sub-title {
    font-size: 16px;
    font-weight: 800;
    color: #111;
    margin-bottom: 15px;
}

.clinic-row {
    display: flex;
    align-items: flex-end;
    padding: 12px 0;
    width: 100%; /* Ensures flexbox spans entire container */
}

.clinic-name {
    font-weight: 700;
    font-size: 15px;
    color: #222;
    padding-right: 15px;
    max-width: 75%;
    line-height: 1.4;
}

.clinic-dots {
    flex-grow: 1;
    border-bottom: 2px dotted #ccc;
    position: relative;
    top: -5px;
    opacity: 0.6;
    margin: 0 10px; /* Prevents dots from gluing to the text */
}

.clinic-price {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    padding-left: 15px;
    white-space: nowrap;
}

/* =========================================
   6. FAQ SPECIFIC STYLES
   ========================================= */
.faq-content {
    line-height: 1.6;
    color: #444;
    font-size: 16px;
}

.faq-content p {
    margin-bottom: 15px;
}

.faq-content p:last-child {
    margin-bottom: 0;
}

/* =========================================
   7. MOBILE ADAPTATION
   ========================================= */
@media (max-width: 768px) {
    .clinic-accordion-search {
        width: 100%;
    }

    .clinic-accordion-item {
        margin-left: -25px;
        margin-right: -25px;
    }

    .clinic-accordion-item summary {
        padding: 15px 25px;
        font-size: 16px;
    }

    .clinic-accordion-title {
        font-size: 18px;
    }

    .clinic-sub-title {
        padding-left: 25px;
        padding-right: 25px;
    }

    .clinic-accordion-inner {
        padding: 15px 0 0 0;
        border-radius: 0;
    }

    .faq-content.clinic-accordion-inner {
        padding: 15px 25px;
    }

    .article .clinic-accordion-inner {
        margin-left: -25px;
        margin-right: -25px;
    }

    /* Pricing specific mobile adjustments */
    .clinic-row {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px dashed #eee;
        padding-bottom: 12px;
        padding-left: 25px;
        padding-right: 25px;
    }

    .clinic-dots {
        display: none;
    }

    .clinic-price {
        padding-left: 0;
        margin-top: 6px;
    }
}