.agp-grid-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.agp-background-image {
    width: 100%;
    height: auto;
    display: block;
    z-index: 1;
}

.agp-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

.agp-grid-square {
    position: absolute;
    border: 1px solid rgba(0,0,0,0.2);
    box-sizing: border-box;
    pointer-events: none;
    background-color: transparent;
}

/* Специальные стили для забронированных клеток */
.agp-grid-square[data-state="booked"] {
    background-color: #F44336;
}

/* Адаптивность */
@media (max-width: 768px) {
    .agp-grid-wrapper {
        transform: scale(0.85);
        transform-origin: top left;
    }
}

@media (max-width: 480px) {
    .agp-grid-wrapper {
        transform: scale(0.65);
        transform-origin: top left;
    }
}

/* Обеспечение правильного масштабирования */
.agp-grid-wrapper {
    overflow: hidden;
}

/* Для адаптивности - сохраняем соотношение сторон */
.agp-grid-wrapper img {
    max-width: 100%;
    height: auto;
}

/* Сетка должна масштабироваться вместе с изображением */
.agp-grid-overlay {
    transform: scale(1);
    transform-origin: top left;
}

/* При изменении размера экрана */
@media screen and (max-width: 1024px) {
    .agp-grid-wrapper {
        width: 100%;
    }
}
