/* ============================================
   CRECHE - Sidebar + Card/Map Swap Layout
   Fixed Filters LEFT, Cards/Map RIGHT
   ============================================ */

/* Override shared main.css styles */
body.page-creche .listings-container { height: auto; overflow: visible; padding: 0; background: transparent; }
body.page-creche .listings-header,
body.page-creche .filters-row { display: none; }
body.page-creche .map-column { display: none !important; }
body.page-creche .listPage { padding: 0; }
body.page-creche .pagination-wrapper { display: none; }

/* Hide default site header on creche listing page */
body.page-creche .site-header.header-transparent { display: none; }

/* ---- Split Layout ---- */
.creche-layout {
    display: flex;
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* ---- LEFT SIDEBAR ---- */
.creche-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #526432;
    color: #fff;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.creche-sidebar::-webkit-scrollbar { width: 4px; }
.creche-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.creche-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.creche-sb-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e6f972, #b6d400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.creche-sb-icon i { color: #526432; font-size: 18px; }

.creche-sidebar-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.creche-sb-count {
    font-size: 12px;
    color: rgba(230,249,114,0.7);
    font-weight: 600;
}

/* Sidebar Filters */
.creche-sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.creche-sb-group label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(230,249,114,0.6);
    margin-bottom: 6px;
}

.creche-sb-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 9px 12px;
    transition: border-color 0.2s;
}

.creche-sb-input-wrap:focus-within {
    border-color: #e6f972;
}

.creche-sb-input-wrap i {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    flex-shrink: 0;
}

.creche-sb-input-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
    font-family: inherit;
}

.creche-sb-input-wrap input::placeholder { color: rgba(255,255,255,0.35); }

.creche-sb-group select {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 9px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    font-family: inherit;
}

.creche-sb-group select:focus { border-color: #e6f972; }
.creche-sb-group select option { background: #526432; color: #fff; }

/* Chip Filters */
.creche-sb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.creche-sb-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.creche-sb-chip:hover {
    border-color: rgba(230,249,114,0.4);
    color: #fff;
}

.creche-sb-chip:has(input:checked) {
    background: #e6f972;
    border-color: #e6f972;
    color: #526432;
}

.creche-sb-chip input {
    display: none;
}

.creche-sb-chip i {
    font-size: 10px;
}

/* Price Range Row */
.creche-sb-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.creche-sb-price-row input {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 10px;
    color: #fff;
    font-size: 12px;
    outline: none;
    width: 50%;
    font-family: inherit;
}

.creche-sb-price-row input:focus {
    border-color: #e6f972;
}

.creche-sb-price-row input::placeholder {
    color: rgba(255,255,255,0.35);
}

.creche-sb-price-row span {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}

/* Reset Button */
.creche-sb-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.creche-sb-reset-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* Active filter count badge */
.creche-sb-active-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: #e6f972;
    color: #526432;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
    margin-left: 4px;
}

/* Sidebar Actions */
.creche-sidebar-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.creche-sb-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 16px;
    background: #e6f972;
    color: #526432;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.creche-sb-add-btn:hover {
    background: #d4e85a;
    box-shadow: 0 4px 14px rgba(230,249,114,0.3);
}

/* ---- RIGHT MAIN ---- */
.creche-main {
    flex: 1;
    min-width: 0;
    background: #faf8f4;
    display: flex;
    flex-direction: column;
}

/* Main Toolbar */
.creche-main-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #f0e8d8;
    flex-shrink: 0;
}

.creche-view-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b5d45;
}

.creche-view-toggle {
    display: flex;
    gap: 0;
    background: #f5f3ee;
    border-radius: 10px;
    padding: 3px;
}

.creche-vt-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b5d45;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.creche-vt-btn.active {
    background: #526432;
    color: #e6f972;
    box-shadow: 0 2px 8px rgba(1,49,61,0.2);
}

.creche-vt-btn:not(.active):hover {
    color: #526432;
}

/* ---- Cards View ---- */
.creche-cards-view {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.creche-cards-view.hidden { display: none; }

.creche-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ---- Card ---- */
.creche-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 10px rgba(139,113,69,0.05);
}

.creche-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(139,113,69,0.12);
    border-color: #e6f972;
}

.creche-card-img {
    height: 170px;
    position: relative;
    overflow: hidden;
}

.creche-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.creche-card:hover .creche-card-img img { transform: scale(1.05); }

