/* Front page sections */

/* Common section styles */
.tm-section {
  padding: 96px var(--tm-content-px) 0;
}
.tm-section:first-child { padding-top: 0; }

/* Width constraint: sections without full-bleed background */
.tm-section-bestsellers,
.tm-section-newest,
.tm-section-maailmakaart,
.tm-section-contacts,
.tm-section-categories {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.tm-section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.tm-section-head-2col {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: end;
}

.tm-section-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--wp--preset--color--accent);
  text-transform: uppercase;
  font-weight: 500;
}

.tm-section-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

.tm-section-lead {
  font-size: 16px;
  color: var(--wp--preset--color--text-muted);
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 520px;
}

.tm-section-link {
  font-size: 14px;
  color: var(--wp--preset--color--text);
  text-decoration: none;
  align-self: start;
  white-space: nowrap;
}
.tm-section-link:hover { color: var(--wp--preset--color--accent); }
.tm-section-link-accent { color: var(--wp--preset--color--accent); }

/* Common buttons / links */
.tm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 32px;
  background: var(--wp--preset--color--accent);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--wp--preset--font-family--inter);
  transition: background 0.2s ease;
}
.tm-btn-primary:hover {
  background: var(--wp--preset--color--accent-dark);
  color: #fff;
}

.tm-link-underline {
  font-size: 14px;
  color: var(--wp--preset--color--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tm-link-underline.tm-link-accent { color: var(--wp--preset--color--accent); }

/* === HERO === */
.tm-hero {
  position: relative;
  width: 100%;
  background: var(--wp--preset--color--bg, #FFFFFF);
  overflow: hidden;
  padding: 64px 0 72px;
}

.tm-hero-inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* === TOP: World tea map ribbon === */
.tm-hero-ribbon {
  display: block;
  width: 320px;
  max-width: 90%;
  text-decoration: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.tm-hero-ribbon img {
  width: 100%;
  height: auto;
  display: block;
}

.tm-hero-ribbon:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.14));
}

.tm-hero-ribbon:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent, #A03E32);
  outline-offset: 4px;
  border-radius: 4px;
}

/* === H1 === */
.tm-hero-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(40px, 5.5vw, 68px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

/* === CTA === */
.tm-hero-actions {
  margin: 4px 0 0;
}

/* === HERO CAROUSEL — 14 origin countries === */

.tm-hero-carousel-wrap {
  width: 100%;
  margin-top: 48px;
}

.tm-hero-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
}

.tm-hero-carousel::-webkit-scrollbar {
  display: none;
}

.tm-hero-carousel-tile {
  flex: 0 0 auto;
  width: 240px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease;
}

.tm-hero-carousel-tile:hover {
  transform: translateY(-4px);
}

.tm-hero-carousel-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--wp--preset--color--bg-alt, #F5F4F0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-hero-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tm-hero-carousel-img-fallback {
  object-fit: contain;
  padding: 32px;
}

.tm-hero-carousel-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.tm-hero-carousel-name {
  font-family: var(--wp--preset--font-family--cormorant, Georgia, serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--wp--preset--color--text, #1A1A1A);
  letter-spacing: -0.005em;
}

.tm-hero-carousel-count {
  font-size: 12px;
  color: var(--wp--preset--color--text-body, #2C2C2C);
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

@media (max-width: 768px) {
  .tm-hero-carousel-wrap {
    margin-top: 32px;
  }
  .tm-hero-carousel {
    gap: 16px;
    scroll-padding-left: 0;
  }
  .tm-hero-carousel-tile {
    width: 180px;
  }
  .tm-hero-carousel-name {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .tm-hero-carousel-tile {
    width: 150px;
  }
  .tm-hero-carousel-name {
    font-size: 15px;
  }
}

/* === TABLET === */
@media (max-width: 1024px) {
  .tm-hero {
    padding: 48px 0 56px;
  }

  .tm-hero-inner {
    padding: 0 24px;
    gap: 24px;
  }

  .tm-hero-ribbon {
    width: 280px;
  }

  .tm-hero-title {
    font-size: clamp(28px, 4.5vw, 48px);
  }

  .tm-hero-ribbon:hover {
    transform: none;
  }
}

/* === MOBILE === */
@media (max-width: 768px) {
  .tm-hero {
    padding: 36px 0 44px;
  }

  .tm-hero-inner {
    padding: 0 20px;
    gap: 20px;
  }

  .tm-hero-ribbon {
    width: 240px;
  }

  .tm-hero-title {
    font-size: clamp(20px, 5.5vw, 32px);
  }

  .tm-hero-actions .tm-btn-primary {
    padding: 14px 28px;
    font-size: 13px;
  }
}

/* === SMALL MOBILE === */
@media (max-width: 380px) {
  .tm-hero-ribbon {
    width: 220px;
  }

  .tm-hero-title {
    font-size: clamp(18px, 5vw, 22px);
  }
}

/* === TRUST === */

.tm-section-trust {
  margin-top: 0;
  background: var(--wp--preset--color--bg-alt);
  padding: 32px 0;
}

.tm-section-trust .tm-section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--tm-content-px);
}

.tm-trust-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 64px;
  align-items: center;
}

.tm-trust-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-trust-seal {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(156, 54, 33, 0.18));
}

