/* BISMALLAH ETHIOBIZ MAGALA SHOP RESPONSIVE HIGH-CONTRAST CSS */
:root {
    --magala-primary: #0d9488;
    --magala-primary-hover: #0f766e;
    --magala-bg-card: #ffffff;
    --magala-border: #e2e8f0;
    --magala-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    --magala-text-dark: #0f172a;
    --magala-text-muted: #64748b;
}

.magala-shop-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 16px;
    background: #f8fafc;
    min-height: 85vh;
}

/* SEARCH HERO */
.magala-search-hero {
    margin-bottom: 20px;
    position: relative;
}

.magala-search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    outline: none;
    color: #0f172a;
}

.btn-geo {
    background: rgba(13, 148, 136, 0.12);
    color: var(--magala-primary);
    border: 1px solid var(--magala-primary);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-geo:hover {
    background: var(--magala-primary);
    color: #fff;
}

/* VIEW TOGGLE */
.magala-view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.view-btn {
    border: none;
    background: transparent;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}
.view-btn.active {
    background: var(--magala-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* CATEGORY BAR */
.magala-category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: none;
}
.magala-category-bar::-webkit-scrollbar { display: none; }

.cat-pill {
    white-space: nowrap;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 8px 18px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.cat-pill.active, .cat-pill:hover {
    background: var(--magala-primary);
    color: #fff;
    border-color: var(--magala-primary);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

/* LAYOUT & COLLAPSIBLE SIDEBAR */
.magala-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magala-layout.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0px;
}

.magala-sidebar {
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

.magala-sidebar.collapsed {
    opacity: 0;
    transform: translateX(-30px);
    pointer-events: none;
    width: 0;
    padding: 0;
    margin: 0;
}

.btn-toggle-filters {
    background: rgba(31, 182, 174, 0.12);
    border: 1px solid rgba(31, 182, 174, 0.4);
    color: var(--magala-primary);
    padding: 6px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-toggle-filters:hover {
    background: var(--magala-primary);
    color: #fff;
}

@media (max-width: 992px) {
    .magala-layout {
        grid-template-columns: 1fr;
    }
    .magala-sidebar {
        display: none;
    }
    .magala-sidebar.mobile-open {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(15px);
        z-index: 999;
        padding: 20px;
        overflow-y: auto;
    }
}

/* SIDEBAR FILTER CARD */
.filter-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.filter-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.filter-group {
    margin-bottom: 20px;
}
.filter-title {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    color: #334155;
    margin-bottom: 8px;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.price-inputs input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.95rem;
}

/* RESULTS BAR */
.results-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.btn-open-map-portal {
    font-weight: 700;
    color: var(--magala-primary);
    text-decoration: none;
    font-size: 0.92rem;
}

/* PRODUCT GRID VIEW */
.magala-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* PRODUCT CARD */
.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
    border-color: #0d9488;
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: rgba(0,0,0,0.03);
    overflow: hidden;
}
.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-info-box {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-seller-badge {
    font-size: 0.8rem;
    color: var(--magala-text-muted);
    margin-bottom: 4px;
}
.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-rating {
    color: #f59e0b;
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
}
.price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--magala-primary);
}
.btn-add-cart {
    background: var(--magala-primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-add-cart:hover {
    background: var(--magala-primary-hover);
}

/* LIST VIEW ROW */
.magala-list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.product-list-row {
    display: grid;
    grid-template-columns: 180px 1fr 240px;
    gap: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}
.product-list-row:hover {
    border-color: #0d9488;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
@media (max-width: 768px) {
    .product-list-row {
        grid-template-columns: 1fr;
    }
}

/* EMBEDDED MAP VIEW */
.embedded-leaflet-map {
    width: 100%;
    height: 600px;
    border-radius: 16px;
    border: 1px solid var(--magala-border);
}

/* CART DRAWER */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: -8px 0 32px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}
.cart-drawer.open {
    right: 0;
}
.cart-drawer-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.cart-drawer-footer {
    padding: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}
.btn-checkout-primary {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--magala-primary);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 10px;
}
