/* Country capture shares the site's panel, field and action spacing. */
.tm-site .site-content.tm-directory-capture {
  padding-block: clamp(32px, 4vw, 56px);
}

.tm-site .tm-directory-capture__panel.tmd-country-page {
  min-height: 0;
  border-color: var(--tm-color-border);
  border-radius: var(--tm-radius-md);
}

.tm-site .tm-directory-capture__panel .entry-header,
.tm-site .tm-directory-capture__panel .tmd-lead-form {
  padding: clamp(24px, 3vw, 40px);
}

.tm-site .tm-directory-capture__panel .entry-header {
  min-height: 0;
}

.tm-site .tm-directory-capture__panel .entry-header h1 {
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.1;
}

.tm-site .tm-directory-capture__panel .entry-header h1::after {
  margin-top: 16px;
  background: var(--tm-theme-highlight);
  box-shadow: none;
}

.tm-site .tm-directory-capture__panel .entry-header p {
  margin-top: 20px;
  line-height: 1.6;
}

.tm-site .tm-directory-capture__panel .tmd-lead-form {
  gap: 20px;
}

.tm-site .tm-directory-capture__panel .tmd-field:has(input[type="tel"]),
.tm-site .tm-directory-capture__panel .tmd-field:has(select) {
  grid-column: 1 / -1;
}

.tm-site .tm-directory-capture__panel .tmd-field input,
.tm-site .tm-directory-capture__panel .tmd-field select {
  min-height: 52px;
  border-color: var(--tm-color-border);
  border-radius: var(--tm-button-radius, 8px);
  font-size: 16px;
}

.tm-site .tm-directory-capture__panel .tmd-required-note {
  text-align: left;
}

.tm-site .tm-directory-capture__panel .tmd-lead-form button {
  min-height: 52px;
  border-radius: var(--tm-button-radius, 8px);
  border-color: var(--tm-theme-primary-button);
  background: var(--tm-theme-primary-button);
  color: var(--tm-color-text-on-primary-button);
  font-family: var(--tm-font-heading, "Poppins", sans-serif);
  font-weight: 700;
  box-shadow: none;
}

.tm-site .tm-directory-capture__panel .tmd-lead-form button:hover {
  filter: brightness(0.92);
  transform: none;
  box-shadow: none;
}

@media (max-width: 782px) {
  .tm-site .tm-directory-capture__panel .entry-header,
  .tm-site .tm-directory-capture__panel .tmd-lead-form {
    padding: 24px 20px;
  }
}

/* One owner for page gutters; a separate shared inset for cards and panels. */
@media (max-width: 782px) {
  :root {
    --tm-page-gutter: 16px;
    --tm-mobile-panel-padding: 16px;
  }

  .tm-site .container:not(.site-header__main),
  .tm-site .tm-container {
    padding-inline: 0;
  }

  .tm-site .container > :is(.tm-location-hub, .tm-listing-page) {
    padding-inline: 0;
  }

  .tm-site :is(.tm-location-hub, .tm-listing-page) .directory-archive__inner {
    padding-inline: 0;
  }

  .tm-site :is(.page-section, .tm-home-hero__categories, .site-footer__main, .site-footer__trust-strip, .site-footer-bottom) {
    padding-inline: var(--tm-page-gutter);
  }

  .tm-site .tm-shop-main > .page-section {
    padding-inline: 0;
  }

  .tm-site:is(.woocommerce-account, .woocommerce-cart, .woocommerce-checkout) .site-content--fullwidth :is(.post-content, .entry-header) {
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
  }

  .tm-site .site-content:has(.tm-shop-shell) {
    padding-inline: 0;
  }

  .tm-site :is(.tm-shop-shell, .artist-profile-hero__inner, .artist-profile-overview, .artist-profile-section) {
    padding-inline: var(--tm-page-gutter);
  }

  .tm-site .tm-home-hero__top[data-tm-hero-panels] :is(.tm-home-hero__store-content, .tm-home-hero__directory-content, .tm-home-hero__conference-content),
  .tm-site :is(.directory-hub__header, .directory-archive__header, .directory-hub-sidebar, .directory-results-toolbar, .artist-card__body, .artists-hub__finder, .tm-account-welcome, .tm-account-panel, .tm-account-community) {
    padding-inline: var(--tm-mobile-panel-padding);
  }
}

/* Scale saved module spacing; explicit zero spacing remains zero. */
@media (max-width: 1180px) {
  :root {
    --tm-module-spacing-scale: 0.75;
  }

  .tm-site .page-section[style*="--tm-section-padding-top"] {
    padding-top: calc(var(--tm-section-padding-top, 60px) * var(--tm-module-spacing-scale));
    padding-bottom: calc(var(--tm-section-padding-bottom, 60px) * var(--tm-module-spacing-scale));
  }
}

@media (max-width: 700px) {
  :root {
    --tm-module-spacing-scale: 0.6;
  }
}

/* Product CTAs: bounded thumbnail beside the product summary on phones. */
@media (max-width: 700px) {
  .tm-site .two-box-cta__item--product {
    display: grid;
    grid-template-columns: clamp(80px, 24vw, 112px) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    gap: 8px 16px;
    align-items: center;
    min-height: 0;
    padding: var(--tm-mobile-panel-padding, 16px);
  }

  .tm-site .two-box-cta__item--product::before {
    display: none;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__content {
    display: contents;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__image {
    position: static;
    grid-column: 1;
    grid-row: 1 / 4;
    width: 100%;
    height: 128px;
    max-height: 128px;
    min-width: 0;
    margin: 0;
    object-fit: contain;
    object-position: center;
    transform: none;
  }

  .tm-site .two-box-cta__item--product :is(.two-box-cta__eyebrow, .two-box-cta__heading, .two-box-cta__price) {
    grid-column: 2;
    min-width: 0;
    margin: 0;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__eyebrow {
    grid-row: 1;
    align-self: end;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__heading {
    grid-row: 2;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    line-height: 1.15;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__price {
    grid-row: 3;
    align-self: start;
    font-size: 1.05rem;
  }

  .tm-site .two-box-cta__item--product :is(.two-box-cta__text, .two-box-cta__actions) {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none;
    margin: 8px 0 0;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__text {
    grid-row: 4;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__actions {
    grid-row: 5;
  }

  .tm-site .two-box-cta__item--product .two-box-cta__button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    white-space: normal;
  }

  .tm-site .two-box-cta__item--product:not(:has(.two-box-cta__image)) :is(.two-box-cta__eyebrow, .two-box-cta__heading, .two-box-cta__price) {
    grid-column: 1 / -1;
  }
}

/* Two categories per mobile slide, sized for the narrower cards. */
@media (max-width: 700px) {
  .tm-home-hero__category-grid {
    gap: 12px;
  }

  .tm-home-hero__category-card {
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: clamp(180px, 48vw, 220px);
  }

  .tm-home-hero__category-meta {
    right: 24px;
    bottom: 12px;
    left: 12px;
  }

  .tm-home-hero__category-meta strong {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .tm-home-hero__category-meta small {
    font-size: 0.75rem;
  }

  .tm-home-hero__category-arrow {
    right: 8px;
    bottom: 14px;
  }
}

@media (max-width: 700px) {
  .tm-home-hero__category-card {
    /* Prevent intrinsic image dimensions from stretching a two-card slide. */
    height: clamp(180px, 48vw, 220px);
    min-height: 0;
  }
}

/* The shop category heading already sits inside a padded page shell. */
@media (max-width: 1180px) {
  .tm-site .page-section.tm-shop-category-top {
    padding-top: 0;
  }
}
