/* =========================================
   1. LAYOUT OVERRIDES (Fixes Landing Conflict)
   ========================================= */

/* Force 90% Width on Store Containers */
body .page-width-90,
body .container {
    width: 90% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 0 20px 0 !important;
}

/* =========================================
   2. COMPACT NAVBAR (Your Code)
   ========================================= */
.compact-navbar {
    width: 100%;
    height: 70px;
    background-color: #2c0e38 !important;
    color: white;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.nav-right { justify-self: start; display: flex; align-items: center; }
.nav-right img { height: 45px; width: auto; transition: transform 0.2s; }
.nav-right img:hover { transform: scale(1.05); }

.nav-center { justify-self: center; white-space: nowrap; }
.page-title { margin: 0; font-size: 1.4rem; font-weight: 800; color: #fff; }

.nav-left { justify-self: end; }
.back-link { color: rgba(255,255,255,0.8); font-size: 0.9rem; font-weight: bold; text-decoration: none; padding: 5px 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; transition: 0.2s; }
.back-link:hover { background: rgba(255,255,255,0.1); color: #fff; }

@media (max-width: 600px) {
    .compact-navbar { height: 60px; padding: 0 10px; }
    .nav-right img { height: 35px; }
    .page-title { font-size: 1.1rem; }
}

/* =========================================
   3. MAP SECTION (60vh / 70vh)
   ========================================= */
.map-wrapper {
    position: relative;
    margin-top: 20px;
}

#main-map {
    width: 100%;
    height: 40vh; /* Desktop Height */
    background: #e0e0e0;
    border-radius: 12px;
    border-bottom: 1px solid #ccc;
    z-index: 1;
    direction: ltr;
}

@media (max-width: 768px) {
    #main-map {
        height: 70vh; /* Mobile Height */
    }
}

/* Map Popup */
.ol-popup {
    position: absolute; background-color: white; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    padding: 10px; border-radius: 10px; border: 1px solid #cccccc; bottom: 12px; min-width: 200px;
    text-align: center; font-family: 'Tajawal'; direction: rtl;
}
.ol-popup:after, .ol-popup:before { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; }
.ol-popup:after { border-top-color: white; border-width: 10px; left: 50%; margin-left: -10px; }
.ol-popup:before { border-top-color: #cccccc; border-width: 11px; left: 50%; margin-left: -11px; }

/* =========================================
   4. SEARCH BAR (Floating)
   ========================================= */
.search-wrapper {
    margin-top: -45px;
    margin-bottom: 50px;
    position: relative;
    z-index: 50;
    padding: 0 20px;
}

.search-container {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 10px;
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    gap: 10px;
}

.locate-btn { background: transparent; border: none; border-left: 1px solid #eee; padding: 0 20px; height: 50px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8f3f99; min-width: 100px; transition: 0.2s; }
.locate-btn:hover { background-color: #f9f0fa; }
.locate-icon { font-size: 1.4rem; margin-bottom: 2px; }

.search-group { flex: 1; padding: 5px 20px; border-left: 1px solid #eee; display: flex; flex-direction: column; }
.search-group:last-of-type { border-left: none; }
.search-input, .search-select { width: 100%; border: none; background: transparent; font-family: 'Tajawal'; font-size: 0.95rem; color: #555; outline: none; }

.search-btn { background-color: #8f3f99; color: #fff; width: 50px; height: 50px; border-radius: 12px; border: none; font-size: 1.2rem; cursor: pointer; flex-shrink: 0; margin-right: 10px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.search-btn:hover { background-color: #722f7a; transform: scale(1.05); }

@media (max-width: 992px) {
    .search-container { flex-direction: column; height: auto; padding: 20px; }
    .search-group { width: 100%; border-left: none; border-bottom: 1px solid #eee; padding: 10px 0; }
    .locate-btn { width: 100%; border-left: none; border-bottom: 1px solid #eee; padding: 15px; flex-direction: row; gap: 10px; }
    .search-btn { width: 100%; margin-top: 10px; }
}

/* =========================================
   5. GRID SYSTEM (Strict 4 Cols)
   ========================================= */

/* IMPORTANT: This specific class overrides the landing.css !important rule */
.store-products-grid {
    display: grid;
    /* Forces exactly 4 columns */
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px;
    width: 100%;
}

/* Responsive Breakpoints */
@media (max-width: 1400px) {
    .store-products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 992px) {
    .store-products-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
    .store-products-grid { grid-template-columns: 1fr !important; }
}

/* =========================================
   6. PRODUCT CARD & BADGES
   ========================================= */
.product-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid #eee;
    transition: transform 0.2s; display: flex; flex-direction: column; height: 100%;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(143, 63, 153, 0.15); }

.product-image-container { position: relative; height: 180px; width: 100%; }
.product-img { width: 100%; height: 100%; object-fit: cover; }

.product-details { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; text-align: right; gap: 8px; }
.product-title { margin: 0 0 5px 0; font-size: 1.1rem; font-weight: 800; color: #2c0e38; }
.product-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.9rem; color: #666; font-weight: 600; margin-top: auto; }
.meta-item { display: flex; align-items: center; gap: 5px; }

/* Badges */
.hall-type-badge { padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.badge-closed { background-color: #f3e5f5; color: #8f3f99; border: 1px solid #e1bee7; }
.badge-open { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.price-badge { position: absolute; bottom: 10px; right: 10px; background: rgba(255, 255, 255, 0.9); color: #333; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Loader */
.ajax-load { grid-column: 1 / -1; text-align: center; padding: 20px; display: none; color: #888; font-weight: bold; margin-top: 30px; }
