.inventoryItemMain {
  display: flex;
  flex-direction: column;
  border: 2px solid black;
  width: 300px;
  min-width: 300px;
  height: 370px;
  min-height: 370px;
  margin: 0.5em;
  background-color: var(--secondary_background_color);
  position: relative;
  overflow: hidden;
}

.inventoryItemHeader {
  display: flex;
  /* background-color: var(--secondary_darkest_background_color); */
  width: -webkit-fill-available;
  height: 30px;
  flex-direction: column;
  position: relative;
}

.inventoryItemHeader strong {
  font-weight: bold;
  font-size: calc(var(--min-font-size) + 4px);
  text-align: center;
  /* color: var(--primary_txt_color); */
}

.inventoryItemFirstImage {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.miniImageDisplay {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  cursor: pointer;
}

.miniImageDisplay img {
  position: relative;
  /* max-height: 150px !important; */
  max-width: 150px;
  height: 200px;
  width: auto;
  object-fit: cover;
  border: 1px solid var(--secondary_txt_color);
  border-radius: 4px;
  background-color: var(--secondary_darker_background_color);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.miniImageDisplay img.loaded {
  opacity: 1;
}

.miniImageDisplay img.loaded:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.miniImageDisplay:focus-within img {
  outline: 2px solid var(--primary_accent_color);
  outline-offset: 2px;
}

.miniImageDisplay img.spinner {
  width: 30px;
  height: 30px;
  max-width: 30px;
  cursor: default;
  opacity: 1;
  transition: none;
}

.miniImageDisplay img.noimage {
  width: 150px;
  height: 200px;
  object-fit: contain;
  background-color: var(--secondary_darker_background_color);
  border: 2px dashed var(--secondary_txt_color);
  opacity: 0.6;
}

.miniImageSpinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 200px;
  background-color: var(--secondary_darker_background_color);
  transition: opacity 0.3s ease;
}

.inventoryItemDislayFirstImage {
  position: relative;
  margin-bottom: 1em;
}
.inventoryItemDislayFirstImage img {
  height: inherit;
  width: auto;
  margin-bottom: 1em;
  cursor: pointer;
}

.inventoryItemOptions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1em;
  position: relative;
}

.inventoryItemOptions button[id*="addToInterests_"],
.inventoryItemOptions button[id*="contactUs_"],
.inventoryItemOptions button[id^="nextImage_"],
.inventoryItemOptions button[id^="PrevImage_"],
.inventoryItemOptions button {
  font-size: calc(var(--min-font-size) + 17px);
  margin-bottom: 0.5em;
  cursor: pointer;
}

.inventoryItemOptionsChosen {
  border: 3px solid yellow;
}

.inventoryItemOptionsReserved {
  border: 3px solid orange;
}

.inventoryItemOptionsExpired {
  border: 3px solid red;
}

.inventoryItemDetails {
  padding: 0.5em;
  position: relative;
}

.inventoryItemDetails article {
  color: var(--primary_txt_color);
  font-size: calc(var(--min-font-size) + 3px);
}

.inventoryItemDetails button,
.inventoryItemDetails a,
.inventoryItemDetails p {
  color: var(--secondary_txt_color);
  font-size: calc(var(--min-font-size) + 3px);
}

.inventoryItemDetails p#reserved {
  cursor: pointer;
}


.inventoryItemAllImage {
  margin-top: 0.5em;
  display: flex;
  flex-direction: row;
  gap: 0.5em;
  overflow-x: auto;
  align-items: center;
}

.inventoryItemAllImage img {
  cursor: pointer;
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--secondary_txt_color);
  background: var(--secondary_darker_background_color);
  transition: box-shadow 0.2s;
}

.inventoryItemAllImage img:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.inventoryItemAllImage img {
  cursor: pointer;
  width: 50px;
}

