/* =========================================================
   CouponsHaven - Stores Page
   ========================================================= */

/* ---------------------------------------------------------
   Page
   --------------------------------------------------------- */

.stores-page {
    padding: 28px 0 50px;
    margin-bottom: 50px;
}

.stores-page .section-heading {
    position: relative;
    margin-bottom: 30px;
}

.stores-page-title-row {
    position: static;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stores-page-title-row h1 {
    margin: 0;
    color: #111827;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
}

.stores-page-count {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

.stores-page .section-heading p {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   Store Page Search
   --------------------------------------------------------- */

.stores-page-search {
    position: absolute;
    top: 18px;
    right: 0;
    width: 300px;
    z-index: 50;
}

.stores-page-search-form {
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 9px;
    background: #ffffff;
    overflow: hidden;
}

.stores-page-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #222;
    font-size: 14px;
}

.stores-page-search-input::placeholder {
    color: #888;
}

.stores-page-search-button {
    height: 32px;
    margin-right: 4px;
    padding: 0 13px;
    border: 0;
    border-radius: 7px;
    background: #f97316;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.stores-page-search-button:hover {
    background: #ea580c;
}

.stores-page-search-button:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Search Suggestions */

.stores-page-search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    padding: 5px;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 1000;
}

.stores-page-search-suggestions.is-visible {
    display: block;
}

.stores-page-search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 6px 9px;
    box-sizing: border-box;
    color: #202124;
    text-decoration: none;
    background: #ffffff;
    border-radius: 8px;
}

.stores-page-search-suggestion:hover,
.stores-page-search-suggestion.is-highlighted {
    background: #f7f7f7;
}

.stores-page-search-suggestion:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.stores-page-search-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e8;
    border-radius: 7px;
    background: #ffffff;
    overflow: hidden;
}

.stores-page-search-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.stores-page-search-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-align: center;
}

.stores-page-search-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.stores-page-search-name {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stores-page-search-offers {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    color: #777;
}

.stores-page-search-empty {
    padding: 10px 12px;
    color: #666;
    font-size: 13px;
}

/* ---------------------------------------------------------
   Alphabet Filter
   --------------------------------------------------------- */

.stores-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 28px;
    white-space: nowrap;
}

.stores-filter-button {
    min-width: 34px;
    padding: 7px 8px;
    border: 1px solid #f97316;
    border-radius: 8px;
    background: #ffffff;
    color: #ea580c;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.stores-filter-button:hover,
.stores-filter-button.active {
    background: #f97316;
    border-color: #f97316;
    color: #ffffff;
}

.stores-filter-button:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

.store-tile.store-filter-hidden {
    display: none;
}

/* ---------------------------------------------------------
   Stores Grid
   --------------------------------------------------------- */

.stores-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* ---------------------------------------------------------
   Store Tile
   --------------------------------------------------------- */

.store-tile {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.store-tile:hover {
    transform: translateY(-2px);
    border-color: #fdba74;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.07);
}

.store-tile-link {
    display: flex;
    align-items: center;
    min-height: 112px;
    padding: 14px;
    color: inherit;
    text-decoration: none;
}

.store-tile-link:hover {
    color: inherit;
    text-decoration: none;
}

.store-tile-link:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

/* ---------------------------------------------------------
   Store Logo
   --------------------------------------------------------- */

.store-tile-logo {
    flex: 0 0 78px;
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 9px;
    overflow: hidden;
}

.store-tile-logo img {
    max-width: 66px;
    max-height: 58px;
    object-fit: contain;
}

.store-tile-placeholder {
    padding: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
}

/* ---------------------------------------------------------
   Store Information
   --------------------------------------------------------- */

.store-tile-info {
    flex: 1;
    min-width: 0;
    margin-left: 14px;
}

.store-tile-info h2 {
    display: -webkit-box;
    margin: 0 0 5px;
    color: #111827;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 750;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-tile-info p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

/* ---------------------------------------------------------
   Store Arrow
   --------------------------------------------------------- */

.store-tile-arrow {
    flex: 0 0 auto;
    margin-left: 8px;
    color: #f97316;
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.store-tile:hover .store-tile-arrow {
    color: #ea580c;
    transform: translateX(3px);
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1200px) {

    .stores-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .stores-page {
        padding: 22px 0 40px;
    }

    .stores-page-title-row {
        flex-wrap: wrap;
    }

    .stores-page-search {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 10px;
    }

    .stores-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stores-filter-bar {
        flex-wrap: wrap;
        gap: 6px;
        white-space: normal;
    }

    .stores-filter-button {
        min-width: 34px;
        padding: 7px 9px;
        font-size: 13px;
    }

    .store-tile-link {
        min-height: 100px;
        padding: 12px 10px 12px 12px;
    }

    .store-tile-logo {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .store-tile-logo img {
        max-width: 54px;
        max-height: 48px;
    }

    .store-tile-info {
        margin-left: 10px;
    }

    .store-tile-info h2 {
        font-size: 14px;
    }

    .store-tile-arrow {
        margin-left: 5px;
        font-size: 18px;
    }

}

@media (max-width: 450px) {

    .stores-grid {
        grid-template-columns: 1fr;
    }

    .store-tile-link {
        min-height: 96px;
    }

}


/* =========================================================
   Popular 10 Stores — compact logo + name tiles
   ========================================================= */

.popular-stores-section {
    margin: 0 0 34px;
}

.popular-stores-heading {
    margin-bottom: 15px !important;
}

.popular-stores-heading h2 {
    margin: 0 0 5px;
    color: #111827;
    font-size: 23px;
    line-height: 1.25;
    font-weight: 800;
}

.popular-stores-heading p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.popular-stores-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
}

.popular-store-tile {
    display: flex;
    min-width: 0;
    min-height: 124px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 13px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    text-align: center;
    text-decoration: none;
    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.popular-store-tile:hover {
    transform: translateY(-2px);
    border-color: #fdba74;
    box-shadow: 0 6px 18px rgba(17, 24, 39, .07);
    color: #111827;
    text-decoration: none;
}

.popular-store-tile:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

.popular-store-logo {
    display: flex;
    width: 100%;
    height: 66px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.popular-store-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 62px;
    object-fit: contain;
}

.popular-store-placeholder {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.popular-store-name {
    display: block;
    width: 100%;
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .popular-stores-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 700px) {
    .popular-stores-section {
        margin-bottom: 27px;
    }

    .popular-stores-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .popular-store-tile {
        min-height: 112px;
        padding: 10px 8px;
    }

    .popular-store-logo {
        height: 60px;
    }

    .popular-store-logo img {
        max-height: 56px;
    }

    .popular-store-name {
        font-size: 12px;
    }
}


/* Smaller Popular 10 Stores tiles — approximately 70% of previous size */
.popular-stores-grid {
    gap: 10px;
}

.popular-store-tile {
    min-height: 87px;
    gap: 6px;
    padding: 8px 7px;
    border-radius: 8px;
}

.popular-store-logo {
    height: 46px;
}

.popular-store-logo img {
    max-height: 44px;
}

.popular-store-name {
    font-size: 11px;
    line-height: 1.2;
}

@media (max-width: 700px) {
    .popular-stores-grid {
        gap: 8px;
    }

    .popular-store-tile {
        min-height: 82px;
        gap: 5px;
        padding: 7px 6px;
    }

    .popular-store-logo {
        height: 43px;
    }

    .popular-store-logo img {
        max-height: 41px;
    }

    .popular-store-name {
        font-size: 10px;
    }
}
