/**
 * AWA Polish Alto Nível v5 — Galeria PDP, Tabs, Cart, Nav Mobile,
 * Loading, Back-to-Top, Dashboard B2B, Reviews, CMS, Globais.
 *
 * CSS-only. Sem mudanças de template. Sem tocar em seletores B2B gate.
 * Sintaxe: rgb() moderno, media range notation, currentcolor minúsculo.
 * Carregado por último — máxima especificidade por posição de cascade.
 */

/* =============================================================
   1. GALERIA PDP — Fotorama
   ============================================================= */

/* Stage container */

.fotorama__stage {
  border-radius: var(--r-sm);
  background: var(--awa-bg-alt);
  overflow: hidden;
}

/* Nav arrows */

.fotorama__arr {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / 88%);
  border: 1.5px solid var(--awa-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.fotorama__arr:hover {
  background: var(--awa-red);
  border-color: var(--awa-red);
  box-shadow: 0 4px 12px rgb(183 51 55 / 25%);
}

.fotorama__arr--prev {
  left: 12px;
}

.fotorama__arr--next {
  right: 12px;
}

.fotorama__arr__arr {
  border-color: var(--awa-text-muted);
  transition: border-color var(--t-fast);
}

.fotorama__arr:hover .fotorama__arr__arr {
  border-color: #fff;
}

/* Thumbnails */

.fotorama__thumb {
  border: 2px solid transparent;
  border-radius: var(--r-xs);
  overflow: hidden;
  transition: border-color var(--t-fast);
}

.fotorama__thumb-border,
.fotorama__active .fotorama__thumb {
  border-color: var(--awa-red);
}

.fotorama__nav-wrap .fotorama__thumb-border {
  border-color: var(--awa-red);
  border-radius: var(--r-xs);
}

/* Nav dots */

.fotorama__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  border-color: var(--awa-border);
  background: var(--awa-border);
  transition: width var(--t-fast), background var(--t-fast);
}

.fotorama__active .fotorama__dot {
  width: 18px;
  background: var(--awa-red);
  border-color: var(--awa-red);
}

/* Caption */

.fotorama__caption__wrap {
  font-size: var(--text-xs);
  color: var(--awa-text-muted);
  background: rgb(255 255 255 / 85%);
  padding: 4px 10px;
  border-radius: 0 0 var(--r-xs) var(--r-xs);
}

/* =============================================================
   2. TABS PDP — .data.tabs
   ============================================================= */

/* Tab list container */

.data.tabs {
  border-bottom: 2px solid var(--awa-border);
  margin-bottom: 0;
}

/* Individual tab header */

.data.item.title {
  margin-right: 4px;
}

.data.item.title > a,
.data.item.title > .switch {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--awa-text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  cursor: pointer;
}

.data.item.title > a:hover,
.data.item.title > .switch:hover {
  color: var(--awa-text);
  background: var(--awa-bg-alt);
}

.data.item.title.active > a,
.data.item.title.active > .switch {
  color: var(--awa-red);
  border-bottom-color: var(--awa-red);
  background: transparent;
}

/* Tab content panel */

.data.item.content {
  padding: var(--sp-6) 0;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--awa-text);
  border: none;
}

.data.item.content h2,
.data.item.content h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--awa-text);
  margin: var(--sp-5) 0 var(--sp-3);
}

/* Product attributes table in specs tab */

.additional-attributes {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.additional-attributes th,
.additional-attributes td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--awa-border);
}

.additional-attributes th {
  font-weight: 600;
  color: var(--awa-text-muted);
  width: 40%;
  background: var(--awa-bg-alt);
}

.additional-attributes td {
  color: var(--awa-text);
}

.additional-attributes tr:last-child th,
.additional-attributes tr:last-child td {
  border-bottom: none;
}

@media (width <= 767px) {
  .data.item.title > a,
  .data.item.title > .switch {
    padding: 9px 14px;
    font-size: var(--text-xs);
  }
}

/* =============================================================
   3. CART PAGE (.checkout-cart-index)
   ============================================================= */

/* Cart table wrapper */

.checkout-cart-index .cart.table-wrapper {
  border-radius: var(--r-md);
  border: 1px solid var(--awa-border);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.checkout-cart-index .cart.table-wrapper .cart.thead {
  background: var(--awa-bg-alt);
}

.checkout-cart-index .cart.table-wrapper .cart.thead th {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--awa-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--awa-border);
}