.tm-trust-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tm-trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tm-trust-item {
  position: relative;
  padding-left: 28px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--wp--preset--color--text-body, #2C2C2C);
}

.tm-trust-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wp--preset--color--accent, #9C3621);
}

@media (max-width: 768px) {
  .tm-trust-grid {
    grid-template-columns: 100px 1fr;
    gap: 20px;
    align-items: start;
  }
  .tm-trust-visual {
    padding-top: 4px;
  }
  .tm-trust-seal {
    max-width: 100px;
  }
  .tm-trust-content {
    gap: 18px;
  }
  .tm-trust-list {
    gap: 12px;
  }
  .tm-trust-item {
    font-size: 14px;
    padding-left: 20px;
    line-height: 1.45;
  }
  .tm-trust-item::before {
    top: 7px;
    width: 6px;
    height: 6px;
  }
  .tm-section-trust {
    margin-top: 0;
  }
  .tm-section.tm-section-trust {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

@media (max-width: 380px) {
  .tm-trust-grid {
    grid-template-columns: 80px 1fr;
    gap: 16px;
  }
  .tm-trust-seal {
    max-width: 80px;
  }
  .tm-trust-item {
    font-size: 13px;
    padding-left: 18px;
  }
  .tm-section-trust {
    margin-top: 24px;
  }
  .tm-section.tm-section-trust {
    padding-top: 32px;
    padding-bottom: 64px;
  }
}

/* === PRODUCT GRID === */
.tm-product-grid {
  display: grid;
  gap: 40px 28px;
}
.tm-grid-4 { grid-template-columns: repeat(4, 1fr); }
.tm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tm-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* === COUNTRY TILES === */
.tm-country-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.tm-country-grid > .wm-country-card {
  width: auto;
}

.tm-country-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--wp--preset--color--bg-alt);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}
.tm-country-tile:hover {
  background: var(--wp--preset--color--border);
}
.tm-country-flag {
  width: 36px;
  height: 24px;
  flex-shrink: 0;
}
.tm-country-flag img,
.tm-country-flag svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tm-country-name {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 18px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1.2;
}
.tm-country-count {
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
  margin-top: 2px;
}

/* === NEWSLETTER === */
.tm-section-newsletter {
  margin-top: 120px;
  margin-bottom: 0;
  background: var(--wp--preset--color--text);
  color: var(--wp--preset--color--bg-alt);
}

.tm-section-newsletter .tm-section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--tm-content-px);
  height: 200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.tm-newsletter-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 36px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.01em;
}
.tm-newsletter-sub {
  font-size: 14px;
  color: var(--wp--preset--color--text-divider);
  margin: 0;
}
.tm-newsletter-form {
  display: flex;
  gap: 12px;
  position: relative;
}
.tm-newsletter-input {
  flex: 1;
  height: 56px;
  padding: 0 18px;
  background: #fff;
  border: none;
  font-size: 14px;
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--text);
}
.tm-newsletter-feedback {
  position: absolute;
  bottom: -28px;
  left: 0;
  font-size: 12px;
}
.tm-newsletter-feedback.success { color: #b8e0a8; }
.tm-newsletter-feedback.error   { color: #f0a4a4; }

/* === MOBILE === */
@media (max-width: 1280px) {
  .tm-country-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .tm-country-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: -24px;
    margin-right: -24px;
    padding: 0 24px;
  }
  .tm-country-grid::-webkit-scrollbar { display: none; }
  .tm-country-grid > .wm-country-card {
    flex: 0 0 200px;
    width: 200px;
    scroll-snap-align: start;
  }
}

@media (max-width: 768px) {
  .tm-section { padding: 64px 14px 0; }

  .tm-section-head-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tm-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tm-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .tm-product-grid { gap: 28px 16px; }



  .tm-section-newsletter {
    margin-top: 80px;
  }

  .tm-section-newsletter .tm-section-inner {
    grid-template-columns: 1fr;
    height: auto;
    padding: 48px 14px;
    gap: 24px;
  }
  .tm-newsletter-title { font-size: 26px; }
  .tm-newsletter-form { flex-direction: column; }
}

/* === CATEGORIES CAROUSEL === */

.tm-section-categories .tm-section-head {
  margin-bottom: 0;
}

.tm-categories-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
  margin-top: 40px;
}

