.product-media-container {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;

  .main-image-container {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;

    .product-image {
      display: flex !important;
      justify-content: center;
      align-items: center;
      background-color: var(--muted);
      cursor: pointer;

      img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
      }
    }
  }

  .slick-dots.slick-thumb {
    position: static;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 15px;
    width: 100%;

    li {
      width: auto;
      height: auto;
      margin: 0 5px 10px;
      border-radius: 4px;
      transition: all 0.2s ease;
      opacity: 0.7;
      &:first-child {
        margin-left: 0;
      }
      button {
        padding: 0;
        font-size: 0;
        line-height: 0;
      }

      .thumbnail-wrapper {
        width: 70px;
        border: 1px solid var(--border);
        border-radius: 4px;
        padding: 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: var(--card);
        transition: all 0.3s ease;
      }

      &.slick-active {
        opacity: 1;
        transform: scale(1.05);

        .thumbnail-wrapper {
          border-color: var(--foreground);
        }
      }

      &:hover .thumbnail-wrapper {
        transform: translateY(-2px);
      }

      img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
      }
    }
  }

  .product-image-modal .slick-dots.slick-thumb {
    margin-top: 20px;

    li .thumbnail-wrapper {
      width: 60px;
    }
  }
  .product-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;

    .modal-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.7);
    }

    .modal-content {
      position: relative;
      width: 100%;
      height: 100%;
      z-index: 1001;
      background-color: black;
      overflow: hidden;

      .modal-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        z-index: 1002;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s;

        &:hover {
          background-color: rgba(0, 0, 0, 0.5);
        }
      }

      .modal-slider-container {
        width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;

        .loading-indicator {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          z-index: 1003;
          color: white;

          .spinner {
            animation: spin 1.5s linear infinite;
          }

          @keyframes spin {
            0% {
              transform: rotate(0deg);
            }
            100% {
              transform: rotate(360deg);
            }
          }
        }

        .modal-image {
          display: flex !important;
          justify-content: center;
          align-items: center;
          height: calc(100vh - 100px);

          img {
            max-width: 100%;
            max-height: 90vh;
            object-fit: contain;
          }
        }

        .slick-dots.slick-thumb {
          position: absolute;
          left: 0;
          right: 0;
          margin: 0;

          li {
            margin: 0 8px;

            .thumbnail-wrapper {
              width: 60px;
              border-color: rgba(255, 255, 255, 0.3);
              background-color: rgba(0, 0, 0, 0.3);
              border-radius: 4px;
            }

            &.slick-active .thumbnail-wrapper {
              border-color: white;
              transform: translateY(-5px);
            }

            &:hover .thumbnail-wrapper {
              border-color: rgba(255, 255, 255, 0.8);
            }
          }
        }
      }

      .slick-arrow {
        display: none !important;
      }
    }
  }

  .slick-slide {
    outline: none;
  }

  /* Structural rules formerly inherited from slick-theme.css. That import is
     gone — it shipped a 4-glyph icon font (slick.woff/.ttf) and an
     ajax-loader.gif this gallery never uses, and its `color: transparent`
     made the currentColor-stroked SVG arrows invisible. Deliberately no
     `color` here so the arrows inherit the page foreground. */
  .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 0;
  }

  /* Inside the frame — the container is overflow:hidden, so negative
     offsets clip half the button. */
  .slick-prev {
    left: 10px;
    z-index: 1;
  }

  .slick-next {
    right: 10px;
    z-index: 1;
  }

  .slick-dots {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;

    li {
      display: inline-block;
      cursor: pointer;
    }
  }
}
