/**
 * K12 Search - Condensed Search Bar (LoveForm-style)
 * Styles for the sticky search bar and dropdown overlay
 */

/* ========================================
   Condensed Search Container
   ======================================== */

.condensed-search-container {
    position: sticky;
    top: 80px; /* Below the 80px fixed navbar */
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0; /* Reduced from 12px to match LoveForm's tighter spacing */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.condensed-search-bar {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the expanded bar */
    gap: 16px;
    max-width: 100%;
}

/* ========================================
   Search Summary Button
   ======================================== */

.search-summary-btn {
    flex: 0 1 auto; /* Size based on content, don't force full width */
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 40px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    width: fit-content; /* Expand to fit content */
    max-width: 100%; /* Don't overflow container */
}

.search-summary-btn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.search-summary-content {
    display: flex;
    align-items: center;
    gap: 0;
    /* Removed width: 100% to allow content-based sizing */
}

.search-summary-item {
    flex: 0 0 auto; /* Size based on content, no grow/shrink */
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    white-space: nowrap; /* Keep content on one line */
}

.search-summary-item:first-child {
    padding-left: 8px;
}

.summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
}

.summary-value {
    font-size: 14px;
    font-weight: 400;
    color: #717171;
    white-space: nowrap;
    /* Removed overflow: hidden and text-overflow: ellipsis to show full content */
}

.search-summary-divider {
    width: 1px;
    height: 32px;
    background: #ddd;
    flex-shrink: 0;
}

.search-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2AC8C8;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin-left: 8px;
    flex-shrink: 0;
}

.search-icon {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 4;
    fill: none;
}

/* ========================================
   Filters Button
   ======================================== */

.filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filters-btn:hover {
    border-color: #222;
}

.filter-icon {
    width: 16px;
    height: 16px;
    fill: #222;
}

/* ========================================
   Search Dropdown Overlay
   ======================================== */

.search-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Removed backdrop-filter: blur(4px) - LoveForm uses simple darkened overlay */
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 24px 24px;
    overflow-y: auto;
}

.search-dropdown-container {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

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

/* ========================================
   Dropdown Header
   ======================================== */

.search-dropdown-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.close-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-dropdown-btn:hover {
    background: #f7f7f7;
}

.close-dropdown-btn svg {
    width: 16px;
    height: 16px;
    stroke: #222;
    stroke-width: 3;
    fill: none;
}

/* ========================================
   Dropdown Content
   ======================================== */

.search-dropdown-content {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-section-label {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    color: #222;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #222;
    box-shadow: 0 0 0 1px #222;
}

.clear-input-btn {
    position: absolute;
    right: 12px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.clear-input-btn:hover {
    background: #d0d0d0;
}

.clear-input-btn svg {
    width: 12px;
    height: 12px;
    stroke: #222;
    stroke-width: 3;
    fill: none;
}

#selectedAddressDisplay {
    padding: 12px 16px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    color: #222;
}

/* ========================================
   Kids Selector
   ======================================== */

.kids-selector-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    color: #222;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kids-selector-btn:hover {
    border-color: #222;
}

.kids-dropdown {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    max-height: 300px;
    overflow-y: auto;
}

.kids-grade-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grade-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.grade-label {
    font-size: 14px;
    font-weight: 500;
    color: #222;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #222;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.counter-btn:hover {
    border-color: #222;
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-value {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #222;
}

/* ========================================
   Search Submit Button
   ======================================== */

.search-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #2AC8C8 0%, #289A96 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.search-submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(230, 30, 77, 0.3);
}

.search-submit-btn .search-icon {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 4;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .condensed-search-bar {
        flex-direction: column;
        gap: 12px;
    }

    .search-summary-btn {
        width: 100%;
    }

    .filters-btn {
        width: 100%;
        justify-content: center;
    }

    .search-summary-content {
        flex-direction: column;
        gap: 12px;
    }

    .search-summary-item {
        padding: 8px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .search-summary-item:last-of-type {
        border-bottom: none;
    }

    .search-summary-divider {
        display: none;
    }

    .search-icon-wrapper {
        margin: 0;
    }

    .search-dropdown-overlay {
        padding: 60px 16px 16px;
    }

    .search-dropdown-content {
        padding: 24px 16px;
    }

    .search-submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .condensed-search-container {
        padding: 8px 0;
    }

    .search-summary-btn {
        padding: 8px 12px;
    }

    .summary-label {
        font-size: 11px;
    }

    .summary-value {
        font-size: 13px;
    }

    .filters-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}
