/*
 * Fondazione Tinè — Archivio Shop v0.2
 * Namespace obbligatorio: .tine-shop
 */

.tine-shop {
  --tine-forest: #1b4332;
  --tine-sprout: #c1e283;
  --tine-orange: #ff9600;
  --tine-ink: #343b29;
  --tine-mist: #f2f7f2;
  --tine-white: #ffffff;
  --tine-soft: #f6f7f4;
  --tine-line: rgba(27, 67, 50, 0.2);
  --tine-display: Cardo, Georgia, "Times New Roman", serif;
  --tine-sans: Montserrat, Arial, sans-serif;
  --tine-content: 1380px;
  --tine-gutter: clamp(20px, 4vw, 64px);

  display: block;
  width: 100%;
  color: var(--tine-ink);
  background: var(--tine-white);
  font-family: var(--tine-sans);
  font-size: 16px;
  line-height: 1.6;
}

.tine-shop,
.tine-shop *,
.tine-shop *::before,
.tine-shop *::after {
  box-sizing: border-box;
}

.tine-shop img {
  display: block;
  width: 100%;
  max-width: 100%;
}

.tine-shop h1,
.tine-shop h2,
.tine-shop h3,
.tine-shop p,
.tine-shop figure {
  margin: 0;
}

.tine-shop a {
  color: inherit;
}

.tine-shop :focus-visible {
  outline: 3px solid var(--tine-orange);
  outline-offset: 4px;
}

.tine-shop__eyebrow {
  color: var(--tine-forest);
  font-family: var(--tine-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.35;
  text-transform: uppercase;
}

/* Testata compatta: i prodotti restano visibili già nel primo viewport. */
.tine-archive-header {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(320px, 1.15fr) minmax(220px, 0.55fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  width: min(calc(100% - 2 * var(--tine-gutter)), var(--tine-content));
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) 0 clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--tine-line);
}

.tine-archive-header__title h1 {
  margin-top: 4px;
  color: var(--tine-forest);
  font-family: var(--tine-display);
  font-size: clamp(4.3rem, 7vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: none;
}

.tine-archive-header__intro {
  max-width: 650px;
  font-size: clamp(0.92rem, 1.15vw, 1.06rem);
  line-height: 1.75;
}

.tine-archive-header__service {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-self: end;
  min-width: 220px;
  padding: 16px 18px;
  color: var(--tine-ink);
  background: var(--tine-orange);
}

.tine-archive-header__service-mark {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
}

.tine-archive-header__service small,
.tine-archive-header__service strong {
  display: block;
}

.tine-archive-header__service small {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
}

.tine-archive-header__service strong {
  margin-top: 2px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Il cambio locale/nazionale è un filtro, non una landing. */
.tine-shop-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(calc(100% - 2 * var(--tine-gutter)), var(--tine-content));
  margin: 28px auto 0;
  border: 1px solid var(--tine-line);
}

.tine-shop-switch__item {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  min-height: 84px;
  padding: 17px clamp(18px, 2vw, 30px);
  border-right: 1px solid var(--tine-line);
  color: var(--tine-forest) !important;
  background: var(--tine-white);
  text-decoration: none !important;
  transition: color 180ms ease, background-color 180ms ease;
}

.tine-shop-switch__item:last-child {
  border-right: 0;
}

.tine-shop-switch__item:hover {
  background: var(--tine-mist);
}

.tine-shop-switch__item[aria-current="page"] {
  color: var(--tine-white) !important;
  background: var(--tine-forest);
}

.tine-shop-switch__item span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.tine-shop-switch__item small {
  margin-top: 4px;
  font-size: 0.68rem;
  opacity: 0.72;
}

.tine-shop-context {
  display: flex;
  gap: 11px;
  align-items: center;
  width: min(calc(100% - 2 * var(--tine-gutter)), var(--tine-content));
  margin: 13px auto 0;
  padding: 11px 15px;
  color: var(--tine-forest);
  background: var(--tine-mist);
}

.tine-shop-context__dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tine-orange);
}

.tine-shop-context p {
  font-size: 0.72rem;
}

.tine-category-nav {
  display: flex;
  gap: 8px;
  width: min(calc(100% - 2 * var(--tine-gutter)), var(--tine-content));
  margin: 20px auto 0;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tine-category-nav a {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--tine-line);
  color: var(--tine-forest) !important;
  background: var(--tine-white);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  text-transform: uppercase;
}

.tine-category-nav a:hover,
.tine-category-nav a[aria-current="page"] {
  border-color: var(--tine-sprout);
  color: var(--tine-ink) !important;
  background: var(--tine-sprout);
}

/* Demo locale e area del widget Archive Products. */
.tine-catalog,
.tine-shop .elementor-widget-woocommerce-archive-products,
.tine-shop .elementor-widget-wc-archive-products {
  width: min(calc(100% - 2 * var(--tine-gutter)), var(--tine-content));
  margin: clamp(22px, 2.6vw, 36px) auto 0;
  padding-bottom: clamp(54px, 6vw, 88px);
}

.tine-catalog__toolbar,
.tine-shop .woocommerce .woocommerce-result-count,
.tine-shop .woocommerce .woocommerce-ordering {
  font-family: var(--tine-sans);
  font-size: 0.72rem;
}

.tine-catalog__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--tine-line);
}

