.product-list {
  margin-top: 24px;
  display: grid;
  gap: 18px;

  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));

  align-items: stretch;
}

.product-card {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  font-family: var(--font-accent);
  font-style: italic;
}

.product-image {
  margin: 0;
  width: 100%;
  aspect-ratio: 1 / 1;

  overflow: hidden;
  border-radius: 10px;
  background: #f7f7f7;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.product-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;

  /* clamp to keep tiles uniform */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proudct-name {
    font-family: var(--font-accent);
}

.product-price {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #444;
  font-family: var(--font-accent);
}

.product-description {
  margin: 0;
  color: #333;
  font-size: 13px;
  line-height: 1.35;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-cta {
  margin-top: auto;
  display: inline-block;
  padding: 10px 12px;

  border: 1px solid #ddd;
  border-radius: 10px;

  text-decoration: none;
  color: inherit;
  font-size: 14px;
  text-align: center;

  background: #fff;
}

.product-cta:hover {
  border-color: #bbb;
}

@media (max-width: 520px) {
  .product-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .product-card {
    padding: 10px;
  }

  .product-title {
    font-size: 14px;
  }
}


/* CAROUSEL CSS */
.carousel {
  max-width: 720px;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #f7f7f7;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 220ms ease-in-out;
  pointer-events: none;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.carousel-viewport .carousel-slide:first-of-type {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.carousel-slide:target {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.carousel:has(.carousel-slide:target)
  .carousel-viewport
  .carousel-slide:first-of-type:not(:target) {
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.carousel-nav {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 10px 0 0;
  margin: 0;
}

.carousel-nav a {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;

  border: 1px solid #ddd;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}

.carousel-nav a:hover {
  border-color: #bbb;
}

.carousel-nav a.is-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.carousel-nav a:focus,
.carousel-nav a:active,
.carousel-nav a:focus-visible {
  background: #000;
  color: #fff;
  border-color: #000;
  outline: 2px solid #000;
  outline-offset: 2px;
}

.back-link {
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 32px;
  align-items: start;
}

.product-purchase {
  display: grid;
  gap: 16px;
}

.product-detail-description {
  margin: 0;
  color: #333;
  line-height: 1.55;
}

.product-order-form {
  display: grid;
  gap: 14px;
}

.option-group {
  border: 0;
  padding: 0;
  margin: 0;
}

.option-group legend,
.field-label {
  display: block;
  margin: 0 0 8px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-options label {
  min-width: 0;
}

.segmented-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-options span,
.product-order-form select,
.product-order-form input[type="number"] {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font: inherit;
}

.product-order-form select,
.product-order-form input[type="number"] {
  justify-content: flex-start;
  padding: 0 12px;
}

.segmented-options input:checked + span {
  border-color: #111;
  background: #111;
  color: #fff;
}

.product-order-form button {
  min-height: 44px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.product-order-form button:disabled {
  border-color: #bbb;
  background: #ddd;
  color: #666;
  cursor: not-allowed;
}

.variant-meta {
  margin: 0;
  color: #666;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.order-page {
  display: grid;
  gap: 20px;
  max-width: 860px;
}

.order-lines {
  display: grid;
  gap: 12px;
}

.order-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
}

.order-line-image {
  display: block;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 6px;
  background: #f2f2f2;
}

.order-line-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-line h2,
.order-line p {
  margin: 0;
}

.order-line h2 {
  font-size: 18px;
}

.order-line h2 a {
  color: inherit;
  text-decoration: none;
}

.order-line h2 a:hover {
  text-decoration: underline;
}

.order-line-summary {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  font-size: 18px;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #555;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .order-line {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .order-line-summary {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}

/****************/
/* END CAROUSEL */
/****************/
