.ath-room-gallery {
  width: 100%;
  padding-block: var(--ath-gallery-pad-y, clamp(2rem, 1.25rem + 3.5vw, 4.5rem));
  transition: width 0.3s ease, margin 0.3s ease;
}

.ath-room-gallery__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  flex-wrap: wrap;
}
.ath-room-gallery__heading { flex: 1 1 auto; }
.ath-room-gallery__eyebrow {
  font-size: clamp(0.62rem, 0.55rem + 0.2vw, 0.75rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  opacity: 0.85;
}
.ath-room-gallery__title {
  font-size: clamp(1.8rem, 1rem + 3vw, 3.25rem);
  line-height: 1.05;
  margin: 0;
  font-weight: 400;
}
.ath-room-gallery__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ath-room-gallery__cta:hover { opacity: 0.9; transform: translateY(-2px); }
.ath-room-gallery__cta-arrow { font-size: 1.1em; line-height: 1; }

.ath-room-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--ath-gallery-gap, 24px);
  width: 100%;
}

.ath-room-gallery__cell {
  position: relative;
  overflow: hidden;
  border-radius: var(--ath-gallery-radius, 24px);
  cursor: pointer;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
  aspect-ratio: 1 / 1;
}
.ath-room-gallery__cell[data-pos="0"] {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
}

.ath-room-gallery__img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.ath-room-gallery__cell:hover .ath-room-gallery__img {
  transform: scale(1.06);
}

.ath-room-gallery__modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
}
.ath-room-gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
}
.ath-room-gallery__modal-content {
  position: relative;
  width: min(90vw, 140vh);
  aspect-ratio: 3 / 2;
  z-index: 2;
}
.ath-room-gallery__modal-content .ath-room-gallery__cell {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  grid-column: unset;
  grid-row: unset;
  cursor: zoom-out;
}


.ath-room-gallery__close,
.ath-room-gallery__nav {
  position: fixed !important;
  z-index: 10000 !important;
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  color: #fff !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1.4rem !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: background 0.2s ease !important;
}
.ath-room-gallery__close:hover,
.ath-room-gallery__nav:hover { background: rgba(255,255,255,0.28) !important; }

.ath-room-gallery__close { top: clamp(1rem,3vh,2rem) !important; right: clamp(1rem,3vw,2rem) !important; bottom: auto !important; left: auto !important; transform: none !important; }
.ath-room-gallery__nav--prev { left: clamp(1rem,3vw,2rem) !important; top: 50% !important; transform: translateY(-50%) !important; right: auto !important; bottom: auto !important; }
.ath-room-gallery__nav--next { right: clamp(1rem,3vw,2rem) !important; top: 50% !important; transform: translateY(-50%) !important; left: auto !important; bottom: auto !important; }

