/* Gallery grid layout - works without Slick */

/* Desktop: main image left (2fr), thumbnails right (1fr) */
.haway-gallery {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 20px !important;
    overflow: hidden;
}

.haway-gallery__hero-image {
    overflow: hidden;
    border-radius: 10px;
}

.haway-gallery__hero-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.haway-gallery__side {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    overflow: hidden;
}

.haway-gallery__thumb {
    overflow: hidden;
    border-radius: 10px;
    position: relative;
}

.haway-gallery__thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* Mobile: stack hero above thumbnails */
@media (max-width: 768px) {
    .haway-gallery {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .haway-gallery__hero-image {
        height: 280px;
    }

    /* 4-column row: 3 photo thumbnails + 1 counter slot */
    .haway-gallery__side {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        height: 90px;
        overflow: visible !important;
    }

    /* All thumbs: clip images properly */
    .haway-gallery__thumb {
        overflow: hidden;
        border-radius: 8px;
    }

    /* 4th thumb: hide the photo, show only the counter */
    .haway-gallery__thumb:nth-child(4) img {
        display: none !important;
    }

    .haway-gallery__thumb:nth-child(4) {
        background: rgba(0,0,0,0.07) !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Position the counter to fill its thumb slot */
    .haway-gallery__thumb:nth-child(4) .haway-more-photos {
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        background: white !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        padding: 4px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        margin: 0 !important;
        bottom: auto !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Popup modal */
.haway-popup.active {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 99999 !important;
}