/* ==========================================================================
   Global tablet & mobile polish — all pages
   Breakpoints: mobile <768, tablet 768–1023, desktop ≥1024
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

/* Shared containers: safer side padding on small screens */
@media (max-width: 767px) {
  .site-main--home,
  .site-main--about,
  .site-main--products,
  .site-main--category,
  .site-main--contact,
  .site-main--gallery,
  .site-main--blog,
  .site-main--blog-single,
  .site-main--legal {
    --hp-container-x: 20px;
    --hp-section-y: clamp(2.5rem, 8vw, 3.5rem);
    --hp-gutter: 16px;
  }

  .hp-container,
  .site-main--home .hp-container,
  .site-main--about .hp-container,
  .site-main--products .hp-container,
  .site-main--category .hp-container,
  .site-main--contact .hp-container,
  .site-main--gallery .hp-container,
  .site-main--blog .hp-container,
  .site-main--blog-single .hp-container,
  .site-main--legal .hp-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .site-main--home,
  .site-main--about,
  .site-main--products,
  .site-main--category,
  .site-main--contact,
  .site-main--gallery,
  .site-main--blog,
  .site-main--blog-single,
  .site-main--legal {
    --hp-container-x: 32px;
    --hp-section-y: clamp(3rem, 5vw, 4rem);
  }

  .hp-container,
  .site-main--home .hp-container,
  .site-main--about .hp-container,
  .site-main--products .hp-container,
  .site-main--category .hp-container,
  .site-main--contact .hp-container,
  .site-main--gallery .hp-container,
  .site-main--blog .hp-container,
  .site-main--blog-single .hp-container,
  .site-main--legal .hp-container {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
}

/* ── Header ── */
@media (max-width: 1023px) {
  .hp-header,
  .hp-header__inner {
    height: auto;
    min-height: 80px;
  }

  .hp-header__inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .hp-header__logo {
    max-width: min(300px, 68vw);
  }

  .hp-header__logo .site-logo__image {
    max-height: 58px;
  }

  .hp-header__actions {
    gap: 8px;
  }
}

@media (max-width: 479px) {
  .hp-header__cta {
    display: none !important;
  }
}

/* ── Shared heroes (About, Products, Category, Contact, Blog, Legal) ── */
@media (max-width: 767px) {
  .ab-hero,
  .pp-hero,
  .pc-hero,
  .ct-hero,
  .bp-hero,
  .lg-hero {
    min-height: clamp(360px, 58vh, 480px) !important;
    padding: 110px 0 48px !important;
    align-items: flex-end;
  }

  .ab-hero__title,
  .pp-hero__title,
  .pc-hero__title,
  .ct-hero__title,
  .bp-hero__title,
  .lg-hero__title {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .ab-hero__desc,
  .pp-hero__desc,
  .pc-hero__desc,
  .ct-hero__desc,
  .bp-hero__desc,
  .lg-hero__desc {
    font-size: 15px !important;
    max-width: 100% !important;
  }

  .ab-hero__eyebrow,
  .pp-hero__eyebrow,
  .pc-hero__eyebrow,
  .lg-hero__eyebrow {
    gap: 10px;
  }

  .ab-hero__eyebrow-line,
  .pp-hero__eyebrow-line,
  .pc-hero__eyebrow-line,
  .lg-hero__eyebrow-line {
    width: 32px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ab-hero,
  .pp-hero,
  .pc-hero,
  .ct-hero,
  .bp-hero,
  .lg-hero {
    min-height: clamp(420px, 50vh, 560px) !important;
    padding: 120px 0 56px !important;
  }
}

/* ── Footer: tablet 2×2, mobile stack ── */
@media (max-width: 767px) {
  .hp-footer__main {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .hp-footer__brand {
    max-width: none;
  }

  .hp-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hp-footer__main {
    grid-template-columns: 1.2fr 1fr !important;
    gap: 32px 28px !important;
  }
}

/* ── Homepage ── */
@media (max-width: 767px) {
  .hp-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hp-section-header--center {
    align-items: center;
    text-align: center;
  }

  .hp-section-header__action {
    align-self: flex-start;
  }

  .hp-section-header--center .hp-section-header__action {
    align-self: center;
  }
}

/* ── Product modals ── */
@media (max-width: 767px) {
  .product-modal,
  .contact-modal {
    padding: 0 !important;
    align-items: flex-end;
  }

  .product-modal__dialog,
  .contact-modal__dialog {
    max-height: min(92dvh, 100%);
    width: 100%;
    max-width: 100%;
    border-radius: 14px 14px 0 0;
  }

  .contact-modal__inner {
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .contact-modal__submit,
  .ct-form__submit {
    min-height: 54px;
    font-size: 14px;
  }

  .product-modal__content {
    padding: 20px !important;
  }

  .product-modal__layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .product-modal__thumbs {
    gap: 8px;
  }

  .product-modal__thumb {
    width: 56px;
    height: 56px;
  }

  .contact-modal__grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .product-modal,
  .contact-modal {
    padding: 24px !important;
  }

  .product-modal__content {
    padding: 28px !important;
  }
}

/* ── Blog ── */
@media (max-width: 767px) {
  .bp-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .bp-toolbar__filters {
    width: 100%;
    padding-bottom: 4px;
  }

  .bp-toolbar__sort {
    justify-content: space-between;
  }

  .bp-featured__image {
    height: 240px !important;
    min-height: 220px !important;
  }

  .bp-hero__search {
    width: 100%;
  }

  .bp-hero__search-btn {
    width: 100%;
  }

  .bp-pagination .page-numbers {
    min-width: 40px;
    width: 40px;
    height: 40px;
  }
}

/* ── Legal CTA ── */
@media (max-width: 767px) {
  .lg-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .lg-cta__btn {
    width: 100%;
    justify-content: center;
  }

  .lg-block__title {
    flex-direction: column;
    gap: 6px;
  }
}

/* ── Contact ── */
@media (max-width: 767px) {
  .ct-office {
    gap: 16px;
  }

  .ct-office__title {
    font-size: 20px;
  }

  .ct-form-card {
    padding: 20px !important;
    overflow: visible;
  }

  .ct-form__submit {
    min-height: 54px;
    font-size: 14px;
    margin-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .ct-map {
    min-height: 280px;
  }

  .ct-map__marker {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    white-space: normal;
    font-size: 11px;
    padding: 12px 14px;
  }
}

/* ── Category product cards ── */
@media (max-width: 767px) {
  .pc-card__body {
    padding: 18px;
  }

  .pc-card__zoom {
    opacity: 1;
    transform: none;
  }

  .pc-card__nav {
    opacity: 1;
    width: 30px;
    height: 30px;
  }

  .pc-card__nav--prev {
    left: 8px;
  }

  .pc-card__nav--next {
    right: 8px;
  }

  .pc-products__load-more,
  .product-load-more {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .pc-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .pp-categories__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ── About manufacturing / team on tablet ── */
@media (max-width: 767px) {
  .ab-manufacturing__grid,
  .ab-team__grid {
    grid-template-columns: 1fr !important;
  }

  .ab-manufacturing__photo--offset {
    margin-left: 0 !important;
  }
}

/* ── Gallery ── */
@media (max-width: 767px) {
  .gl-hero {
    padding-top: calc(84px + 2rem);
  }
}

/* ── Prevent hover-only interactions from hiding content on touch ── */
@media (hover: none) {
  .pc-card__zoom,
  .pc-card__nav,
  .pp-stone-card__desc {
    opacity: 1 !important;
    transform: none !important;
    max-height: none !important;
  }

  .bp-card:hover,
  .pc-card:hover,
  .pp-stone-card:hover,
  .pp-feature:hover {
    transform: none;
  }
}