/* Cart item rows */

.checkout-cart-index .cart.item {
  border-bottom: 1px solid var(--awa-border);
  transition: background var(--t-fast);
}

.checkout-cart-index .cart.item:last-child {
  border-bottom: none;
}

.checkout-cart-index .cart.item:hover {
  background: rgb(249 250 251 / 60%);
}

.checkout-cart-index .cart.item td {
  padding: var(--sp-4) 14px;
  vertical-align: middle;
}

/* Product name in cart */

.checkout-cart-index .product-item-name a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--awa-text);
  text-decoration: none;
  transition: color var(--t-fast);
}

.checkout-cart-index .product-item-name a:hover {
  color: var(--awa-red);
}

/* Price columns */

.checkout-cart-index .col.price .price,
.checkout-cart-index .col.subtotal .price {
  font-weight: 700;
  color: var(--awa-red);
}

/* Qty field */

.checkout-cart-index .field.qty input[type="number"] {
  width: 64px;
  text-align: center;
  font-weight: 700;
  border-radius: var(--r-xs);
}

/* Delete / edit actions */

.checkout-cart-index .action.action-delete,
.checkout-cart-index .action.action-edit {
  color: var(--awa-text-muted);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: color var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checkout-cart-index .action.action-delete:hover {
  color: var(--awa-danger);
}

.checkout-cart-index .action.action-edit:hover {
  color: var(--awa-red);
}

/* Cart summary box */

.checkout-cart-index .cart-summary {
  border-radius: var(--r-md);
  border: 1px solid var(--awa-border);
  padding: var(--sp-6);
  background: var(--awa-bg);
  box-shadow: var(--shadow-xs);
}

.checkout-cart-index .cart-summary > .title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--awa-text);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--awa-border);
  display: block;
}

/* Grand total row */

.checkout-cart-index .grand.totals td,
.checkout-cart-index .grand.totals th {
  font-size: var(--text-lg);
  font-weight: 700;
  padding-top: var(--sp-4);
  border-top: 2px solid var(--awa-border);
}

.checkout-cart-index .grand.totals .price {
  color: var(--awa-red);
  font-size: var(--text-xl);
}

/* =============================================================
   4. NAVEGACAO MOBILE (.nav-sections, .nav-toggle)
   ============================================================= */

/* Hamburger button */

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-xs);
  background: transparent;
  border: 1.5px solid var(--awa-border);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  position: relative;
}

.nav-toggle:hover {
  background: var(--awa-bg-alt);
  border-color: var(--awa-border-md);
}

.nav-toggle::before {
  font-size: 20px;
  line-height: 1;
  color: var(--awa-text);
  transition: color var(--t-fast);
}

/* Mobile nav panel */

.nav-sections {
  background: var(--awa-bg);
  box-shadow: var(--shadow-lg);
}

/* Level 0 links */

.nav-sections .navigation li.level0 > a,
.nav-sections .navigation li.level0 > .ui-state-focus,
.nav-sections .navigation li.level0.active > a {
  padding: 12px 20px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--awa-text);
  border-bottom: 1px solid var(--awa-border);
  transition: color var(--t-fast), background var(--t-fast), padding-left var(--t-fast);
}

.nav-sections .navigation li.level0 > a:hover {
  color: var(--awa-red);
  background: rgb(183 51 55 / 5%);
  padding-left: 24px;
}

/* Level 1 links */

.nav-sections .navigation li.level1 > a {
  padding: 9px 20px 9px 36px;
  font-size: var(--text-sm);
  color: var(--awa-text-muted);
  transition: color var(--t-fast);
}

.nav-sections .navigation li.level1 > a:hover {
  color: var(--awa-red);
}

/* Active state */

.nav-sections .navigation .active > a,
.nav-sections .navigation li.level0.active > a {
  color: var(--awa-red);
  border-left: 3px solid var(--awa-red);
}

/* Page overlay when nav open */