.tine-catalog__toolbar label {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tine-catalog__toolbar select,
.tine-shop .woocommerce .woocommerce-ordering select {
  min-height: 42px;
  padding: 8px 38px 8px 13px;
  border: 1px solid var(--tine-line);
  border-radius: 0;
  color: var(--tine-ink);
  background-color: var(--tine-white);
  font-family: var(--tine-sans);
  font-size: 0.72rem;
}

.tine-catalog__products,
.tine-shop .woocommerce ul.products,
.tine-shop .elementor-products-grid ul.products.elementor-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(22px, 2.4vw, 38px) clamp(14px, 1.8vw, 28px) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tine-product-card,
.tine-shop .woocommerce ul.products li.product,
.tine-shop .elementor-products-grid ul.products.elementor-grid li.product {
  position: relative;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--tine-ink);
  background: transparent;
  list-style: none;
}

.tine-product-card[hidden] {
  display: none !important;
}

.tine-product-card__image,
.tine-shop .woocommerce ul.products li.product > a.woocommerce-LoopProduct-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--tine-soft);
  text-decoration: none !important;
}

.tine-product-card__image img,
.tine-shop .woocommerce ul.products li.product a img {
  width: 100% !important;
  aspect-ratio: 4 / 5;
  margin: 0 !important;
  object-fit: cover;
  transition: transform 550ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.tine-product-card:hover .tine-product-card__image img,
.tine-shop .woocommerce ul.products li.product:hover a img {
  transform: scale(1.025);
}

.tine-product-card__badge,
.tine-shop .tine-product-delivery-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 7px 9px;
  color: var(--tine-white);
  background: var(--tine-forest);
  font-family: var(--tine-sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.tine-shop .tine-product-delivery-badge--national {
  color: var(--tine-ink);
  background: var(--tine-orange);
}

.tine-product-card__badge--national {
  color: var(--tine-ink);
  background: var(--tine-orange);
}

.tine-product-card__body {
  padding-top: 15px;
}

.tine-product-card__category {
  margin-bottom: 5px !important;
  color: var(--tine-forest);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tine-product-card h2,
.tine-shop .woocommerce ul.products li.product .woocommerce-loop-product__title {
  padding: 0 !important;
  color: var(--tine-ink) !important;
  font-family: var(--tine-sans) !important;
  font-size: clamp(0.78rem, 1vw, 0.9rem) !important;
  font-weight: 600 !important;
  letter-spacing: 0.015em;
  line-height: 1.4 !important;
  text-transform: none !important;
}

.tine-product-card h2 a {
  text-decoration: none !important;
}

.tine-product-card__price,
.tine-shop .woocommerce ul.products li.product .price {
  display: block;
  margin-top: 5px !important;
  color: var(--tine-forest) !important;
  font-family: var(--tine-sans);
  font-size: 0.76rem !important;
  font-weight: 500 !important;
}

.tine-shop .woocommerce ul.products li.product .button {
  display: inline-flex;
  margin-top: 12px !important;
  padding: 0 0 4px !important;
  border: 0 !important;
  border-bottom: 1px solid currentColor !important;
  border-radius: 0 !important;
  color: var(--tine-forest) !important;
  background: transparent !important;
  font-family: var(--tine-sans) !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tine-shop .woocommerce span.onsale {
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 7px 9px !important;
  border-radius: 0 !important;
  color: var(--tine-ink) !important;
  background: var(--tine-orange) !important;
  font-size: 0.58rem !important;
  line-height: 1 !important;
}

.tine-catalog__empty {
  margin-top: 40px;
  padding: clamp(50px, 7vw, 100px) var(--tine-gutter);
  color: var(--tine-forest);
  background: var(--tine-mist);
  text-align: center;
}

.tine-catalog__empty[hidden] {
  display: none;
}

.tine-catalog__empty h2 {
  max-width: 650px;
  margin: 8px auto 16px;
  color: var(--tine-forest);
  font-family: var(--tine-display);
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tine-catalog__empty > p:last-child {
  font-size: 0.86rem;
}

@media (max-width: 1050px) {
  .tine-archive-header {
    grid-template-columns: minmax(210px, 0.6fr) minmax(0, 1.4fr);
  }

  .tine-archive-header__service {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .tine-catalog__products,
  .tine-shop .woocommerce ul.products,
  .tine-shop .elementor-products-grid ul.products.elementor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 740px) {
  .tine-shop {
    --tine-gutter: 18px;
  }

  .tine-archive-header {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    padding-top: 38px;
  }

  .tine-archive-header__title h1 {
    font-size: clamp(4.2rem, 22vw, 6rem);
  }

  .tine-archive-header__service {
    grid-column: auto;
    justify-self: stretch;
  }

  .tine-shop-switch {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .tine-shop-switch__item {
    flex: 0 0 76%;
    min-height: 76px;
    border-bottom: 0;
    scroll-snap-align: start;
  }

  .tine-catalog__toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .tine-catalog__products,
  .tine-shop .woocommerce ul.products,
  .tine-shop .elementor-products-grid ul.products.elementor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 30px !important;
  }

  .tine-product-card__badge,
  .tine-shop .tine-product-delivery-badge {
    top: 8px;
    left: 8px;
    padding: 6px 7px;
    font-size: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tine-shop *,
  .tine-shop *::before,
  .tine-shop *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
