/*
Theme Name: Biguá 3D
Description: Vitrine de produtos impressos em 3D com página de login e painel para cadastrar e editar produtos.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: bigua3d
*/

:root {
	--bed: #E7ECEE;
	--ink: #0B1A22;
	--muted: #475A66;
	--blue: #1C4ED8;
	--blue-d: #173FAE;
	--amber: #F5B21B;
	--white: #fff;
	--line: rgba(11, 26, 34, .18);
	--r: 6px;
	--font-d: 'Unbounded', system-ui, sans-serif;
	--font-b: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--wrap: 1160px;
	--hdr: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bed); color: var(--ink); font: 400 1rem/1.6 var(--font-b); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.12; margin: 0; letter-spacing: -.02em; font-weight: 600; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.25rem; min-height: 46px; border-radius: var(--r); border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 600 .95rem var(--font-b); text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn--amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn--amber:hover { background: #fff; border-color: #fff; color: var(--ink); }
.btn--danger { border-color: #B42318; color: #B42318; }
.btn--danger:hover { background: #B42318; border-color: #B42318; color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: .4rem .9rem; font-size: .875rem; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Cabeçalho */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(231, 236, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--hdr); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 700 1.15rem var(--font-d); letter-spacing: -.03em; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand-3d { background: var(--ink); color: var(--amber); padding: .1em .4em; border-radius: var(--r); font-size: .9em; }
.custom-logo { max-height: 48px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 5px; }
.nav__toggle { display: none; min-height: 44px; padding: .4rem .9rem; border: 2px solid var(--ink); border-radius: var(--r); background: transparent; font: 600 .9rem var(--font-b); color: var(--ink); cursor: pointer; }
@media (max-width: 760px) {
	.nav__toggle { display: inline-block; }
	.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--bed); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; }
	.nav.is-open { display: flex; }
	.nav a { padding: .8rem 0; }
	.nav .btn { margin-top: .5rem; }
}

/* Página inicial */
.hero { background-image: linear-gradient(rgba(11, 26, 34, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 26, 34, .06) 1px, transparent 1px); background-size: 32px 32px; border-bottom: 1px solid var(--line); }
.hero__in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero__title { font-size: clamp(2.1rem, 5.2vw, 3.9rem); max-width: 16ch; }
.hero__text { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin: 1.25rem 0 1.75rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__art { justify-self: center; width: min(100%, 340px); }
@media (max-width: 860px) {
	.hero__in { grid-template-columns: 1fr; }
	.hero__art { order: -1; width: 190px; justify-self: start; }
}

.vase { width: 100%; height: auto; display: block; overflow: visible; }
.vase .layer { transform-box: fill-box; transform-origin: center; animation: print .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 300ms); }
.vase .nozzle { animation: nozzle .6s ease-out both; animation-delay: calc(var(--n) * 70ms + 600ms); }
@keyframes print { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes nozzle { from { transform: translateY(-34px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.vase .layer, .vase .nozzle { animation: none; }
	html { scroll-behavior: auto; }
}

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section--white { background: var(--white); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.section__title { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 40px; padding: .4rem .95rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 500 .9rem var(--font-b); cursor: pointer; }
.chip:hover { background: rgba(11, 26, 34, .08); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Produtos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.card { display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card__media { position: relative; display: block; aspect-ratio: 1; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover .card__media { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__ph { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(0deg, var(--bed) 0 6px, var(--white) 6px 12px); }
.card__ph svg { width: 40%; height: auto; }
.card__price { position: absolute; right: 0; bottom: 0; background: var(--amber); color: var(--ink); font: 700 .95rem var(--font-d); padding: .45rem .8rem; border-top-left-radius: var(--r); }
.card__body { display: flex; flex-direction: column; gap: .2rem; padding-top: .85rem; flex: 1; }
.card__cat { font-size: .875rem; color: var(--muted); }
.card__title { font: 700 1.1rem/1.3 var(--font-b); letter-spacing: 0; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.card__status { display: inline-flex; align-items: center; gap: .45rem; font-size: .875rem; font-weight: 500; }
.card__status::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.status--disponivel { color: #0F7A4B; }
.status--encomenda { color: #8A5A00; }
.status--esgotado { color: #55646E; }
.card__actions { margin-top: auto; padding-top: .9rem; }

.empty { border: 1.5px dashed var(--ink); border-radius: var(--r); padding: 2.5rem 1.5rem; text-align: center; background: rgba(255, 255, 255, .55); }
.empty h3 { font-size: 1.2rem; margin-bottom: .5rem; }

/* Como comprar */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.step { border-top: 3px solid var(--ink); padding-top: 1rem; counter-increment: s; }
.step::before { content: counter(s); display: block; margin-bottom: .75rem; font: 700 2.2rem/1 var(--font-d); color: var(--blue); }
.step h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step p { color: var(--muted); margin: 0; }

/* Contato e rodapé */
.cta { background-color: var(--ink); color: #fff; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 12px); }
.cta__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 3.25rem; }
.cta__title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); max-width: 20ch; }
.cta__links { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta .btn:not(.btn--amber) { border-color: #fff; color: #fff; }
.cta .btn:not(.btn--amber):hover { background: #fff; color: var(--ink); }

.site-footer { background: var(--ink); color: #C9D4DA; padding-block: 1.75rem; font-size: .9rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.site-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; }
.site-footer a { color: #fff; }

/* Janela do produto */
.modal { border: 0; padding: 0; border-radius: var(--r); width: min(920px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); background: var(--white); color: var(--ink); overflow: auto; }
.modal::backdrop { background: rgba(11, 26, 34, .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal__in { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.modal__img { position: relative; aspect-ratio: 1; background: var(--bed); }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__info { display: flex; flex-direction: column; gap: .75rem; padding: 2rem 1.75rem 1.75rem; }
.modal__title { font-size: 1.5rem; }
.modal__price { font: 700 1.5rem var(--font-d); }
.modal__desc { white-space: pre-line; color: var(--muted); margin: 0; }
.modal__close { position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.modal__close:hover { background: var(--ink); color: #fff; }
@media (max-width: 700px) { .modal__in { grid-template-columns: 1fr; } }

/* Página do produto */
.product { padding-block: 2rem 4rem; }
.product__back { display: inline-block; margin-bottom: 1.25rem; font-weight: 500; }
.product__in { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.product__img { position: relative; aspect-ratio: 1; background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__info { display: flex; flex-direction: column; gap: .75rem; }
.product__title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.product__price { font: 700 1.7rem var(--font-d); }
@media (max-width: 760px) { .product__in { grid-template-columns: 1fr; } }

/* Login */
.auth { display: grid; place-items: center; min-height: calc(100dvh - var(--hdr)); padding: 2rem 1rem; background-image: linear-gradient(rgba(11, 26, 34, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 26, 34, .06) 1px, transparent 1px); background-size: 32px 32px; }
.auth__card { width: min(100%, 440px); background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r); padding: 2rem; box-shadow: 6px 6px 0 var(--ink); }
.auth__title { font-size: 1.8rem; margin-bottom: .5rem; }
.auth__text { color: var(--muted); }
.auth__links { margin: 1.25rem 0 0; font-size: .9rem; text-align: center; }

/* Formulários */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field > label, .label { font-weight: 600; font-size: .95rem; }
.input, .textarea, .select { width: 100%; min-height: 46px; padding: .7rem .9rem; border: 1.5px solid var(--ink); border-radius: var(--r); background: #fff; color: var(--ink); font: inherit; }
.textarea { min-height: 140px; resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.pwd { position: relative; }
.pwd .input { padding-right: 5.5rem; }
.pwd__btn { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); min-height: 36px; padding: .2rem .7rem; border: 0; border-radius: var(--r); background: transparent; color: var(--blue); font: 600 .875rem var(--font-b); cursor: pointer; }
.notice { padding: .8rem 1rem; margin-bottom: 1.25rem; border: 1.5px solid; border-radius: var(--r); font-weight: 500; }
.notice a { font-weight: 700; }
.notice--error { background: #FDECEA; border-color: #B42318; color: #7A1810; }
.notice--ok { background: #E6F4EC; border-color: #0F7A4B; color: #0B5A38; }
.notice--warn { background: #FFF4D6; border-color: #8A5A00; color: #5A3B00; }

/* Painel */
.panel { padding-block: 2rem 4rem; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.panel__title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.panel__tools { display: flex; flex-wrap: wrap; gap: .6rem; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.row { display: grid; grid-template-columns: 72px 1fr auto; gap: 1rem; align-items: center; padding: .65rem; background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r); }
.row__thumb { width: 72px; height: 72px; border-radius: 4px; object-fit: cover; background: var(--bed); }
.row__thumb--empty { display: grid; place-items: center; font-size: .75rem; color: var(--muted); text-align: center; }
.row__title { font-weight: 700; }
.row__meta { font-size: .9rem; color: var(--muted); }
.row__actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.tag { display: inline-block; margin-left: .4rem; padding: 0 .5rem; border: 1.5px solid var(--ink); border-radius: 999px; font-size: .75rem; font-weight: 600; vertical-align: middle; }
@media (max-width: 640px) {
	.row { grid-template-columns: 72px 1fr; }
	.row__actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.editor { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; padding: 1.5rem; background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r); }
.editor__side { display: grid; gap: .6rem; }
.photo-preview { display: grid; place-items: center; aspect-ratio: 1; padding: .5rem; overflow: hidden; border: 1.5px dashed var(--ink); border-radius: var(--r); background: var(--bed); color: var(--muted); text-align: center; font-size: .9rem; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.editor__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
@media (max-width: 820px) {
	.editor { grid-template-columns: 1fr; }
	.editor__side { order: -1; }
}

/* Páginas comuns */
.content { max-width: 70ch; padding-block: 3rem 4rem; }
.content h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 1.25rem; }
.content h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; }
