/* ========== HIDE TAG FILTER BAR ========== */
#filterBar {
    display: none !important;
}

/* ========== BANNER IMAGE – square on mobile, widescreen with height limit ========== */
.banner-container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 0.75rem;
}

.banner-image-wrapper {
    width: 100%;
    max-height: 400px;           /* limit height on all screens */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-image-wrapper img {
    width: 100%;
    height: auto;                /* maintain aspect ratio */
    max-height: 400px;           /* same as container */
    object-fit: contain;         /* show full image without cropping */
    display: block;
}

@media (min-width: 768px) {
    .banner-image-wrapper {
        max-height: 500px;       /* slightly taller on desktop */
    }
    .banner-image-wrapper img {
        max-height: 500px;
    }
}

/* ========== VIEW TOGGLE BUTTONS (icons) ========== */
.view-toggle .view-btn {
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
    border-radius: 8px;
}
.view-toggle .view-btn.active {
    opacity: 1;
    background: var(--primary-red);
    border-radius: 8px;
}
.view-toggle .view-btn img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ========== STORE GRID ========== */
.stores-grid {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 0.75rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}
@media (min-width: 480px) {
    .stores-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .stores-grid { grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
}

/* ========== STORE CARD ========== */
.store-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    align-self: flex-start;
}
.store-card:active { transform: scale(0.98); }
@media (hover: hover) {
    .store-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 20px -8px rgba(0,0,0,0.15);
    }
}

/* ========== CARD IMAGE (1:1) ========== */
.card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== CARD CONTENT ========== */
.card-content { 
    padding: 1rem;
    flex: 1 0 auto;            /* takes remaining space, top‑aligned */
    width: 100%;  
}
.store-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.store-name small {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--text-light);
}
.store-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}
.tag {
    background: var(--tag-bg);
    color: var(--primary-red);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    font-weight: 500;
}
.tag.category-tag {
    background: var(--primary-red);
    color: white;
    font-weight: 600;
}
.store-desc {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
}
.member-info {
    font-size: 0.75rem;
    color: var(--primary-red);
    margin-top: 0.5rem;
    border-top: 1px solid #eef2ff;
    padding-top: 0.5rem;
}

/* ========== LIST VIEW OVERRIDE ========== */
.stores-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}
.store-card.list-view {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}
.store-card.list-view .card-img {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    padding: 0; /* remove padding so image fills the box */
    background: #f1f5f9;
    overflow: hidden;
}
.store-card.list-view .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill the box, crop if needed */
}
.store-card.list-view .card-content {
    flex: 1;
    padding: 0;
}
.store-card.list-view .store-name { font-size: 1.1rem; }
@media (max-width: 640px) {
    .store-card.list-view {
        flex-direction: column;
        text-align: center;
    }
    .store-card.list-view .card-img { margin: 0 auto; }
}

/* ========== MAP SECTION ========== */
.map-section {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 0.75rem;
}
.map-section h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}
.map-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid var(--border-light);
}
.map-container iframe {
    width: 100%;
    height: 300px;
    border: 0;
    display: block;
}
@media (min-width: 768px) {
    .map-container iframe { height: 400px; }
}

/* ========== CATEGORY FILTER ========== */
.category-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.category-filter label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.category-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.category-btn {
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.7;
    white-space: nowrap;
}
.category-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.category-btn.active {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .category-filter {
        justify-content: center;
        width: 100%;
    }
}


/* ========== MOBILE OVERRIDES ========== */
@media (max-width: 640px) {
    /* Grid view on mobile: 3 columns, only images */
    .stores-grid:not(.list-view) .store-card .card-content {
        display: none; /* hide all content */
    }
    .stores-grid:not(.list-view) .store-card {
        aspect-ratio: 1 / 1;
        padding: 0.25rem;
        background: transparent;
        box-shadow: none;
        border-radius: 8px;
        overflow: hidden;
    }
    .stores-grid:not(.list-view) .card-img {
        padding: 0;
        border-radius: 8px;
        background: #ffffff;
    }
    .stores-grid:not(.list-view) .card-img img {
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
    }
    .stores-grid:not(.list-view) {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    /* List view on mobile: revert to normal grid (with all details) */
    .stores-grid.list-view {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 0.8rem;
    }
    .stores-grid.list-view .store-card {
        display: block;
        flex-direction: column;
        padding: 0;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border-radius: 16px;
        overflow: hidden;
        aspect-ratio: auto;
    }
    .stores-grid.list-view .store-card .card-img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        padding: 0.5rem;
        background: #ffffff;
    }
    .stores-grid.list-view .store-card .card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        max-width: 100%;
        max-height: 100%;
    }
    .stores-grid.list-view .store-card .card-content {
        display: block;
        padding: 0.5rem;
    }
    .stores-grid.list-view .store-card .store-name {
        font-size: 0.85rem;
        font-weight: 600;
    }
    .stores-grid.list-view .store-card .store-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    .stores-grid.list-view .store-card .tag {
        font-size: 0.825rem;
        padding: 0.15rem 0.6rem;
    }
    .stores-grid.list-view .store-card .store-desc {
        display: block;
        font-size: .8rem;
        margin: 0.2rem 0;
    }
    .stores-grid.list-view .store-card .member-info {
        display: block;
        font-size: 1rem;
        padding-top: 0.2rem;
        margin-top: 0.2rem;
    }

    .stores-grid.list-view .store-card .store-name {
        display: block;
        font-size: 1rem;
        padding-top: 0.2rem;
        margin-top: 0.2rem;
    }

    .stores-grid.list-view .store-card .store-desc {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-height: none !important;
        display: block !important;
    }
}
