/* =========================================================
   Daily Local Offers - New Homepage
   Save as: assets/css/index-home.css
   ========================================================= */

.home-v2 {
    width: 100%;
}

.home-v2 .hero,
.home-v2 .search-panel,
.home-v2 .category-row,
.home-v2 .latest-simple-section,
.home-v2 .home-map-section {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

.home-v2 .hero {
    margin-top: 25px;
}

.home-v2 .search-panel {
    margin-top: 25px;
}

.home-v2 .category-row {
    margin-top: 22px;
}

.home-v2 .latest-simple-section {
    margin-top: 35px;
}

.home-v2 .home-map-section {
    margin-top: 40px;
}

/* Latest offers - deliberately NOT offer cards */
.latest-simple-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.latest-simple-item {
    background: #fff;
    border: 1px solid #e2e8e5;
    border-radius: 12px;
    padding: 16px 18px;
    min-height: 100px;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
}

.latest-store-name {
    display: block;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    margin-bottom: 5px;
    text-decoration: none;
}

.latest-offer-title {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;
    text-decoration: none;
}

.latest-offer-description {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    margin-top: 4px;
}

/* Store list */
.map-help {
    margin: -5px 0 12px;
    color: #718086;
    font-size: 13px;
}

.store-map-button {
    width: 100%;
    border: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.store-map-button:hover {
    transform: translateY(-1px);
}

.store-map-button .store-info {
    min-width: 0;
}

.store-map-button .store-name {
    display: block;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 5px;
}

.store-offer-list {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.store-offer-list span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map */
.home-map-section {
    min-height: 520px;
}

.home-map-section .map-wrap {
    position: relative;
    min-height: 520px;
}

#mapCanvas {
    width: 100%;
    min-height: 520px;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.map-search {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    border: 0;
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
    cursor: pointer;
    font-weight: 700;
}

.map-error {
    padding: 30px;
    background: #fff;
    color: #a02929;
}

/* Store popup */
.dlo-store-popup .leaflet-popup-content {
    margin: 14px;
}

.store-popup {
    font-family: inherit;
}

.popup-logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    float: right;
    margin-left: 10px;
}

.popup-store-name {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 5px;
}

.popup-rating {
    font-size: 13px;
    margin-bottom: 5px;
}

.popup-address,
.popup-distance {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 5px;
}

.popup-distance {
    font-weight: 700;
}

.popup-offers {
    border-top: 1px solid #e4e9e7;
    margin-top: 9px;
    padding-top: 8px;
}

.popup-offer {
    padding: 7px 0;
}

.popup-offer + .popup-offer {
    border-top: 1px solid #eef1f0;
}

.popup-offer-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.popup-offer-description {
    font-size: 11px;
    line-height: 1.3;
    margin-top: 2px;
}

.popup-discount {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 800;
}

.popup-no-offers {
    font-size: 12px;
    margin: 9px 0;
}

.popup-visit-store {
    display: block;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    background: #15939a;
    color: #fff !important;
}

/* Responsive */
@media (max-width: 1100px) {
    .latest-simple-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .latest-simple-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-map-section {
        grid-template-columns: 1fr;
    }

    .home-map-section .map-wrap,
    #mapCanvas {
        min-height: 450px;
    }
}

@media (max-width: 520px) {
    .latest-simple-grid {
        grid-template-columns: 1fr;
    }

    .latest-simple-item {
        min-height: auto;
    }

    .home-v2 .hero {
        margin-top: 12px;
    }

    .home-map-section .map-wrap,
    #mapCanvas {
        min-height: 380px;
    }
}
