/* AS Personalizados - camada interativa: fundo em aquarela, animações, catálogo com filtros,
   galeria de trabalhos e "Monte seu produto". Carregado depois do estilo principal do index.html. */

/* ---------- fundo aquarela animado ---------- */
body { position: relative; overflow-x: hidden; }
.aq-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aq-bg i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(60px); opacity: .22; animation: aqDrift 26s ease-in-out infinite alternate; }
.aq-bg i:nth-child(1) { background: #7B2FF7; left: -12vmax; top: -14vmax; }
.aq-bg i:nth-child(2) { background: #FF2E88; right: -16vmax; top: 10vmax; animation-duration: 31s; animation-delay: -6s; }
.aq-bg i:nth-child(3) { background: #FF8A00; left: 18vmax; bottom: -22vmax; animation-duration: 34s; animation-delay: -12s; opacity: .16; }
.aq-bg i:nth-child(4) { background: #00BFA5; right: 8vmax; bottom: -18vmax; animation-duration: 29s; animation-delay: -3s; opacity: .13; }
@keyframes aqDrift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.12); } 100% { transform: translate(-4vmax, 7vmax) scale(.94); } }
:root[data-theme="dark"] .aq-bg i, :root:not([data-theme="light"]) .aq-bg i { mix-blend-mode: normal; }

/* ---------- cabeçalho ---------- */
header.top { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 0; }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #7B2FF7, #3D5AFE, #00BFA5, #43C743, #F2B600, #FF8A00, #FF2E88, #7B2FF7); background-size: 200% 100%; animation: aqRainbow 9s linear infinite; }
@keyframes aqRainbow { to { background-position: 200% 0; } }
.brand { cursor: pointer; perspective: 500px; }
.brand .mark { transition: transform .7s cubic-bezier(.3,1.5,.5,1); transform-style: preserve-3d; position: relative; }
.brand .mark::after { content: "♠"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: #FF2E88; backface-visibility: hidden; transform: rotateY(180deg); }
.brand .mark > span { backface-visibility: hidden; }
.brand:hover .mark, .brand.flip .mark { transform: rotateY(180deg) rotate(-6deg); }
nav.tabs { position: relative; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { position: relative; z-index: 1; transition: color .25s; }
nav.tabs a[aria-current="page"] { background: transparent; color: var(--surface); }
nav.tabs .tab-ind { position: absolute; z-index: 0; top: 0; height: 100%; border-radius: 999px; background: linear-gradient(135deg, #7B2FF7, #FF2E88); box-shadow: 0 6px 18px rgba(123,47,247,.35); transition: left .45s cubic-bezier(.3,1.3,.5,1), width .45s cubic-bezier(.3,1.3,.5,1); }
:root[data-theme="dark"] nav.tabs a[aria-current="page"] { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) nav.tabs a[aria-current="page"] { color: #fff; } }

/* ---------- entrada das telas e dos cartões ---------- */
section[data-view].aq-enter { animation: aqViewIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes aqViewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.aq-pop { animation: aqPop .55s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes aqPop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.panel, .kpi, .order { transition: box-shadow .25s, transform .25s; }
.order:hover { transform: translateX(3px); box-shadow: 0 6px 22px rgba(40,20,90,.08); }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: auto -20% -60% auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }

/* ---------- botões: brilho e onda ---------- */
button { position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s, background-color .2s; }
button:not(:disabled):active { transform: scale(.96); }
button.primary { background: linear-gradient(135deg, #6B35E8, #B42FD8 55%, #FF2E88); border-color: transparent; box-shadow: 0 6px 18px rgba(107,53,232,.28); }
button.primary:not(:disabled):hover { box-shadow: 0 10px 26px rgba(255,46,136,.35); }
.aq-ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.55); pointer-events: none; animation: aqRipple .6s ease-out forwards; }
@keyframes aqRipple { to { transform: scale(4); opacity: 0; } }

/* ---------- cartões com inclinação 3D ---------- */
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; will-change: transform; }
.tilt:hover { box-shadow: 0 18px 40px rgba(40,20,90,.16); }
.tilt .shine { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.45), transparent 45%); opacity: 0; transition: opacity .3s; z-index: 2; }
.tilt:hover .shine { opacity: 1; }
.pcard { position: relative; }
.pcard .thumb { position: relative; overflow: hidden; cursor: zoom-in; }
.pcard .thumb img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.pcard:hover .thumb img { transform: scale(1.07); }
.pcard .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pcard .tags .pill { font-size: 11px; padding: 1px 7px; }
.pcard .price-badge { position: absolute; top: 10px; right: 10px; z-index: 1; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, #FF2E88, #FF8A00); box-shadow: 0 4px 12px rgba(255,46,136,.35); }

/* ---------- barra de filtros do catálogo ---------- */
.aq-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 12px; }
.aq-search { position: relative; }
.aq-search input { padding-left: 38px; border-radius: 999px; }
.aq-search::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; }
.aq-toolbar select { border-radius: 999px; width: auto; }
.chips.tags-row { margin-bottom: 14px; }
.chip { transition: background-color .2s, color .2s, transform .2s, border-color .2s; }
.chip:hover { transform: translateY(-1px); border-color: var(--accent); }
.chip[aria-pressed="true"] { background: linear-gradient(135deg, #7B2FF7, #FF2E88); border-color: transparent; color: #fff; }
.chip.tag[aria-pressed="true"] { background: linear-gradient(135deg, #FF8A00, #FF2E88); }
.aq-count { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }

/* ---------- visualização rápida (lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 40; background: rgba(12,8,24,.86); display: grid; place-items: center; padding: 18px; animation: aqFade .25s ease both; }
@keyframes aqFade { from { opacity: 0; } }
.lb-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; background: var(--surface); border-radius: 18px; overflow: hidden; width: min(920px, 100%); max-height: 92vh; animation: aqPop .4s cubic-bezier(.2,.9,.3,1.2) both; }
.lb-card .lb-img { background: #111; display: grid; place-items: center; min-height: 280px; }
.lb-card .lb-img img { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; }
.lb-card .lb-info { padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
@media (max-width: 720px) { .lb-card { grid-template-columns: 1fr; overflow: auto; } .lb-card .lb-img img { max-height: 50vh; } }
.lb-close, .lb-nav { position: fixed; z-index: 41; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; padding: 0; backdrop-filter: blur(6px); }
.lb-close { top: 16px; right: 16px; }
.lb-nav.prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-nav.next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,.28); }
.lb-photo { max-width: min(1100px, 100%); max-height: 82vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: aqPop .35s cubic-bezier(.2,.9,.3,1.2) both; }
.lb-caption { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); color: #fff; text-align: center; font-weight: 600; max-width: 90vw; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.lb-caption small { display: block; font-weight: 500; opacity: .8; }
.lb-tools { position: fixed; top: 16px; left: 16px; z-index: 41; display: flex; gap: 8px; }
.lb-tools button { background: rgba(255,255,255,.14); color: #fff; border: 0; }

/* ---------- galeria ---------- */
.gal-grid { columns: 4 220px; column-gap: 14px; }
.gcard { break-inside: avoid; margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--surface); border: 1px solid var(--line); cursor: zoom-in; }
.gcard img { width: 100%; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1), filter .4s; }
.gcard:hover img { transform: scale(1.05); }
.gcard .gcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; color: #fff; font-weight: 600; font-size: 14px; background: linear-gradient(transparent, rgba(10,5,25,.75)); transform: translateY(40%); opacity: 0; transition: transform .35s, opacity .35s; }
.gcard:hover .gcap, .gcard:focus-visible .gcap { transform: none; opacity: 1; }
.gcard .gflag { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: #9a5b00; }
.upl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upl-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 120px; }
.upl-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7B2FF7, #FF2E88, #FF8A00); transition: width .3s; }
.show { position: fixed; inset: 0; z-index: 45; background: #0B0716; display: grid; place-items: center; overflow: hidden; }
.show img { position: absolute; max-width: 92vw; max-height: 84vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); opacity: 0; transform: scale(1.06); transition: opacity 1s ease, transform 6s ease-out; }
.show img.on { opacity: 1; transform: scale(1); }
.show .show-brand { position: absolute; left: 24px; bottom: 22px; color: #fff; font-family: var(--display); font-size: 22px; font-weight: 700; z-index: 2; }
.show .show-brand span { display: block; font-family: var(--body); font-size: 14px; font-weight: 500; opacity: .8; }
.show .show-dots { position: absolute; bottom: 26px; right: 24px; display: flex; gap: 6px; z-index: 2; }
.show .show-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background .3s, width .3s; }
.show .show-dots i.on { width: 22px; border-radius: 6px; background: linear-gradient(90deg, #FF2E88, #FF8A00); }

/* ---------- Monte seu produto ---------- */
.mp-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mp-type { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 600; }
.mp-type .ico { font-size: 30px; transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.mp-type:hover .ico { transform: translateY(-4px) rotate(-8deg) scale(1.1); }
.mp-type[aria-pressed="true"] { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #7B2FF7, #FF2E88, #FF8A00) border-box; box-shadow: 0 8px 22px rgba(123,47,247,.18); }
.mp-type small { color: var(--muted); font-weight: 500; font-size: 12px; }
.mp-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.mp-font { padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-font[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mp-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 0; transition: transform .2s; }
.mp-sw:hover { transform: scale(1.12); }
.mp-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.12); }
.mp-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mp-theme { padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; font-size: 12px; }
.mp-theme i { display: block; height: 38px; }
.mp-theme span { padding: 5px 4px; }
.mp-theme[aria-pressed="true"] { border-color: var(--accent); }
.mp-stage { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, #ffffff, #EEE9F8 70%); touch-action: none; user-select: none; }
:root[data-theme="dark"] .mp-stage { background: radial-gradient(circle at 50% 35%, #3A3352, #1D1A28 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mp-stage { background: radial-gradient(circle at 50% 35%, #3A3352, #1D1A28 70%); } }
.mp-stage canvas { display: block; width: 100%; height: auto; cursor: grab; }
.mp-stage canvas:active { cursor: grabbing; }
.mp-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); pointer-events: none; transition: opacity .5s; white-space: nowrap; }
.mp-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.mp-total { font-family: var(--display); font-size: 30px; font-weight: 700; background: linear-gradient(90deg, #7B2FF7, #FF2E88, #FF8A00); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { border: 0; border-radius: 0; padding: 8px 14px; font-size: 18px; line-height: 1; }
.stepper input { border: 0; width: 56px; text-align: center; border-radius: 0; padding: 8px 4px; }
.mp-photo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-photo-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- confete ---------- */
#aqConfetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

@media (prefers-reduced-motion: reduce) {
  .aq-bg i, header.top::after { animation: none; }
  section[data-view].aq-enter, .aq-pop, .lb-card, .lb-photo { animation: none; }
  .tilt { transform: none !important; }
  .show img { transition: opacity .3s; transform: none !important; }
}
