/* ==========================================================================
   structural.css — defaults estruturais das páginas do `base`
   (PDP, carrinho, checkout, conta, pedido, breadcrumb, paginação…).

   Carregado por cada tema ANTES do seu `theme.css`, então o tema pode
   sobrescrever tudo. Garante que temas "magros" (que herdam os templates do
   base) não fiquem com elementos crus. Tudo via var(--color-*) → pega a
   paleta do tema. Referência: default-theme/assets/theme.css.
   Ver docs/themes/ui-ux-regras.md (regra #7).
   ========================================================================== */

.container--narrow { max-width: 800px; margin: 0 auto; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-muted, #777); }
.empty-state .btn { margin-top: 1rem; }
.btn-icon { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 4px; background: transparent; cursor: pointer; }
.btn-text { background: none; border: none; padding: 0; cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--color-primary, #333); text-decoration: none; }
.btn-text:hover { text-decoration: underline; }
.btn-text--danger { color: #dc2626; }

/* === Breadcrumb === */
.breadcrumb { padding: .75rem 0 .25rem; font-size: .82rem; color: var(--color-muted, #888); }
.breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; list-style: none; padding: 0; margin: 0; }
.breadcrumb__item { display: inline-flex; align-items: center; }
.breadcrumb__item + .breadcrumb__item::before { content: '/'; margin-right: .5rem; color: #cbd5e1; }
.breadcrumb__link { color: var(--color-muted, #888); text-decoration: none; }
.breadcrumb__link:hover { color: var(--color-primary); text-decoration: underline; }
.breadcrumb__item--active { color: var(--color-text, #333); font-weight: 600; }

/* === Product page (2 colunas no desktop) === */
.product-page { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .product-page { grid-template-columns: 1fr 1fr; align-items: start; } }
.product-page__gallery { min-width: 0; overflow: hidden; }
.product-page__title { font-size: 1.75rem; margin-bottom: .75rem; }
.product-page__description { margin: 1.5rem 0; color: var(--color-muted, #666); }
.product-sku { font-size: .8rem; color: var(--color-muted, #888); margin-bottom: .5rem; }

/* Galeria: slider (mobile) + principal+miniaturas (desktop) */
.product-gallery { overflow: hidden; }
.product-gallery__slider-wrap { position: relative; }
.product-gallery__slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.product-gallery__slider::-webkit-scrollbar { display: none; }
.product-gallery__slide { flex: 0 0 100%; scroll-snap-align: start; }
.product-gallery__slide img, .product-gallery__slide video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.product-gallery__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,.85); border: none; font-size: 1.5rem; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.product-gallery__arrow--prev { left: .5rem; }
.product-gallery__arrow--next { right: .5rem; }
.product-gallery__dots { display: flex; justify-content: center; gap: .5rem; margin-top: .75rem; }
.product-gallery__dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: #cbd5e1; cursor: pointer; padding: 0; }
.product-gallery__dot.active { background: var(--color-primary); }
.product-gallery__main { width: 100%; max-width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; display: none; }
.product-gallery__main img, .product-gallery__main video { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery__thumbs { display: none !important; gap: .5rem; margin-top: .75rem; overflow-x: auto; scrollbar-width: none; }
.product-gallery__thumbs::-webkit-scrollbar { display: none; }
.product-gallery__thumb { position: relative; width: 64px; height: 64px; border: 2px solid transparent; border-radius: 6px; overflow: hidden; padding: 0; background: none; cursor: pointer; flex-shrink: 0; }
.product-gallery__thumb.active { border-color: var(--color-primary); }
.product-gallery__thumb img, .product-gallery__thumb video { width: 100%; height: 100%; object-fit: cover; }
.product-gallery__thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.7); pointer-events: none; }
.product-gallery__placeholder { aspect-ratio: 1; background: #f1f5f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 768px) {
  .product-gallery__slider-wrap { display: none !important; }
  .product-gallery__dots { display: none !important; }
  .product-gallery__main { display: block !important; }
  .product-gallery__thumbs { display: flex !important; }
}

/* Form de compra / quantidade */
.product-form { margin-top: 1.5rem; }
.product-form__variants { margin-bottom: 1rem; }
.variant-group { margin-bottom: .75rem; }
.variant-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .25rem; }
.variant-group select { width: 100%; padding: .5rem; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 1rem; }
.product-form__quantity { margin-bottom: 1rem; }
.product-form__quantity label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.qty-selector { display: flex; align-items: center; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden; width: fit-content; }
.qty-selector__btn { width: 48px; height: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; font-size: 1.25rem; color: var(--color-text, #222); cursor: pointer; }
.qty-selector__btn:hover { background: #f1f5f9; }
.qty-selector__input { width: 48px; height: 44px; text-align: center; border: none; font-size: 1.125rem; font-weight: 600; background: transparent; color: var(--color-text, #222); -moz-appearance: textfield; }
.qty-selector__input::-webkit-outer-spin-button, .qty-selector__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.share-btn { margin-top: .5rem; gap: .5rem; font-size: .875rem; }
.free-shipping-banner { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; padding: .625rem .875rem; border-radius: 8px; font-size: .8rem; line-height: 1.4; background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.free-shipping-banner--success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.free-shipping-banner svg { flex-shrink: 0; }
.shipping-calc { margin-top: 1.5rem; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; }
.shipping-calc__title { font-size: .9rem; font-weight: 600; margin-bottom: .75rem; }
.shipping-calc__form { display: flex; gap: .5rem; }
.shipping-calc__input { flex: 1; padding: .5rem .75rem; border: 1px solid #e2e8f0; border-radius: 6px; font-size: .875rem; }
.shipping-calc__input:focus { outline: none; border-color: var(--color-primary); }
.shipping-calc__btn { padding: .5rem 1rem; background: var(--color-primary); color: #fff; border: none; border-radius: 6px; font-size: .875rem; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* === Carrinho === */
.cart { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .cart { grid-template-columns: 2fr 1fr; align-items: start; } }
.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #e2e8f0; }
.cart-item__image { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.cart-item__details { flex: 1; min-width: 0; }
.cart-item__name { font-size: .9rem; font-weight: 600; }
.cart-item__name a:hover { color: var(--color-primary); }
.cart-item__variant { font-size: .8rem; color: var(--color-muted, #888); }
.cart-item__price { font-weight: 600; margin-top: .25rem; }
.cart-item__actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.cart-quantity { display: inline-flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.cart-quantity .btn-icon { width: 32px; height: 34px; border: 0; border-radius: 0; background: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.cart-quantity .btn-icon:hover { background: #f1f5f9; }
.cart-quantity__value { min-width: 34px; text-align: center; font-weight: 700; }
.cart-item__total { font-weight: 800; }
.cart-item__total--sale { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.cart-item__total-compare { font-size: .8rem; font-weight: 600; text-decoration: line-through; opacity: .55; }
.cart-item__total-now { font-weight: 800; }
.cart-item--gift { background: #f0fdf4; border-radius: 8px; padding: .75rem; border-bottom: none; margin-bottom: .5rem; }
.gift-item-badge { display: inline-block; background: #16a34a; color: #fff; font-size: .625rem; font-weight: 700; padding: .125rem .5rem; border-radius: 9999px; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }
.cart-item__price--free { color: #16a34a; }
.cart-summary { background: #f8fafc; padding: 1.5rem; border-radius: 8px; height: fit-content; border: 1px solid #e2e8f0; }
.cart-summary__row { display: flex; justify-content: space-between; font-size: 1.125rem; font-weight: 700; margin-bottom: .75rem; }
.cart-summary__note { font-size: .8rem; color: var(--color-muted, #888); margin-bottom: 1rem; }
.cart-coupon { margin: 1rem 0; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 8px; }
.cart-coupon__form { display: flex; gap: .5rem; }
.cart-coupon__input { flex: 1; padding: .5rem; border: 1px solid #e2e8f0; border-radius: 6px; }
.cart-coupon__error { color: #dc2626; font-size: .85rem; margin-top: .5rem; }

/* === Checkout === */
.checkout { margin-top: 1.5rem; }
.checkout-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.checkout-section h2 { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid #f1f5f9; }
.checkout-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .25rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: .55rem .75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--color-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-group--small { max-width: 140px; }
.checkout-items { border-top: 1px solid #f1f5f9; padding-top: .75rem; }
.checkout-item { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; font-size: .9rem; }
.checkout-item__img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #f1f5f9; flex-shrink: 0; }
.checkout-item__info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.checkout-item__name { font-weight: 500; }
.checkout-item__var, .checkout-item__qty { font-size: .78rem; color: var(--color-muted); }
.checkout-item__price { font-weight: 600; white-space: nowrap; margin-left: auto; }
.checkout-summary-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .92rem; color: var(--color-muted); }
.checkout-summary-row--discount { color: #16a34a; }
.checkout-total { display: flex; justify-content: space-between; padding-top: .75rem; margin-top: .5rem; border-top: 2px solid #e2e8f0; font-weight: 700; font-size: 1.1rem; }
.checkout-shipping { border-top: 1px solid #f1f5f9; padding-top: .75rem; margin: .25rem 0; }
.checkout-shipping__label { font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--color-muted); margin-bottom: .5rem; }
.checkout-shipping__opt { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: .5rem; cursor: pointer; font-size: .9rem; }
.checkout-shipping__opt:has(input:checked) { border-color: var(--color-primary); background: #fafbff; }
.checkout-shipping__info { flex: 1; }
.checkout-shipping__info small { color: var(--color-muted); }
.checkout-shipping__price { font-weight: 600; white-space: nowrap; }
.checkout-payment .checkout-pay { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; }
.checkout-pay__icon { color: var(--color-primary); flex-shrink: 0; display: flex; }
.checkout-pay__text { display: flex; flex-direction: column; }
.checkout-pay__text strong { font-size: .95rem; }
.checkout-pay__text span { font-size: .82rem; color: var(--color-muted); }
.checkout-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; margin-top: 1rem; }
.checkout-trust__item { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--color-muted); }
.checkout-trust__item svg { color: var(--color-primary); flex-shrink: 0; }

/* Checkout em etapas (dados -> endereco -> frete -> resumo -> pagamento) */
.steps-nav { display: flex; list-style: none; padding: 0; margin: 0 0 1.5rem; gap: .25rem; }
.steps-nav__item { flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem; text-align: center; font-size: .78rem; color: var(--color-muted); padding: .5rem .25rem; border-bottom: 2px solid #e2e8f0; }
.steps-nav__num { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #e2e8f0; color: #64748b; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.steps-nav__item.is-active { color: var(--color-primary); border-color: var(--color-primary); font-weight: 600; }
.steps-nav__item.is-active .steps-nav__num, .steps-nav__item.is-done .steps-nav__num { background: var(--color-primary); color: #fff; }
.steps-nav__item.is-done { color: var(--color-primary); border-color: var(--color-primary); cursor: pointer; }
@media (max-width: 560px) { .steps-nav__item { font-size: 0; gap: 0; } }
.step[hidden] { display: none; }
.step-actions { display: flex; gap: .75rem; margin-top: 1rem; }
.step-actions .btn { flex: 1; }
.step-actions .btn--outline { flex: 0 0 auto; }

/* === Conta === */
.account-auth { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 1.5rem; }
@media (min-width: 768px) { .account-auth { grid-template-columns: 1fr auto 1fr; } }
.account-auth__panel h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.account-auth__divider { display: none; }
@media (min-width: 768px) { .account-auth__divider { display: block; width: 1px; background: #e2e8f0; } }
.account-auth__forgot { display: block; text-align: center; margin-top: .75rem; font-size: .875rem; color: var(--color-primary); }
.account-alert { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.account-alert--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.account-alert--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.account-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 1.5rem; }
.account-header h1 { font-size: 1.5rem; }
.account-info { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem; margin-bottom: 2rem; }
.account-info__name { font-weight: 700; font-size: 1.1rem; }
.account-info__email { color: var(--color-muted, #888); font-size: .9rem; margin-top: .25rem; }
.account-section { margin-bottom: 2rem; }
.account-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.account-section__header h2 { font-size: 1.1rem; }
.account-orders-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
.account-orders-table { width: 100%; border-collapse: collapse; }
.account-orders-table th { text-align: left; font-size: .75rem; font-weight: 700; color: var(--color-muted, #888); text-transform: uppercase; letter-spacing: .03em; padding: .65rem .75rem; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.account-orders-table td { padding: .75rem; border-bottom: 1px solid #f1f5f9; font-size: .9rem; white-space: nowrap; }
.account-orders-table tr:last-child td { border-bottom: none; }
.account-orders-table tr:hover td { background: #f8fafc; }

/* === Status do pedido === */
.order-status { display: inline-block; padding: .2rem .625rem; border-radius: 9999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: #f1f5f9; color: #475569; }
.order-status--pending { background: #fef3c7; color: #92400e; }
.order-status--confirmed, .order-status--separating { background: #dbeafe; color: #1e40af; }
.order-status--awaiting_pickup, .order-status--shipped { background: #e0e7ff; color: #3730a3; }
.order-status--delivered { background: #dcfce7; color: #166534; }
.order-status--cancelled { background: #fee2e2; color: #991b1b; }

/* === Detalhe do pedido === */
.order-detail { margin-top: 1rem; }
.order-detail__meta { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 1.5rem; padding: 1rem; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.order-detail__meta-item { display: flex; flex-direction: column; gap: .25rem; }
.order-detail__label { font-size: .75rem; font-weight: 700; color: var(--color-muted, #888); text-transform: uppercase; }
.order-detail__items { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; margin-top: .75rem; }
.order-detail__item { display: flex; gap: 1rem; padding: 1rem; border-bottom: 1px solid #f1f5f9; align-items: center; }
.order-detail__item:last-child { border-bottom: none; }
.order-detail__item-image { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.order-detail__item-placeholder { width: 64px; height: 64px; border-radius: 6px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.order-detail__item-info { flex: 1; min-width: 0; }
.order-detail__item-name { font-weight: 600; }
.order-detail__item-variant, .order-detail__item-qty { font-size: .8rem; color: var(--color-muted, #888); margin-top: .125rem; }
.order-detail__item-price { font-weight: 700; white-space: nowrap; }
.order-detail__totals { margin-top: 1.25rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem; }
.order-detail__total-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .9rem; }
.order-detail__total-row--final { border-top: 2px solid #e2e8f0; margin-top: .5rem; padding-top: .75rem; font-weight: 700; font-size: 1.1rem; }
.order-detail__address, .order-detail__notes { margin-top: 1.25rem; }
.order-detail__address h3, .order-detail__notes h3 { font-size: .95rem; margin-bottom: .5rem; }
.order-detail__address p, .order-detail__notes p { font-size: .9rem; color: var(--color-muted, #888); line-height: 1.5; }
.order-paybar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.order-paybar__txt strong { display: block; font-weight: 700; color: #9a3412; }
.order-paybar__txt span { font-size: .85rem; color: var(--color-muted, #888); }

/* === Paginação === */
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 2rem; }
.pagination__link { padding: .5rem .75rem; border: 1px solid #e2e8f0; border-radius: 6px; font-size: .875rem; }
.pagination__link:hover { background: #f1f5f9; }
.pagination__link--active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