.creche-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.creche-badge-type {
    background: rgba(1,49,61,0.85);
    color: #e6f972;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
}

.creche-badge-verified {
    background: rgba(255,255,255,0.9);
    color: #059669;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
}

.creche-card-price {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #e6f972;
    color: #526432;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
}

.creche-card-body {
    padding: 14px 16px;
}

.creche-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #526432;
    margin: 0 0 5px;
    line-height: 1.3;
}

.creche-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.creche-card-stars i { color: #f5a623; font-size: 11px; }
.creche-card-rating-val { font-size: 13px; font-weight: 700; color: #526432; }
.creche-card-review-ct { font-size: 11px; color: #a0927a; }

.creche-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.creche-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b5d45;
}

.creche-card-meta-item i { color: #b6d400; font-size: 11px; }

.creche-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.creche-card-tag {
    background: #f5f3ee;
    color: #5a4e3a;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
}

.creche-card-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    background: #faf8f4;
    border-top: 1px solid #f0ebe0;
}

.creche-trust-chip {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #6b5d45;
}

.creche-trust-chip i { color: #b6d400; font-size: 10px; }

/* ---- Map View ---- */
.creche-map-view {
    display: none;
    flex: 1;
}

.creche-map-view.active {
    display: block;
}

.creche-map-view #map {
    width: 100%;
    height: calc(100vh - 80px - 54px);
}

/* ---- Pagination ---- */
.creche-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 0 0;
}

.creche-pg-numbers { display: flex; gap: 6px; }

.creche-pg-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #e0d8c8;
    background: #fff;
    color: #526432;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.creche-pg-btn:hover:not(:disabled) { background: #e6f972; border-color: #e6f972; }
.creche-pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.creche-pg-num {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #e0d8c8;
    background: #fff;
    color: #526432;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.creche-pg-num:hover { border-color: #b6d400; }
.creche-pg-num.active { background: #526432; color: #e6f972; border-color: #526432; }

/* ---- Loading & Empty ---- */
.creche-cards-grid .loading-state,
.creche-cards-grid .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8a7a60;
    grid-column: 1 / -1;
}

.creche-cards-grid .loading-state i { font-size: 28px; color: #b6d400; }
.creche-cards-grid .empty-state i { font-size: 40px; color: #e0d8c8; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1400px) {
    .creche-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .creche-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .creche-layout { flex-direction: column; }

    .creche-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        padding: 20px 16px;
    }

    .creche-sidebar-head { margin-bottom: 16px; padding-bottom: 14px; }
    .creche-sidebar-head h2 { font-size: 16px; }

    .creche-sidebar-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .creche-sb-group { flex: 1; min-width: 140px; }
    .creche-sidebar-actions { margin-top: 14px; }

    .creche-map-view #map { height: 50vh; }
    .creche-main-toolbar { padding: 14px 20px; }
}

@media (max-width: 767px) {
    .creche-layout { margin-top: 70px; }
    .creche-sidebar { padding: 16px 14px; }
    .creche-sidebar-head { gap: 10px; margin-bottom: 12px; padding-bottom: 12px; }
    .creche-sb-icon { width: 36px; height: 36px; }
    .creche-sb-icon i { font-size: 15px; }
    .creche-sidebar-head h2 { font-size: 15px; }
    .creche-sidebar-filters { flex-direction: column; gap: 8px; }
    .creche-sb-group { min-width: 100%; }
    .creche-sb-group label { font-size: 10px; }
    .creche-sb-select { font-size: 12px; padding: 8px 10px; }
    .creche-sb-search input { font-size: 12px; }
    .creche-cards-view { padding: 16px; }
    .creche-card-img { height: 150px; }
    .creche-card-body { padding: 12px 14px; }
    .creche-card-name { font-size: 15px; }
    .creche-card-tags { gap: 4px; }
    .creche-card-tag { font-size: 10px; padding: 2px 8px; }
    .creche-card-trust { padding: 8px 14px; }
    .creche-trust-item { font-size: 10px; }
    .creche-map-view #map { height: 40vh; }
    .creche-main-toolbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .creche-pagination { padding: 16px; gap: 6px; }
    .creche-page-num { padding: 7px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .creche-sidebar-actions .creche-add-link { font-size: 12px; padding: 8px 16px; }
    .creche-main-toolbar .creche-toolbar-label { font-size: 12px; }
}
