/* ==========================================================================
   Arte&Flor - camada publica final
   Ajustes pontuais para vitrine, responsividade e sobreposicao.
   ========================================================================== */

:root {
  --public-surface: #fffdf8;
  --public-surface-strong: #ffffff;
  --public-ink: #213f31;
  --public-muted: #5f6d64;
  --public-border: rgba(33, 63, 49, .14);
  --public-shadow: 0 14px 34px rgba(38, 52, 42, .10);
  --public-shadow-soft: 0 8px 22px rgba(38, 52, 42, .08);
  --public-radius: 18px;
}

body {
  overflow-x: clip;
}

body,
body * {
  letter-spacing: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  isolation: isolate;
  background: rgba(255, 253, 248, .94);
  border-bottom: 1px solid var(--public-border);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 74px;
  gap: 16px;
}

.brand {
  min-width: max-content;
}

.main-nav {
  min-width: 0;
}

.main-nav a,
.btn {
  white-space: normal;
  line-height: 1.18;
}

.header-support {
  flex: 0 0 auto;
}

.hero,
.page-header {
  overflow: hidden;
}

.hero-grid,
.page-header-grid,
.section-heading,
.delivery-grid,
.split-feature,
.product-detail,
.checkout-layout,
.cart-layout,
.client-layout {
  align-items: start;
}

.hero h1,
.section-title {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.section-subtitle,
.hero p,
.product-body p,
.card p,
.post-card-body p,
.client-order-detail p {
  overflow-wrap: anywhere;
}

.hero-trust {
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  flex-wrap: wrap;
}

.grid-3,
.category-grid,
.steps-grid,
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.product-grid-spaced {
  align-items: stretch;
}

.card,
.product-card,
.category-card,
.catalog-toolbar,
.catalog-mini-summary,
.product-buy-box,
.post-card,
.client-search-card,
.client-order-detail,
.cart-summary {
  border-radius: var(--public-radius);
  box-shadow: var(--public-shadow-soft);
}

.product-card {
  min-width: 0;
  background: var(--public-surface);
}

.product-img {
  min-height: 190px;
}

.product-img img {
  object-position: center;
}

.floating-tag,
.product-img .floating-tag {
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.product-body h3 {
  min-height: 0;
  overflow-wrap: anywhere;
}

.product-badges,
.tag-row,
.product-card-tags {
  min-width: 0;
  flex-wrap: wrap;
}

.badge,
.status,
.tag-row span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.price-stack {
  margin-top: auto;
}

.product-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.product-actions .btn,
.product-actions a,
.product-actions button {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.catalog-toolbar-public {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.catalog-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 14px;
}

.catalog-search input,
.catalog-filter-grid select {
  width: 100%;
}

.catalog-check {
  min-height: 46px;
  align-self: end;
}

.catalog-filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.catalog-filter-actions .btn {
  min-width: 112px;
}

.catalog-mini-summary {
  width: min(100%, 260px);
}

.product-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.product-color-grid,
.form-grid,
.checkout-fields-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.whatsapp-float {
  z-index: 8500;
  max-width: calc(100vw - 28px);
  right: 14px;
  bottom: 14px;
  white-space: nowrap;
}

.toast-root {
  z-index: 9500;
}

@media (min-width: 921px) {
  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu-toggle {
    display: none;
  }
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .header-support {
    display: none;
  }

  .catalog-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-check,
  .catalog-filter-actions {
    align-self: stretch;
  }

  .catalog-filter-actions {
    justify-content: stretch;
  }

  .catalog-filter-actions .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 920px) {
  .site-header {
    z-index: 9000;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .menu-toggle {
    position: relative;
    z-index: 9040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid var(--public-border);
    border-radius: 12px;
    background: var(--public-surface-strong);
    color: var(--public-ink);
    pointer-events: auto;
    touch-action: manipulation;
  }

  .menu-toggle-text {
    display: none;
  }

  .menu-toggle-icon {
    width: 21px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .menu-toggle-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .menu-toggle.is-open .menu-toggle-icon span:nth-child(1),
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-open .menu-toggle-icon span:nth-child(2),
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open .menu-toggle-icon span:nth-child(3),
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8990;
    display: none;
    background: rgba(18, 32, 24, .34);
    backdrop-filter: blur(2px);
    pointer-events: auto;
  }

  body.menu-open .mobile-menu-backdrop {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 82px;
    left: 14px;
    right: 14px;
    z-index: 9030;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--public-border);
    border-radius: var(--public-radius);
    background: var(--public-surface);
    box-shadow: 0 22px 56px rgba(33, 45, 38, .22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 170ms ease, visibility 170ms ease, transform 170ms ease;
  }

  .main-nav.open,
  body.menu-open .main-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .main-nav a {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(33, 63, 49, .10);
    border-radius: 12px;
    background: #fff;
    color: var(--public-ink);
  }

  .main-nav a::after {
    content: ">";
    color: #557f63;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .section {
    padding: 46px 0;
  }

  .hero,
  .page-header {
    padding-block: 44px;
  }

  .hero h1,
  .section-title,
  .page-header .section-title,
  .catalog-header .section-title {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1.06;
  }

  .section-heading,
  .page-header-grid {
    gap: 16px;
  }

  .hero-grid,
  .page-header-grid,
  .product-detail,
  .checkout-layout,
  .cart-layout,
  .client-layout {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 260px;
  }

  .catalog-filter-grid,
  .catalog-filter-actions,
  .product-actions {
    grid-template-columns: 1fr;
  }

  .catalog-filter-actions {
    display: grid;
  }

  .catalog-mini-summary {
    width: 100%;
  }

  .whatsapp-float {
    left: 14px;
    right: 14px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: .98rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .product-img {
    min-height: 170px;
  }

  .cart-item,
  .checkout-step-panel,
  .checkout-step-header,
  .product-buy-box {
    padding-inline: 16px;
  }
}