.tm-categories-carousel::-webkit-scrollbar {
  display: none;
}

.tm-categories-carousel-tile {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s ease;
}

.tm-categories-carousel-tile:hover {
  transform: translateY(-4px);
}

.tm-categories-carousel-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--wp--preset--color--bg, #FFFFFF);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-categories-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tm-categories-carousel-img-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--wp--preset--color--accent, #9C3621) 0%, #1A1A1A 100%);
  color: var(--wp--preset--color--bg-alt, #F5F4F0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--cormorant, Georgia, serif);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.tm-categories-carousel-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.tm-categories-carousel-name {
  font-family: var(--wp--preset--font-family--cormorant, Georgia, serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--wp--preset--color--text, #1A1A1A);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tm-categories-carousel-count {
  font-size: 12px;
  color: var(--wp--preset--color--text-body, #2C2C2C);
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

@media (max-width: 768px) {
  .tm-categories-carousel {
    gap: 16px;
    margin-top: 28px;
  }
  .tm-categories-carousel-tile {
    width: 160px;
  }
  .tm-categories-carousel-name {
    font-size: 18px;
  }
  .tm-categories-carousel-img-fallback {
    font-size: 44px;
  }
}

@media (max-width: 380px) {
  .tm-categories-carousel-tile {
    width: 140px;
  }
  .tm-categories-carousel-name {
    font-size: 16px;
  }
}

/* === CONTACTS === */
/* .tm-section-contacts наследует базу .tm-section (cream bg-alt, padding, margin-top) */

.tm-contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* CRITICAL: min-width: 0 prevents grid blowout from overflow children
   (overflow-x: auto on .tm-contacts-gallery would break grid sizing
   and push the cell past tm-section-inner boundaries) */
.tm-contacts-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* === Photo gallery (left grid cell on desktop) === */
.tm-contacts-gallery {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.tm-contacts-gallery::-webkit-scrollbar {
  display: none;
}

.tm-contacts-gallery-item {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--wp--preset--color--bg, #FFFFFF);
}

.tm-contacts-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Info column (right grid cell on desktop) === */
.tm-contacts-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.tm-contacts-info .tm-section-eyebrow,
.tm-contacts-info .tm-section-title {
  margin: 0;
}

.tm-contacts-intro {
  margin: 0;
}

.tm-contacts-intro-p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--wp--preset--color--text-body, #2C2C2C);
  margin: 0 0 16px;
}

.tm-contacts-intro-p:last-child {
  margin-bottom: 0;
}

.tm-contacts-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.tm-contacts-block-title {
  font-family: var(--wp--preset--font-family--cormorant, Georgia, serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--wp--preset--color--text, #1A1A1A);
  margin: 0;
  letter-spacing: -0.005em;
}

.tm-contacts-address {
  font-style: normal;
  font-size: 15px;
  line-height: 1.55;
  color: var(--wp--preset--color--text-body, #2C2C2C);
  margin: 0;
}

.tm-contacts-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--wp--preset--color--text-body, #2C2C2C);
}

.tm-contacts-link {
  color: var(--wp--preset--color--text, #1A1A1A);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tm-contacts-link:hover {
  color: var(--wp--preset--color--accent, #9C3621);
  border-bottom-color: var(--wp--preset--color--accent, #9C3621);
}

.tm-contacts-hours {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-contacts-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-size: 15px;
  color: var(--wp--preset--color--text-body, #2C2C2C);
  border-bottom: 1px dashed var(--wp--preset--color--border, #E8E6E0);
  padding-bottom: 8px;
}

.tm-contacts-hours-row:last-child {
  border-bottom: none;
}

.tm-contacts-hours-day {
  font-weight: 500;
  color: var(--wp--preset--color--text, #1A1A1A);
}

/* === Compact map (last block in info column) — Postcard Teas style === */
.tm-contacts-map {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 280px;
  overflow: hidden;
  background: var(--wp--preset--color--bg-alt, #F5F4F0);
  margin-top: 8px;
  box-sizing: border-box;
}

.tm-contacts-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .tm-contacts-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .tm-contacts-info {
    gap: 20px;
  }
  .tm-contacts-intro-p {
    font-size: 15px;
  }
  .tm-contacts-block-title {
    font-size: 20px;
  }
  .tm-contacts-map {
    aspect-ratio: 4 / 3;
    max-height: 240px;
  }
}
