/*
 * AT White Label — centralized preview watermark
 *
 * The watermark is deliberately applied as a final visual layer, not inside
 * product source files. This keeps the original templates untouched while
 * protecting every rendered preview surface.
 */

:root{
  --at-wm-opacity:.30;
  --at-wm-size:420px 180px;
}

/* Shared protected surfaces */
.at-watermark-surface,
.product-preview,
.detail-preview,
.devops-shot,
.hero-slide{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
}

/*
 * Adaptive contrast:
 * white + mix-blend-mode:difference becomes dark on white/light templates,
 * light on dark templates and remains contrasting over saturated colours.
 * This fixes the previous white-only watermark which disappeared on white
 * templates while preserving a restrained visual treatment.
 */
.at-watermark-surface::after,
.product-preview::after,
.detail-preview::after,
.devops-shot::after,
.hero-slide::after{
  display:block!important;
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:2147483647!important;
  pointer-events:none!important;
  user-select:none!important;
  -webkit-user-select:none!important;
  opacity:var(--at-wm-opacity)!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='180' viewBox='0 0 420 180'%3E%3Cg transform='rotate(-24 210 90)'%3E%3Ctext x='0' y='92' fill='white' fill-opacity='.95' font-family='Arial,sans-serif' font-size='18' font-weight='700' letter-spacing='1.8'%3EAT %E2%80%A2 ANDREA TRUGLIA %E2%80%A2 PARTNER STRATEGICO%3C/text%3E%3C/g%3E%3C/svg%3E")!important;
  background-repeat:repeat!important;
  background-size:var(--at-wm-size)!important;
  background-position:center!important;
  mix-blend-mode:difference!important;
}

/* Hero previews: there must be ONE authoritative layer on the outer card.
   installWatermarkProtection() also tags .slide-screen, so suppress its
   generated pseudo-element to avoid stacking two watermarks in hero cards. */
.hero-slide .slide-screen::before,
.hero-slide .slide-screen.at-watermark-surface::after{
  display:none!important;
}

/* Keep the watermark visible above iframe content and card copy. */
.hero-slide .slide-screen,
.hero-slide .slide-top,
.hero-slide .slide-body{
  position:relative;
}

@media(max-width:560px){
  :root{--at-wm-opacity:.32;--at-wm-size:300px 140px}

  /* Mobile navigation: Catalogo already contains the category filters. */
  .mobile-bottom button[data-route="categories"]{display:none!important}

  /* BLOCK 1 — Stripe/payment CTA: keep every label fully readable. */
  .payment-option.payment-stripe{
    display:grid!important;
    grid-template-columns:minmax(68px,82px) minmax(0,1fr) auto!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:64px!important;
    gap:9px!important;
    padding:10px 12px!important;
    overflow:hidden!important;
  }

  .payment-option.payment-stripe .payment-brand,
  .payment-option.payment-stripe .payment-copy,
  .payment-option.payment-stripe .payment-arrow{min-width:0!important}

  .payment-option.payment-stripe .payment-brand{
    width:auto!important;
    overflow:visible!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
  }

  .payment-option.payment-stripe .payment-brand img{
    display:block!important;
    width:auto!important;
    max-width:78px!important;
    height:auto!important;
    max-height:22px!important;
    object-fit:contain!important;
  }

  .payment-option.payment-stripe .payment-copy{
    overflow:visible!important;
    text-align:left!important;
  }

  .payment-option.payment-stripe .payment-copy strong,
  .payment-option.payment-stripe .payment-copy small{
    display:block!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
    hyphens:auto!important;
  }

  .payment-option.payment-stripe .payment-copy strong{font-size:10.5px!important;line-height:1.25!important}
  .payment-option.payment-stripe .payment-copy small{margin-top:2px!important;font-size:8px!important;line-height:1.25!important}
  .payment-option.payment-stripe .payment-arrow{flex:0 0 auto!important;width:auto!important;font-size:13px!important;white-space:nowrap!important}

  .stripe-button,
  button.stripe-button,
  [data-payment="stripe"] button,
  [data-method="stripe"] button{
    max-width:100%!important;
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    text-overflow:clip!important;
    line-height:1.2!important;
  }

  /* BLOCK 2 — catalog cards: preview becomes the dominant visual area. */
  .product-grid{align-items:start!important}
  .product{min-width:0!important}
  .product-preview{height:220px!important;min-height:220px!important;padding:0!important;margin:0!important;border-radius:0!important}
  .product-preview .browser,
  .product-preview iframe,
  .product-preview img,
  .product-preview .preview-content,
  .product-preview .hero-preview-frame,
  .product-preview .live-preview-frame{width:100%!important;height:100%!important;max-width:none!important}
  .product-preview .browser{border-radius:0!important}

  /* Only price remains below the enlarged preview on catalog cards. */
  .product-info{padding:8px 9px 9px!important;min-height:43px!important}
  .product-info .type,
  .product-info h3{display:none!important}
  .price{width:100%!important;margin:0!important;gap:8px!important}
  .price strong{min-width:0!important;font-size:12px!important;line-height:1.2!important;white-space:nowrap!important}
  .price button{min-width:0!important;max-width:100%!important;padding:7px 8px!important;font-size:9px!important;line-height:1.15!important;white-space:nowrap!important}
}

@media (max-width:390px){
  .product-preview{height:200px!important;min-height:200px!important}
  .payment-option.payment-stripe{grid-template-columns:minmax(60px,72px) minmax(0,1fr) auto!important;gap:7px!important;padding-inline:9px!important}
  .payment-option.payment-stripe .payment-brand img{max-width:68px!important}
  .payment-option.payment-stripe .payment-copy strong{font-size:10px!important}
  .payment-option.payment-stripe .payment-copy small{font-size:7.5px!important}
}
