/* Marble + Granite pages and the product dialog. Sizes derived from the 2025 build at 1440x900 / 390x844. */

.products {
  padding-bottom: 60px;
}

/* ---- Hero ---- */
.hero {
  width: min(70vw, 1008px);
  height: 417px;
  margin: 37px auto 0;
  border-radius: 185px / 208px;
  overflow: hidden;
}

.hero__img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill; /* 2025 stretched the photo to the frame (BoxFit.fill) */
  transition: transform 300ms ease-in-out;
}

.products__title {
  margin: 38px 0 40px;
  text-align: center;
  color: var(--brand-heading);
  font-size: 29px;
  line-height: 1.2;
  font-weight: 700;
}

/* Granite uses a wider, taller hero and a larger heading than Marble (as in 2025). */
.products--granite .hero {
  width: calc(100% - 144px);
  height: 650px;
  border-radius: 195px / 208px;
}

.products--granite .products__title { font-size: 52px; margin-top: 30px; }

/* ---- Card grid ---- */
.products__grid {
  display: grid;
  grid-template-columns: repeat(3, 288px);
  gap: 60px 58px;
  justify-content: center;
  align-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product {
  display: contents;
}

.product__card {
  position: relative;
  display: block;
  width: 100%;
  padding: 23px 29px 36px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 5px 2px var(--brand-heading);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.product__dots {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 216px;
  height: 139px;
  background: url("/img/dots.webp") 0 0 / 100% 100% no-repeat;
}

.product__img {
  position: relative;
  display: block;
  width: 216px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
}

.product__img img {
  width: 100%;
  height: auto;
  transition: transform 300ms ease-in-out;
}

.product__name {
  display: block;
  margin-top: 16px;
  color: var(--brand-heading);
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
}

.product__desc {
  display: block;
  margin: 26px auto 0;
  width: 230px;
  color: #616161;
  font-size: 15px;
  line-height: 23px;
  text-align: left;
}

@media (hover: hover) and (min-width: 800px) {
  .hero:hover .hero__img { transform: scale(1.09); }
  .product__card:hover .product__img img { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__img, .product__img img { transition: none; }
}

@media (max-width: 1000px) {
  .products__grid { grid-template-columns: repeat(2, 288px); }
}

@media (max-width: 600px) {
  .hero {
    width: 312px;
    height: 208px;
    margin-top: 41px;
    border-radius: 60px;
  }
  .products--granite .hero { width: calc(100% - 40px); height: 208px; border-radius: 60px; }
  .products--granite .products__title { margin-top: 44px; font-size: 26px; }
  .products__title { margin: 44px 0 40px; font-size: 31px; }
  .products__grid { grid-template-columns: repeat(2, 125px); gap: 40px 41px; }
  .product__card { padding: 33px 10px 14px; }
  .product__dots { top: 22px; left: 5px; width: 52px; height: 47px; }
  .product__img { width: 94px; }
  .product__name { margin-top: 14px; font-size: 14px; line-height: 17px; }
  .product__desc { margin-top: 10px; width: 100%; font-size: 10px; line-height: 12px; }
}

/* ---- Dialog ---- */
body:has(.pdialog[open]) { overflow: hidden; }

.pdialog {
  position: fixed;
  inset: 24px 40px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: #fff;
  color: #000;
  overflow: hidden;
}

.pdialog[open] { display: flex; }

.pdialog::backdrop { background: rgba(0, 0, 0, 0.54); }

.pdialog__side {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: thin;
  border-right: 2px solid #000;
  padding-bottom: 12px;
}

.pdialog__brand {
  margin: 28px 0 22px;
  color: var(--brand);
  font-size: 35px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 3px;
}

.pdialog__materials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0 18px 0 10px;
  list-style: none;
}

.pdialog__material {
  position: relative;
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 2px solid #fff;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 3px 5px 1px rgba(158, 158, 158, 0.85);
  color: #000;
  font: 700 20px/28px var(--font);
  text-align: left;
  cursor: pointer;
}

.pdialog__material[aria-current="true"] { background: #90caf9; }

.pdialog__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  place-items: center;
}

.pdialog__badge svg { width: 12px; height: 12px; fill: #fff; }
.pdialog__material[data-has="1"] .pdialog__badge { display: grid; }

.pdialog__main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  padding: 48px 20px 20px 7px;
}

.pdialog__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(864px, 100%);
  min-height: 0;
}

.pdialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #555;
  cursor: pointer;
}

.pdialog__close:hover { background: #eee; }
.pdialog__close svg { width: 24px; height: 24px; fill: currentColor; }

.pdialog__tabs {
  display: flex;
  gap: 28px;
  margin: 0 0 14px;
}

.pdialog__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 29px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font: 500 20px/28px var(--font);
  cursor: pointer;
}

.pdialog__tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pdialog__tab svg { width: 20px; height: 20px; fill: currentColor; }

.pdialog__panel {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.pdialog__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdialog__row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 48px;
  margin: 6px 0;
  padding: 0 24px;
  border-radius: 999px;
  background: #fff;
  font: 500 20px/28px var(--font);
  cursor: pointer;
}

.pdialog__row:hover { background: #bbdefb; }
.pdialog__row:has(input:checked) { background: #64b5f6; }
.pdialog__row:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.pdialog__row input {
  appearance: none;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid #000;
  border-radius: 2px;
  background: transparent;
}

.pdialog__row input:checked {
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.pdialog__enquire {
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 7px 24px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font: 500 14px/18px var(--font);
  cursor: pointer;
}

@media (max-width: 600px) {
  .pdialog { inset: 24px 40px; }
  .pdialog__side { flex-basis: 84px; }
  .pdialog__brand { margin: 36px 0 24px; font-size: 9px; line-height: 10px; letter-spacing: 3px; }
  .pdialog__materials { gap: 8px; padding: 0 6px 0 4px; }
  .pdialog__main { padding-left: 4px; padding-right: 4px; }
  .pdialog__material { display: flex; align-items: center; min-height: 40px; padding: 7px 4px; border-width: 1px; font-size: 10px; line-height: 12px; overflow-wrap: anywhere; }
  .pdialog__badge { width: 14px; height: 14px; top: -4px; right: -3px; }
  .pdialog__badge svg { width: 9px; height: 9px; }
  .pdialog__main { padding: 40px 6px 14px; }
  .pdialog__tabs { gap: 4px; margin-bottom: 10px; }
  .pdialog__tab { gap: 2px; padding: 10px 5px; font-size: 10px; line-height: 12px; }
  .pdialog__tab svg { width: 14px; height: 14px; }
  .pdialog__row { gap: 14px; min-height: 66px; padding: 0 12px 0 20px; font-size: 14px; line-height: 20px; border-radius: 28px; }
  .pdialog__enquire { padding: 9px 24px; font-size: 16px; line-height: 20px; border-radius: 8px; }
}
