.product-media-column {
  min-width: 0;
}

.product-main-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #e3e8e4;
  border-radius: 20px;
  background: #f4f7f5;
  box-shadow: 0 10px 30px rgba(30, 54, 39, 0.08);
}

.product-main-media > a {
  display: block;
  width: 100%;
}

.product-main-media img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 992px) {
  .product-media-column,
  .product-info-column {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
  }
}

.product-media-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.product-media-thumbnail {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e6e2;
  border-radius: 15px;
  background: #f4f7f5;
}

.product-media-thumbnail > a {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.product-media-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-delete-button {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(226, 229, 227, 0.95);
  border-radius: 10px;
  color: #d9364b;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 15px rgba(20, 29, 24, 0.16);
  cursor: pointer;
  transition: color 0.22s ease, background-color 0.22s ease,
    border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease,
    opacity 0.18s ease;
}

.media-delete-button:hover {
  border-color: #d9364b;
  color: #fff;
  background: #d94355;
  box-shadow: 0 7px 18px rgba(217, 54, 75, 0.3);
  transform: translateY(-1px);
}

.media-delete-button:focus-visible {
  outline: 3px solid rgba(217, 67, 85, 0.28);
  outline-offset: 2px;
}

.media-delete-button:disabled,
.media-delete-button.is-loading {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.additional-image-delete-button {
  top: 7px;
  right: 7px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 0.78rem;
}

.product-media-add {
  min-height: 108px;
  border: 2px dashed #b9c9bf;
  border-radius: 15px;
  color: #376146;
  background: #f5faf6;
  text-decoration: none;
}

.product-media-add .add-image-placeholder {
  display: grid !important;
  min-height: 104px;
  place-content: center;
  line-height: 1.05;
}

.product-media-add:hover {
  border-color: #5aa271;
  color: #1f743f;
  background: #ecf7ef;
}

@media (max-width: 991.98px) {
  .product-media-column {
    margin-bottom: 22px;
  }

  .product-main-media {
    border-radius: 17px;
  }
}

@media (max-width: 575.98px) {
  .product-media-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 10px;
  }

  .media-delete-button {
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
  }

  .additional-image-delete-button {
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
  }

  .product-media-add,
  .product-media-add .add-image-placeholder {
    min-height: 96px;
  }
}
