/* ==========================================
   TILE GALLERY (glampi.ru style)
   ========================================== */

/* Desktop: tile grid */
.sg-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 6px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0;
}
.sg-tiles__item--main {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}
.sg-tiles__item {
    position: relative;
    overflow: hidden;
}
.sg-tiles__link {
    display: block;
    width: 100%;
    height: 100%;
}
.sg-tiles__link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}
.sg-tiles__link:hover img {
    transform: scale(1.05);
}
.sg-tiles__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    pointer-events: none;
    transition: background 0.3s;
}
.sg-tiles__link:hover .sg-tiles__more {
    background: rgba(0,0,0,0.6);
}
.sg-tiles__hidden {
    display: none;
}

/* Single photo */
.sg-tiles--single {
    grid-template-columns: 1fr;
    grid-template-rows: 400px;
}
.sg-tiles__item--solo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No photo */
.sg-tiles--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f5f5f5;
    border-radius: 16px;
}
.sg-tiles__placeholder {
    text-align: center;
    color: #bbb;
}
.sg-tiles__placeholder span {
    display: block;
    margin-top: 10px;
    font-size: 15px;
}

/* Hero without image (info takes full width) */
.sg-hero--no-image {
    display: block;
}
.sg-hero__info--full {
    width: 100%;
    padding: 24px 0 0;
}
.sg-hero__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    align-items: flex-start;
    margin-bottom: 12px;
}

/* Mobile slider (hidden on desktop) */
.sg-tiles-slider {
    display: none;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 0;
}
.sg-tiles-slider__track {
    display: flex;
    transition: transform 0.35s ease;
}
.sg-tiles-slider__slide {
    min-width: 100%;
    flex-shrink: 0;
}
.sg-tiles-slider__link {
    display: block;
}
.sg-tiles-slider__link img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}
.sg-tiles-slider__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
}
.sg-tiles-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}
.sg-tiles-slider__dot.active {
    background: #2d7f4e;
}
.sg-tiles-slider__counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ==========================================
   LIGHTBOX (improved)
   ========================================== */
.sg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.sg-lightbox.open {
    display: flex;
}
.sg-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
}
.sg-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sg-lightbox__close:hover { opacity: 1; }
.sg-lightbox__prev,
.sg-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sg-lightbox__prev { left: 16px; }
.sg-lightbox__next { right: 16px; }
.sg-lightbox__prev:hover,
.sg-lightbox__next:hover { background: rgba(255,255,255,0.25); }
.sg-lightbox__content {
    position: relative;
    z-index: 5;
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sg-lightbox__content img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
}
.sg-lightbox__counter {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    white-space: nowrap;
}

/* Thumbs strip */
.sg-lightbox__thumbs {
    position: relative;
    z-index: 5;
    display: flex;
    gap: 6px;
    margin-top: 40px;
    padding: 0 20px;
    overflow-x: auto;
    max-width: 90vw;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.sg-lightbox__thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, outline 0.2s;
    flex-shrink: 0;
    border: 2px solid transparent;
}
.sg-lightbox__thumb.active {
    opacity: 1;
    border-color: #fff;
}
.sg-lightbox__thumb:hover {
    opacity: 0.85;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .sg-tiles {
        display: none;
    }
    .sg-tiles-slider {
        display: block;
    }
    .sg-lightbox__thumbs {
        display: none;
    }
    .sg-lightbox__content img {
        max-width: 96vw;
        max-height: 80vh;
    }
    .sg-lightbox__prev,
    .sg-lightbox__next {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
    .sg-lightbox__prev { left: 8px; }
    .sg-lightbox__next { right: 8px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sg-tiles {
        grid-template-rows: 180px 180px;
    }
}

@media (min-width: 1025px) {
    .sg-tiles {
        grid-template-rows: 220px 220px;
    }
}


/* ==========================================
   INFOBAR (compact header)
   ========================================== */
.sg-infobar {
    padding: 20px 0 16px;
}

/* Row 1: Title + address inline */
.sg-infobar__top {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}
.sg-infobar__title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #1a1a1a;
}
.sg-infobar__address {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}
.sg-infobar__address svg {
    flex-shrink: 0;
}

/* Row 2: Meta + Actions */
.sg-infobar__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.sg-infobar__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.sg-infobar__rating {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sg-infobar__stars {
    display: flex;
    gap: 1px;
}
.sg-infobar__reviews {
    font-size: 13px;
    color: #888;
}
.sg-infobar__types {
    display: flex;
    gap: 4px;
}
.sg-type-badge--sm {
    font-size: 11px;
    padding: 2px 8px;
}
.sg-infobar__price {
    font-size: 15px;
    color: #333;
}
.sg-infobar__price strong {
    font-size: 17px;
    color: #1a1a1a;
}
.sg-infobar__hours {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #888;
}

/* Actions inline */
.sg-infobar__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.sg-btn--sm {
    padding: 8px 16px;
    font-size: 13px;
    gap: 5px;
}

/* Amenities row */
.sg-infobar__amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.sg-amenity-tag--sm {
    font-size: 11px;
    padding: 3px 8px;
}
.sg-amenity-tag--more {
    font-size: 11px;
    padding: 3px 8px;
    background: #e8e8e8;
    color: #666;
}

/* Separator between meta items */
.sg-infobar__meta > *:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #ddd;
    margin-left: 16px;
    vertical-align: middle;
}

/* ==========================================
   RESPONSIVE - INFOBAR
   ========================================== */
@media (max-width: 768px) {
    .sg-infobar__top {
        flex-direction: column;
        gap: 4px;
    }
    .sg-infobar__title {
        font-size: 22px;
    }
    .sg-infobar__address {
        white-space: normal;
    }
    .sg-infobar__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    .sg-infobar__meta {
        gap: 8px;
    }
    .sg-infobar__meta > *:not(:last-child)::after {
        display: none;
    }
    .sg-infobar__actions {
        width: 100%;
    }
    .sg-infobar__actions .sg-btn--sm {
        flex: 1;
        justify-content: center;
    }
}

/* Labels */
.sg-infobar__label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
