/* Keep the public layout on one grid, with a comfortable limit on wide monitors. */
:root {
  --site-content-width: min(90%, 1880px);
  --catalogue-gap: clamp(12px, 1.35vw, 25px);
  --catalogue-radius: 11px;
  --catalogue-photo-background: radial-gradient(ellipse at 50% 42%, #fff 5%, #f3f6f9 80%);
}

body .shell,
.home-registration .gy-registration-banner {
  width: var(--site-content-width);
  max-width: none;
  padding-inline: 0;
}

:is(.home-quick-grid, .catalogue-area .product-grid, .accessories-grid, .tunap-grid, .battery-grid, .category-grid) {
  gap: var(--catalogue-gap);
}
.catalogue-area .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 302px), 1fr));
}
.accessory-catalogue .accessories-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr));
}

/* Photo panels use the same surface and spacing across the product ranges. */
:is(.product-card, .tunap-card, .battery-card) {
  --photo-height: clamp(236px, 17vw, 306px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--catalogue-radius);
}
:is(.product-card > .product-image, .tunap-card > .tunap-product-image, .battery-card > .battery-product-image) {
  flex: 0 0 auto;
  height: var(--photo-height);
  min-height: 0;
  padding: 25px clamp(14px, 1.35vw, 26px) 19px;
  border: 0;
  border-bottom: 1px solid #e5edf4;
  background: var(--catalogue-photo-background);
}
:is(.product-image, .tunap-product-image, .battery-product-image) > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tyre-card .product-image .tag { right: auto; }
.tunap-card .tunap-product-image { padding-bottom: 28px; }
.tunap-card .tunap-image-action { color: #526c82; font-size: 11px; }
:is(.product-card, .tunap-card, .battery-card) > :is(.product-body, .tunap-product-copy, .battery-product-body) {
  padding: clamp(15px, 1.4vw, 24px);
}
:is(.product-card .card-actions, .tunap-card .tunap-card-actions, .battery-card .battery-card-actions) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
:is(.product-card .card-actions, .tunap-card .tunap-card-actions, .battery-card .battery-card-actions) > .btn {
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  font-size: .8125rem;
  line-height: 1.35;
  white-space: normal;
}
.tyre-card > .product-image { padding-block: 21px 14px; }
:is(.product-card, .tunap-card, .battery-card) :is(.product-title, .tunap-product-copy h3, .battery-product-body h3) {
  font-size: clamp(1.03rem, 1.25vw, 1.19rem);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.supplier-availability {
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: .8125rem;
  line-height: 1.4;
}
.supplier-availability--local { background: #edf5e8; }
.supplier-availability--inquiry, .supplier-availability--delivery { color: #435969; background: #eff4f8; }
.supplier-availability--limited { background: #fdf1d9; }
.availability-date { margin-top: 5px; color: var(--muted); font-size: .8125rem; }

.catalogue-search-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 14px;
  padding: 14px clamp(13px, 1.7vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--catalogue-radius);
  background: #f6f9fc;
}
.catalogue-search-summary:focus { outline: none; }
:is(.catalogue-search-summary, #catalogue-finder-panel, #catalogue-filter-fallback, [data-delivery-town], [data-inquiry-branch])[hidden] { display: none; }
.search-summary-label { display: flex; align-items: center; min-width: 0; gap: 10px; }
.search-summary-label > .icon { flex: none; color: var(--blue); }
.search-summary-label span { display: block; color: var(--muted); font-size: .8125rem; }
.search-summary-label strong { display: block; color: var(--ink); font-size: clamp(.96rem, 2vw, 1.17rem); overflow-wrap: anywhere; }
.search-summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search-summary-actions .btn { margin: 0; min-height: 44px; padding: 9px 14px; }
.search-summary-actions .mobile-filter-button { display: none; }

.home-shop-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--catalogue-gap);
  margin-top: clamp(16px, 1.7vw, 26px);
}
.home-shop-links a {
  min-height: 55px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  color: var(--blue);
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: var(--catalogue-radius);
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.3;
}
.home-shop-links a:hover { background: #e7eff8; border-color: #a8bed2; }
.home-shop-links .icon { flex: none; }
.home-shop-links .icon:last-child { margin-left: auto; width: 15px; height: 15px; }

.accessory-nav { margin: 0 0 22px; padding: 0; border: 0; }
.accessory-controls {
  border: 1px solid var(--line);
  border-radius: var(--catalogue-radius);
  background: #f6f9fc;
  padding: clamp(14px, 1.65vw, 24px);
}
.accessory-fitment-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr)) minmax(170px, 1.5fr) minmax(128px, 1fr);
  gap: 12px;
}
.accessory-fitment-fields:has([name="rim"]) { grid-template-columns: minmax(100px, 1fr) minmax(170px, 2fr) minmax(128px, 1fr); }
.accessory-fitment-fields label { min-width: 0; font-size: .875rem; font-weight: 700; }
.accessory-fitment-fields :is(select,input) { margin-top: 5px; min-height: 44px; font-weight: 600; background-color: white; }
.accessory-fitment-fields select:disabled { color: #4e6477; background-color: #ebf0f5; }
.accessory-filter-foot { display: flex; flex-wrap: wrap; gap: 0 12px; justify-content: space-between; align-items: center; margin-top: 3px; }
.accessory-filter-foot p { color: var(--muted); font-size: .8125rem; }
.accessory-filter-foot button { color: var(--blue); font-size: .875rem; min-height: 44px; }
.accessory-count { margin: 18px 0 12px; color: var(--ink); font-size: .9rem; font-weight: 700; }
.accessory-fitment-note { align-self: flex-start; padding: 4px 8px; border-radius: 5px; background: #fdf1d9; color: #614716; font-size: .8125rem; font-weight: 650; }
.accessories-grid > .empty { grid-column: 1 / -1; }

.tyre-fulfillment {
  min-width: 0;
  margin: 14px 0;
  padding: 0;
  border: 0;
}
.tyre-fulfillment legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-weight: 750; font-size: .94rem; }
.fulfillment-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fulfillment-options label {
  display: flex;
  align-items: flex-start;
  min-height: 52px;
  gap: 7px;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  line-height: 1.25;
  cursor: pointer;
}
.fulfillment-options label:has(:checked) { border-color: var(--blue); background: #eef5ff; }
.fulfillment-options label:has(:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.fulfillment-options input[type="radio"] { margin: 1px 0 0; }
.fulfillment-options strong { display: block; font-size: .8125rem; }
.fulfillment-options small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.tyre-fulfillment [data-fulfillment-note] { margin: 7px 0 0; }
.tyre-fulfillment [data-delivery-town] { margin-top: 10px; }
.detail-tyre-season { font-size: .8125rem; margin: 10px 0; }
.tyre-hotel-link { margin: 6px 0 10px; font-size: .8125rem; min-height: 44px; }
.article-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }

.inquiry-contact { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.inquiry-contact legend { padding-inline: 4px; font-size: .94rem; font-weight: 750; }
.inquiry-contact p { color: var(--muted); margin: 0 0 10px; font-size: .875rem; }
@media (max-width: 900px) {
  .search-summary-actions .mobile-filter-button { display: inline-flex; gap: 7px; width: auto; }
  .accessory-fitment-fields,
  .accessory-fitment-fields:has([name="rim"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .accessory-fitment-fields:has([name="make"]) label:has([name="query"]) { grid-column: span 2; }
}
@media (max-width: 680px) {
  .catalogue-search-summary { align-items: flex-start; flex-direction: column; padding: 11px 12px; }
  .catalogue-area .results-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 8px;
  }
  .catalogue-area .results-tools .sort-field { margin: 0; min-width: 0; }
  .catalogue-area .results-tools .sort-field > span { display: none; }
  .catalogue-area .results-tools .sort-field select { width: 100%; max-width: none; min-height: 44px; }
  .catalogue-area .results-tools .copy-search { min-height: 44px; }
  .home-shop-links a { flex-direction: column; justify-content: center; padding: 8px; gap: 6px; text-align: center; }
  .home-shop-links .icon:last-child { display: none; }
  .accessory-fitment-fields,
  .accessory-fitment-fields:has([name="rim"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accessory-fitment-fields label:has([name="query"]) { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 480px) {
  .fulfillment-options { grid-template-columns: minmax(0, 1fr); }
  .fulfillment-options label { min-height: 44px; align-items: center; padding: 9px 10px; gap: 9px; }
  .fulfillment-options label > span { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; }
  .fulfillment-options small { margin-top: 0; }
}

.category-grid > .category-tile:not(.category-tile--tunap) {
  --category-photo-height: clamp(153px, 12.5vw, 220px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--catalogue-radius);
}
.category-tile .category-photo {
  height: var(--category-photo-height);
  padding: 12px clamp(10px, 1.2vw, 21px);
  margin: 0;
  background: var(--catalogue-photo-background);
}
.category-tile .category-photo > img {
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* The supplier poster contains a vehicle above the hubcaps. Frame the product panel. */
.category-tile .category-photo--ratkape > img {
  position: static;
  flex: 0 0 auto;
  width: min(98%, calc(var(--category-photo-height) * .94));
  height: auto;
  max-height: none;
  clip-path: inset(39% 1% 2%);
  transform: translateY(-18.5%);
}
.category-tile .category-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(12px, 1.25vw, 21px);
}
.category-tile .category-copy h3 { min-height: 0; line-height: 1.35; }
.category-tile .category-copy p { min-height: 0; margin: 7px 0 14px; }
.category-tile .category-copy small { margin-top: auto; padding-right: 20px; }
.category-tile .category-copy + .arrow { right: 12px; bottom: 12px; }

@media (max-width: 900px) {
  .home-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :is(.home-quick-grid, .catalogue-area .product-grid, .accessories-grid) { grid-template-columns: minmax(0, 1fr); }
  .accessory-catalogue .accessories-grid { grid-template-columns: minmax(0, 1fr); }
  :is(.product-card, .home-quick-grid .tyre-card, .tunap-card, .battery-card) {
    --photo-height: clamp(194px, 57vw, 248px);
  }
  :is(.product-card > .product-image, .tunap-card > .tunap-product-image, .battery-card > .battery-product-image) {
    padding-block: 20px 16px;
  }
  .tunap-card .tunap-product-image { padding-bottom: 26px; }
  .tyre-card .product-image .tag { top: 10px; left: 10px; }
  .category-grid > .category-tile:not(.category-tile--tunap) {
    --category-photo-height: clamp(112px, 35vw, 184px);
  }
  .category-tile .category-copy + .arrow { right: 8px; bottom: 8px; }
}
@media (max-width: 520px) {
  :is(.tunap-grid, .tunap-grid.tunap-home-products, .battery-grid) { grid-template-columns: minmax(0, 1fr); }
}