.nav-overlay {
  background: rgb(0 0 0 / 50%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* =============================================================
   5. LOADING STATES (.loading-mask)
   ============================================================= */

/* Main loading overlay */

.loading-mask {
  background: rgb(255 255 255 / 72%);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 5000;
}

/* Replace default Rokanthemes loader with CSS spinner */

.loading-mask .loader > img {
  display: none;
}

.loading-mask .loader::after {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  border: 3px solid var(--awa-border);
  border-top-color: var(--awa-red);
  animation: awa-spin 0.75s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes awa-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.loading-mask .loader > p {
  display: none;
}

/* Block-level loading */

._block-content-loading {
  position: relative;
  min-height: 80px;
}

/* =============================================================
   6. BACK TO TOP (.awa-back-to-top)
   ============================================================= */

.awa-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 80px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--awa-bg);
  border: 1.5px solid var(--awa-border);
  box-shadow: var(--shadow-md);
  color: var(--awa-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--t-base), transform var(--t-base), background var(--t-fast),
    border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.awa-back-to-top.visible,
.awa-back-to-top[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.awa-back-to-top:hover {
  background: var(--awa-red);
  border-color: var(--awa-red);
  color: #fff;
  box-shadow: 0 4px 14px rgb(183 51 55 / 28%);
  transform: translateY(-2px);
}

.awa-back-to-top:focus-visible {
  outline: 2px solid var(--awa-red);
  outline-offset: 2px;
}

@media (width <= 767px) {
  .awa-back-to-top {
    right: 16px;
    bottom: 72px;
  }
}

/* =============================================================
   7. DASHBOARD B2B E CONTA (.customer-account)
   ============================================================= */

/* Block titles */

.customer-account .block-title > strong,
.customer-account .block-title > span,
.customer-account .box-title > span {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--awa-text);
}

.customer-account .block-title,
.customer-account .box-title {
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-5);
  border-bottom: 1.5px solid var(--awa-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customer-account .block-title .action,
.customer-account .box-title .action {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--awa-red);
  text-decoration: none;
  transition: color var(--t-fast);
}

.customer-account .block-title .action:hover,
.customer-account .box-title .action:hover {
  color: var(--awa-red-dark);
}

/* Info boxes (address, account info) */

.customer-account .box-information,
.customer-account .block-content .box {
  background: var(--awa-bg-alt);
  border-radius: var(--r-sm);
  padding: var(--sp-5);
  border: 1px solid var(--awa-border);
}

.customer-account .box-content {
  font-size: var(--text-sm);
  color: var(--awa-text);
  line-height: 1.6;
}

/* Orders history table */

.customer-account .table.orders,
.customer-account .table.order-items {
  width: 100%;
  border-collapse: collapse;
}

.customer-account .table.orders thead th,
.customer-account .table.order-items thead th {
  background: var(--awa-bg-alt);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--awa-text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--awa-border);
  text-align: left;
}

.customer-account .table.orders tbody td,
.customer-account .table.order-items tbody td {
  padding: 11px 14px;
  font-size: var(--text-sm);
  color: var(--awa-text);
  border-bottom: 1px solid var(--awa-border);
  vertical-align: middle;
}

.customer-account .table.orders tbody tr:last-child td,
.customer-account .table.order-items tbody tr:last-child td {
  border-bottom: none;
}

.customer-account .table.orders tbody tr:hover td,
.customer-account .table.order-items tbody tr:hover td {
  background: var(--awa-bg-alt);
}

/* Order status badges */

.customer-account .order-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customer-account .order-status[class*="pending"],
.customer-account .order-status[class*="processing"] {
  background: rgb(217 119 6 / 12%);
  color: var(--awa-warning);
}

.customer-account .order-status[class*="complete"] {
  background: rgb(22 163 74 / 12%);
  color: var(--awa-success);
}

.customer-account .order-status[class*="cancel"],
.customer-account .order-status[class*="closed"] {
  background: rgb(220 38 38 / 10%);
  color: var(--awa-danger);
}

.customer-account .order-status[class*="holded"],
.customer-account .order-status[class*="on-hold"] {
  background: rgb(14 165 233 / 10%);
  color: var(--awa-info);
}

/* Order action links */

.customer-account .order-actions-toolbar .action,
.customer-account .table.orders .action {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--awa-red);
  text-decoration: none;
  transition: color var(--t-fast);
}

.customer-account .order-actions-toolbar .action:hover,
.customer-account .table.orders .action:hover {
  color: var(--awa-red-dark);
  text-decoration: underline;
}

/* Mobile: orders table responsive */

@media (width <= 767px) {
  .customer-account .table.orders thead {
    display: none;
  }

  .customer-account .table.orders tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: none;
  }

  .customer-account .table.orders tbody td::before {
    content: attr(data-th);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--awa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-right: var(--sp-3);
  }

  .customer-account .table.orders tbody tr {
    display: block;
    border: 1px solid var(--awa-border);
    border-radius: var(--r-sm);
    margin-bottom: var(--sp-3);
    overflow: hidden;
  }
}

