/* ===============================
   INVENTORY GALLERY LAYOUT
=============================== */

.tot-inventory-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ===============================
   MAIN IMAGE
=============================== */

.tot-gallery-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.tot-slide {
    display: none;
}

.tot-slide.is-active {
    display: block;
}

.tot-slide img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

/* ===============================
   THUMBNAILS
=============================== */

.tot-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tot-thumb {
    flex: 0 0 90px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.tot-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.tot-thumb.is-active {
    opacity: 1;
    border-color: #0073aa;
}
/* Base thumbnail reset */
.tot-gallery-thumbs .tot-thumb {
    border: none;
}

/* Active thumbnail */
.tot-gallery-thumbs .tot-thumb.is-active {
    border: none;
}

/* Active thumbnail image – bottom border only */
.tot-gallery-thumbs .tot-thumb.is-active img {
    border: none;
    border-bottom: 4px solid #d62828; /* red */
    box-sizing: border-box;
}
.tot-gallery-thumbs .tot-thumb:hover img {
    border-bottom: 4px solid rgba(214, 40, 40, 0.4);
}
/* Thumbnail container */
.tot-gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* Thumbnail box */
.tot-gallery-thumbs .tot-thumb {
    width: 110px;
    height: 80px;
    flex: 0 0 auto;
}

/* Thumbnail image */
.tot-gallery-thumbs .tot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
/* ===============================
   FULLSCREEN OVERLAY
=============================== */

.tot-gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.tot-gallery-overlay.is-open {
    display: flex;
}

.tot-gallery-overlay img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
}

/* ===============================
   ARROWS
=============================== */

.tot-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.tot-gallery-arrow:hover {
    background: rgba(0,0,0,0.8);
}

.tot-gallery-arrow.prev {
    left: 20px;
}

.tot-gallery-arrow.next {
    right: 20px;
}

/* ===============================
   CLOSE
=============================== */

.tot-gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    opacity: 0.85;
}

.tot-gallery-close:hover {
    opacity: 1;
}
/* ===============================
   MAIN IMAGE ARROWS
=============================== */

.tot-gallery-main {
    position: relative;
}

.tot-main-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    user-select: none;
    transition: background 0.2s ease;
}

.tot-main-arrow:hover {
    background: rgba(0,0,0,0.8);
}

.tot-main-arrow.prev {
    left: 14px;
}

.tot-main-arrow.next {
    right: 14px;
}
/* Elementor editor safety */
.elementor-editor-active .tot-slide {
    display: none;
}

.elementor-editor-active .tot-slide:first-child {
    display: block;
}
.tot-slide img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* ===============================
   RESPONSIVE – MOBILE IMAGE FIX
=============================== */
@media (max-width: 768px) {

  .tot-gallery-main {
    height: auto;
  }

  .tot-slide {
    height: auto;
  }

  .tot-slide img {
    height: auto;
    max-height: 70vh;
    width: 100%;
    object-fit: contain;
  }
}