@media (min-width: 1025px) {
  .ath-room-gallery:has([data-pos="5"]) {
    width: calc(100% + 20%);
    margin-left: -10%;
  }
  .ath-room-gallery__grid {
    grid-template-columns: 874fr 233fr 233fr;
    grid-template-rows: calc((100% - var(--ath-gallery-gap, 24px)) / 2) calc((100% - var(--ath-gallery-gap, 24px)) / 2);
    height: var(--ath-gallery-height, 492px);
  }
  .ath-room-gallery__grid:has([data-pos="5"]) {
    grid-template-columns: 874fr 233fr 233fr 233fr;
  }
  .ath-room-gallery__cell { aspect-ratio: auto; }
  .ath-room-gallery__cell[data-pos="0"] { grid-column: 1; grid-row: 1 / 3; aspect-ratio: auto; }
  .ath-room-gallery__cell[data-pos="1"] { grid-column: 2; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="2"] { grid-column: 3; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="3"] { grid-column: 2; grid-row: 2; }
  .ath-room-gallery__cell[data-pos="4"] { grid-column: 3; grid-row: 2; }
  .ath-room-gallery__cell[data-pos="5"] { grid-column: 4; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="6"] { grid-column: 4; grid-row: 2; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .ath-room-gallery__grid {
    grid-template-columns: 2.5fr 1fr 1fr;
    grid-template-rows: calc((100% - var(--ath-gallery-gap, 24px)) / 2) calc((100% - var(--ath-gallery-gap, 24px)) / 2);
    height: clamp(300px, 45vw, 450px);
  }
  .ath-room-gallery__cell { aspect-ratio: auto; }
  .ath-room-gallery__cell[data-pos="0"] { grid-column: 1; grid-row: 1 / 3; aspect-ratio: auto; }
  .ath-room-gallery__cell[data-pos="1"] { grid-column: 2; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="2"] { grid-column: 3; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="3"] { grid-column: 2; grid-row: 2; }
  .ath-room-gallery__cell[data-pos="4"] { grid-column: 3; grid-row: 2; }

  .ath-room-gallery__grid:has([data-pos="5"]) {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    height: auto !important;
  }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell {
    aspect-ratio: 1 / 1 !important;
  }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="0"] {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    aspect-ratio: 16 / 7 !important; 
  }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="1"] { grid-column: 1 !important; grid-row: 2 !important; }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="2"] { grid-column: 2 !important; grid-row: 2 !important; }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="3"] { grid-column: 3 !important; grid-row: 2 !important; }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="4"] { grid-column: 1 !important; grid-row: 3 !important; }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="5"] { grid-column: 2 !important; grid-row: 3 !important; }
  .ath-room-gallery__grid:has([data-pos="5"]) .ath-room-gallery__cell[data-pos="6"] { grid-column: 3 !important; grid-row: 3 !important; }
}

@media (max-width: 767px) {
  .ath-room-gallery__header { flex-direction: column; gap: 1rem; }
  .ath-room-gallery__cta { align-self: flex-start; }
  .ath-room-gallery__modal-content {
    width: 92vw;
    aspect-ratio: 4 / 3;
  }
  .ath-room-gallery__nav { width: 40px !important; height: 40px !important; font-size: 1.1rem !important; }
  
  .ath-room-gallery__cell[data-pos="0"] { grid-column: 1 / -1; grid-row: 1; }
  .ath-room-gallery__cell[data-pos="1"] { grid-column: 1; grid-row: 2; }
  .ath-room-gallery__cell[data-pos="2"] { grid-column: 2; grid-row: 2; }
  .ath-room-gallery__cell[data-pos="3"] { grid-column: 1; grid-row: 3; }
  .ath-room-gallery__cell[data-pos="4"] { grid-column: 2; grid-row: 3; }
  .ath-room-gallery__cell[data-pos="5"] { grid-column: 1; grid-row: 4; }
  .ath-room-gallery__cell[data-pos="6"] { grid-column: 2; grid-row: 4; }
}

.elementor-widget-atheria_room_gallery.elementor-invisible {
  visibility: visible !important;
}
.ath-js-ready .ath-room-gallery__grid.ath-stagger[data-ath-stagger-auto] > * {
  animation: ath-gal-fs 0.01s linear 2.5s forwards;
}
@keyframes ath-gal-fs { to { opacity: 1; transform: none; } }

body.elementor-editor-active .ath-room-gallery { min-height: 200px; }


/* Η ΟΡΙΣΤΙΚΗ ΛΥΣΗ ΓΙΑ ΤΟ ΚΕΝΟ ΚΑΙ ΤΟ ΚΟΛΛΗΜΑ ΚΑΤΩ ΣΤΟ MOBILE */
.e-con:has(.ath-room-gallery),
.e-con-inner:has(.ath-room-gallery) {
  height: auto !important;
  min-height: 0 !important;
  align-content: flex-start !important;
  justify-content: flex-start !important;
}

.elementor-widget-atheria_room_gallery {
  height: auto !important;
  width: 100% !important;
  align-self: flex-start !important;
  margin-top: 0 !important;
  /* Το μαγικό τρικ: Σπρώχνει όλο το widget στην κορυφή του Section! */
  margin-bottom: auto !important; 
}

.elementor-widget-atheria_room_gallery > .elementor-widget-container {
  height: auto !important;
}