/* =============================================================
   8. AVALIACOES (.product-reviews-summary, .review-*)
   ============================================================= */

/* Stars in product summary */

.product-reviews-summary .rating-summary .rating-result > span::before {
  color: var(--awa-warning);
}

.product-reviews-summary .reviews-actions a {
  font-size: var(--text-sm);
  color: var(--awa-red);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--t-fast);
}

.product-reviews-summary .reviews-actions a:hover {
  color: var(--awa-red-dark);
  text-decoration: underline;
}

/* Review list items */

.review-list .review-item {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--awa-border);
}

.review-list .review-item:last-child {
  border-bottom: none;
}

.review-list .review-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--awa-text);
  margin-bottom: var(--sp-2);
}

.review-list .review-details {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.review-list .review-details-label {
  font-size: var(--text-xs);
  color: var(--awa-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-list .review-details-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--awa-text);
}

.review-list .review-date {
  font-size: var(--text-xs);
  color: var(--awa-text-muted);
}

.review-list .review-content {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--awa-text);
}

/* Review form */

.customer-review-form,
.review-form {
  border-radius: var(--r-md);
  border: 1px solid var(--awa-border);
  padding: var(--sp-6);
  background: var(--awa-bg);
  box-shadow: var(--shadow-xs);
}

.review-form .legend,
.customer-review-form .legend {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--awa-text);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--awa-border);
  display: block;
}

/* Rating stars in form */

.review-field-ratings .control label {
  cursor: pointer;
  font-size: 24px;
  color: var(--awa-border);
  transition: color var(--t-fast);
}

.review-field-ratings .control label:hover,
.review-field-ratings .control label:hover ~ label {
  color: var(--awa-warning);
}

/* =============================================================
   9. PAGINAS CMS, 404 E ESTATICAS
   ============================================================= */

/* CMS page body copy */

.cms-page .column.main p,
.cms-page-view .column.main p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--awa-text);
  margin-bottom: var(--sp-4);
}

.cms-page .column.main h2,
.cms-page-view .column.main h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--awa-text);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-4);
  border-left: 3px solid var(--awa-red);
}

.cms-page .column.main h3,
.cms-page-view .column.main h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--awa-text);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

/* 404 page */

.cms-no-route .page-title-wrapper .page-title span {
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 700;
  color: var(--awa-border);
  line-height: 1;
}

.cms-no-route .column.main {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-4);
}

.cms-no-route .column.main p {
  font-size: var(--text-base);
  color: var(--awa-text-muted);
  margin-bottom: var(--sp-6);
}

.cms-no-route .column.main .action.primary {
  display: inline-flex;
}

/* =============================================================
   10. REFINAMENTOS GLOBAIS DE ALTO NIVEL
   ============================================================= */

/* Text selection highlight — brand color */

::selection {
  background: rgb(183 51 55 / 18%);
  color: var(--awa-text);
}

/* Custom scrollbar (webkit) */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--awa-border);
  border-radius: var(--r-full);
  transition: background var(--t-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--awa-text-muted);
}

/* Smooth scroll (with reduced-motion respect) */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Prevent image dragging in galleries */

.product-thumb img,
.fotorama__img,
.product-item-photo img {
  user-select: none;
  -webkit-user-drag: none;
}

/* Ensure all interactive elements have pointer cursor */

.action.primary,
.action.secondary,
.action.tocart,
.btn-cart,
.b2b-primary-btn {
  cursor: pointer;
}

/* Print: hide interactive-only elements */

@media print {
  .awa-whatsapp-fab,
  .awa-quote-fab,
  .awa-back-to-top,
  .block-minicart,
  .nav-toggle,
  .awa-sticky-header,
  .awa-deferred-css-loader {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }
}

/* Reduced motion: disable all AWA animations at once */

@media (prefers-reduced-motion: reduce) {
  .awa-whatsapp-fab__link,
  .awa-quote-fab__btn,
  .awa-back-to-top,
  .fotorama__arr,
  .fotorama__dot,
  .fotorama__thumb,
  .brand-widget .brand-item,
  .awa-benefit-item {
    transition: none;
    animation: none;
  }

  .loading-mask .loader::after {
    animation: none;
    border-top-color: var(--awa-red);
  }
}