.insectsListDiv {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.insectsListDiv a {
  color: var(--secondary_txt_color);
  font-size: calc(var(--min-font-size) + 2px);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  padding: 0.1em 0;
}

.insectsListDiv a:hover {
  color: #1976d2;
  text-decoration: underline;
}

* {
  box-sizing: border-box;
}

#price {
  background-image: linear-gradient(to right, #fdbef5, #ffffff);
}


/* Inventory Detail Modal View - Matches Species Modal Design */
.inventoryDetailView {
  width: 100%;
}

.inventoryDetailView .miniImageDisplay {
  width: 100%;
  margin: 0 auto 2em auto;
  text-align: center;
  min-height: 400px;
}

.inventoryDetailView .carousel {
  width: 100%;
  height: auto;
  min-height: 400px;
  visibility: visible !important;
  opacity: 1 !important;
}

.inventoryDetailView .carousel img {
  visibility: visible !important;
  opacity: 1 !important;
}

.inventoryDetailView .carousel-cell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.inventoryDetailView .carousel-cell img {
  max-width: 100%;
  max-height: 500px;
  height: auto;
  width: auto;
}

/* Carousel navigation buttons */
.inventoryDetailView .flickity-button {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.inventoryDetailView .flickity-button:hover {
  background: white;
}

.inventoryDetailView .flickity-button:active {
  opacity: 0.7;
}

/* Page dots */
.inventoryDetailView .flickity-page-dots {
  bottom: 10px;
}

.inventoryDetailView .flickity-page-dots .dot {
  width: 12px;
  height: 12px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.inventoryDetailView .flickity-page-dots .dot.is-selected {
  background: white;
  border-color: rgba(0, 0, 0, 0.5);
}

/* Section headers */
.inventoryDetailView h3 {
  font-size: 1.2rem;
  margin: 0 0 1em 0;
}

.inventoryDetailView section {
  margin-bottom: 2em;
}

.inventoryDetailView .grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  grid-gap: 0.5em 1.5em;
  align-items: baseline;
}

.inventoryDetailView article {
  font-weight: 600;
  color: #555;
}

.inventoryDetailView p {
  margin: 0;
  color: var(--secondary_txt_color);
}

/* Mobile responsiveness for inventory modal */
@media (max-width: 767px) {
  .inventoryDetailView {
    padding: 0.75em;
  }

  .inventoryDetailView h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75em;
  }

  .inventoryDetailView section {
    margin-bottom: 1.5em;
  }

  .inventoryDetailView .grid {
    grid-template-columns: auto 1fr;
    gap: 0.5em 1em;
    font-size: 0.9rem;
  }

  .inventoryDetailView article {
    font-size: 0.85rem;
  }

  .inventoryDetailView p {
    font-size: 0.85rem;
  }

  .inventoryDetailView .carousel-cell {
    min-height: 250px;
  }

  .inventoryDetailView .carousel-cell img {
    max-height: 300px;
  }

  /* No images message mobile adjustment */
  .no-images-message {
    min-height: 300px !important;
    padding: 1.5em !important;
  }

  .no-images-message div {
    font-size: 3em !important;
  }

  .no-images-message h3 {
    font-size: 1.2em !important;
  }

  .no-images-message p {
    font-size: 0.9em !important;
  }

  /* Touch-friendly modal buttons */
  .ui-dialog .ui-button {
    min-height: 44px;
    padding: 0.75em 1em;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .inventoryDetailView h3 {
    font-size: 1rem;
    padding-bottom: 0.35em;
    margin-bottom: 0.5em;
  }

  .inventoryDetailView section {
    margin-bottom: 1em;
  }

  .inventoryDetailView .grid {
    font-size: 0.85rem;
    gap: 0.35em 0.75em;
  }

  .inventoryDetailView article {
    font-size: 0.8rem;
  }

  .inventoryDetailView p {
    font-size: 0.8rem;
  }

  .inventoryDetailView .carousel-cell {
    min-height: 200px;
  }

  .inventoryDetailView .carousel-cell img {
    max-height: 250px;
  }
}

@media (max-width: 374px) {
  .inventoryDetailView {
    padding: 0.35em;
  }

  .inventoryDetailView h3 {
    font-size: 0.9rem;
    padding-bottom: 0.3em;
    margin-bottom: 0.4em;
  }

  .inventoryDetailView section {
    margin-bottom: 0.75em;
  }

  .inventoryDetailView .grid {
    font-size: 0.8rem;
    gap: 0.25em 0.5em;
  }

  .inventoryDetailView article {
    font-size: 0.75rem;
  }

  .inventoryDetailView p {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .inventoryDetailView .miniImageDisplay {
    margin-bottom: 0.75em;
  }

  .inventoryDetailView .carousel-cell {
    min-height: 180px;
  }

  .inventoryDetailView .carousel-cell img {
    max-height: 200px;
  }
}

/* Landscape mode adjustments for inventory modal */
@media (max-height: 500px) and (orientation: landscape) {
  .inventoryDetailView .carousel-cell {
    min-height: 150px !important;
  }

  .inventoryDetailView .carousel-cell img {
    max-height: 180px !important;
  }

  .inventoryDetailView section {
    margin-bottom: 0.75em;
  }
}

/* Contact Us Button in Modal */
.ui-dialog button#contactUsButton {
  background-color: #2196F3;
  border-color: #1976D2;
  color: white;
  transition: all 0.3s ease;
}

.ui-dialog button#contactUsButton:hover {
  background-color: #1E88E5;
  border-color: #1565C0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Add to Interests Button in Modal */
.ui-dialog button#addToInterestsButton {
  background-color: #e91e63;
  border-color: #c2185b;
  color: white;
  transition: all 0.3s ease;
}

.ui-dialog button#addToInterestsButton:hover:not(:disabled) {
  background-color: #d81b60;
  border-color: #ad1457;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

/* Remove from Interests state - orange/amber color */
.ui-dialog button#addToInterestsButton.remove-state {
  background-color: #ff9800;
  border-color: #f57c00;
}

.ui-dialog button#addToInterestsButton.remove-state:hover {
  background-color: #fb8c00;
  border-color: #ef6c00;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.ui-dialog button#addToInterestsButton:disabled {
  background-color: #81c784;
  border-color: #66bb6a;
  color: white;
  opacity: 1;
  cursor: not-allowed;
}

.ui-dialog button#addToInterestsButton .ui-icon-heart {
  background-position: -160px -192px;
}
