

div#product {
  margin: 5px auto 2em auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  gap: 3em;
  padding: 1vw;
  max-width: 1200px;
  align-items: start;
}

/* photos: the main image, with its thumbnails in a column to its left */
div#item_gallery {
  display: flex;
  flex-flow: row nowrap;
  gap: 12px;
  align-items: flex-start;
}
div#item_image {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 700px;
}
/* clicking the photo opens it full screen; a touch screen has no zoom-in
   cursor to give that away, so this button says so */
button#photo_zoom {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #333;
  font-size: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
@media (hover: none) {
  div#item_image:has(img.main_image) button#photo_zoom {
    display: flex;
  }
}
/* the photo's space is the shape of the product's display size (set on the
   element); a file of another shape fits inside it rather than spilling out */
div#item_image img.main_image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: inherit;
  object-fit: contain;
  cursor: zoom-in;
}
div#item_thumbs {
  order: -1;
  flex: 0 0 72px;
  display: flex;
  flex-flow: column nowrap;
  gap: 8px;
}
/* a single photo needs no thumbnail */
div#item_thumbs:has(> img:only-child) {
  display: none;
}
div#item_thumbs img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
div#item_thumbs img:hover {
  border-color: #999;
}
div#item_thumbs img.current {
  border-color: #000;
}

/* name, price, and what you need to buy it */
h1#item_name {
  font-family: 'Playfair Display', serif;
  font-size: 2.25em;
  font-weight: normal;
  line-height: 1.2;
  margin: 0 0 0.25em 0;
}
div#item_price_line {
  margin: 0 0 1em 0;
}
span.item_price_span {
  font-size: 1.6em;
  color: #111;
}
span.original_price_span {
  margin-left: 0.5em;
  font-size: 1.1em;
  color: #888;
  text-decoration: line-through;
}
.sr_only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
ul#item_assurances {
  list-style: none;
  margin: 1em 0 1.5em 0;
  padding: 0;
  color: #444;
  font-size: 0.95em;
}
ul#item_assurances li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0.4em 0;
}
ul#item_assurances a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

div#item_description {
  padding: 5px 0;
}
div#item_description p {
  font-size: 15px;
  line-height: 1.6em;
}
div#item_description p.item_condition {
  font-style: italic;
  font-weight: bold;
  color: #F00;
}

div#item_action {
  padding: 5px 0;
}

/* "You may also like" and "Recently viewed" rows under the product */
section.item_row {
  max-width: 1200px;
  margin: 1em auto 2.5em auto;
  padding: 0 1vw;
}
section.item_row h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6em;
  font-weight: normal;
  margin: 0 0 0.75em 0;
}
ul.item_tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5em;
}
ul.item_tiles a {
  display: block;
  color: inherit;
  text-decoration: none;
}
ul.item_tiles img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.5em;
}
ul.item_tiles a:hover img {
  opacity: 0.85;
}
span.item_tile_name {
  display: block;
  line-height: 1.3;
}
span.item_tile_price {
  display: block;
  margin-top: 0.2em;
  color: #555;
}

div#qty_sold_out {
  padding: 0px 0px 0px 20px;
  margin: 30px 0px 5px 0px;
  color: red;
  font-weight: bold;
}
div#qty_last_one {
  padding: 0px 0px 0px 20px;
  margin: 30px 0px 5px 0px;
  color: red;
  font-weight: bold;
}
div#qty_box {
  padding: 0px 0px 0px 20px;
  margin: 5px 0px;
}
div#qty_box table {
  border: 3px solid black;
}
div#qty_box table tr th {
  border-bottom: 1px solid black;
  font-size: 12px;
  font-weight: bold;
}
div#qty_box table tr td {
  padding: 3px 15px;
  font-size: 12px;
}

div#details {
  margin: 0;
  font-size: 13px;
}

div#custom_notice {
  margin-top: 40px;
  color: #666;
  font-size: 10px;
  width: 700px;
}

.error {
  font-weight: bold;
  color: #F00;
}
td.error {
  background: #F00;
  color: #FFF;
}
td.error a {
  color: #FFF;
  text-decoration: underline;
}

.normal_item_info {
  color: #666;
  font-style: italic;
  padding-left: 20px;
}

p.country_of_origin {
  color: #666;
  font-size: 150%;
  width: 100%;
  padding: 5px;
}
p.country_of_origin img {
  position: relative;
  top: 5px;
}

/* Personalization options */
#personalization_options_container {
  margin: 1em 0;
}

.personalization-type-option {
  margin-bottom: 1em;
  padding: 0.5em;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafafa;
}

.personalization-type-option wa-switch {
  font-weight: bold;
}

.personalization-form {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding: 1em;
  margin-top: 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
}

.personalization-field {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.personalization-field label {
  font-weight: normal;
  font-size: 0.9em;
  color: #666;
}

.personalization-field label .required {
  color: #dc3545;
  font-weight: bold;
}

.personalization-field .validation-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.personalization-field input[type="text"],
.personalization-field select {
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.personalization-field input[type="text"]:focus,
.personalization-field select:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Variant selector */
#variant_selector {
  margin: 1em 0;
}

#variant_selector > label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5em;
  color: #333;
}

#variant_thumbs {
  display: flex;
  flex-flow: row nowrap;
  gap: 0.75em;
  overflow-x: auto;
  padding: 0.5em 0;
  -webkit-overflow-scrolling: touch;
}

.variant-thumb {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.5em;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 80px;
}

.variant-thumb:hover {
  border-color: #999;
}

.variant-thumb.selected {
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.variant-thumb img {
  max-width: 70px;
  max-height: 70px;
  object-fit: contain;
  margin-bottom: 0.25em;
}

.variant-thumb-label {
  font-size: 0.8em;
  text-align: center;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* one column: photos above the details, thumbnails in a row under the photo */
@media only screen and (max-width: 900px) {
  div#product {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5em;
  }
  div#item_gallery {
    flex-flow: column nowrap;
    align-items: stretch;
  }
  div#item_image {
    max-width: none;
  }
  div#item_thumbs {
    order: 0;
    flex: none;
    flex-flow: row wrap;
  }
  div#item_thumbs img {
    width: 64px;
  }
}
@media only screen and (max-width: 600px) {
  h1#item_name {
    font-size: 1.6em;
  }
  ul.item_tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1em;
  }
}
/* Stock notification form styles */
#stock-notification-form {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

#stock-notification-form h3 {
  margin-top: 0;
  color: #007cba;
  font-size: 1.2em;
}

#stock-notification-form p {
  margin-bottom: 15px;
  color: #6c757d;
  font-size: 0.9em;
}

.notification-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#notification-email {
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

#notification-email:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

#request-notification-btn {
  background-color: #007cba;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#request-notification-btn:hover:not(:disabled) {
  background-color: #0056b3;
}

#request-notification-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.notification-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
}

.notification-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.sold-out-message {
  margin-bottom: 15px;
  font-weight: bold;
  color: #dc3545;
}

@media only screen and (max-width: 600px) {
  .notification-form {
    flex-direction: column;
  }

  #notification-email {
    margin-bottom: 10px;
  }
}

