/**
 * AWA UX Components v2 — Grupo Awamotos
 * Complemento ao awa-design-system-v2.css
 *
 * Seções:
 *  1. PLP — grid 2 colunas mobile
 *  2. PDP — tabela técnica, botões B2B
 *  3. Category Grid — "Busque por Categorias" (awa-category-grid)
 *  4. Vertical Navigation — Rokanthemes sidebar menu
 *  5. Homepage rhythm — separadores e alternância de seções
 *  6. Minicart dropdown
 *  7. Rodapé — grupo de links mobile
 *
 * 2026-03-18
 */

/* ═══════════════════════════════════════════════════════════
   1. PLP — GRID 2 COLUNAS NO MOBILE
   O Rokanthemes JS define col-xs-3 (25%) por default.
   Forçamos 50% (2 colunas) em telas ≤ 575px e 33% (3 col)
   em telas 576-767px. Nenhuma mudança no desktop.
   ═══════════════════════════════════════════════════════════ */

/* Tablet: 3 colunas (576–767px) */
@media (max-width: 767px) and (min-width: 576px) {
  .wrapper.grid .product-grid > li.item-product,
  .wrapper.grid .product-grid > li[class*="col-xs-"] {
    width: 33.333% !important;
    float: left !important;
    box-sizing: border-box;
  }
}

/* Mobile pequeno: 2 colunas (< 576px) */
@media (max-width: 575px) {
  .wrapper.grid .product-grid > li.item-product,
  .wrapper.grid .product-grid > li[class*="col-xs-"] {
    width: 50% !important;
    float: left !important;
    box-sizing: border-box;
  }

  /* Padding interno dos cards reduzido em mobile */
  :is(body.catalog-category-view, body.catalogsearch-result-index)
    .wrapper.grid.products-grid .item-product > .product-info {
    padding-inline: 8px;
    padding-bottom: 8px;
  }

  /* Fonte menor para nome do produto em 2-col */
  :is(body.catalog-category-view, body.catalogsearch-result-index)
    .wrapper.grid.products-grid .item-product .product-item-link {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  /* Preço menor */
  :is(body.catalog-category-view, body.catalogsearch-result-index)
    .wrapper.grid.products-grid .item-product .price {
    font-size: 14px;
  }

  /* Botão add-to-cart compacto */
  :is(body.catalog-category-view, body.catalogsearch-result-index)
    .wrapper.grid.products-grid .item-product .btn-add-to-cart.action.tocart {
    font-size: 11px;
    padding: 0 8px;
    min-height: 38px;
    letter-spacing: 0;
  }
}

/* Lista view — melhor separação */
:is(body.catalog-category-view, body.catalogsearch-result-index)
  .wrapper.list.products-list .item-product {
  border-bottom: 1px solid var(--awa-border, #e5e7eb);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
:is(body.catalog-category-view, body.catalogsearch-result-index)
  .wrapper.list.products-list .item-product:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════
   2. PDP — TABELA TÉCNICA B2B E BOTÕES
   ═══════════════════════════════════════════════════════════ */

/* Tabela: SKU / EAN / Master Box */
.awa-b2b-pdp-technical-summary {
  margin-bottom: 16px;
}
.awa-b2b-pdp-technical-summary table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--awa-border, #e5e7eb);
}
.awa-b2b-pdp-technical-summary td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--awa-border, #e5e7eb);
  vertical-align: middle;
  line-height: 1.4;
}
.awa-b2b-pdp-technical-summary tr:last-child td {
  border-bottom: none;
}
.awa-b2b-pdp-technical-summary td:first-child {
  color: var(--awa-text-muted, #6b7280);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  width: 42%;
  background: var(--awa-bg-alt, #f9fafb);
}
.awa-b2b-pdp-technical-summary td:last-child {
  color: var(--awa-text, #111827);
  font-weight: 500;
}

/* Botões de ação secundária do PDP */
.awa-b2b-secondary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.awa-b2b-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--awa-border, #e5e7eb);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--awa-text, #111827);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.awa-b2b-action-btn:hover {
  border-color: var(--awa-red, #b73337);
  color: var(--awa-red, #b73337);
  background: var(--awa-red-light, rgba(183, 51, 55, 0.06));
}
.awa-b2b-action-btn:disabled,
.awa-b2b-action-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.awa-b2b-action-btn:focus-visible {
  outline: 2px solid var(--awa-red, #b73337);
  outline-offset: 2px;
}

/* Quantidade no PDP */
.awa-catalog-qty-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.awa-catalog-qty-box .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--awa-text-muted, #6b7280);
  white-space: nowrap;
}
.awa-catalog-qty-box input[type="number"] {
  width: 72px;
  height: 44px;
  text-align: center;
  border: 1.5px solid var(--awa-border, #e5e7eb);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--awa-text, #111827);
}

/* ═══════════════════════════════════════════════════════════
   3. CATEGORY GRID — "Busque por Categorias"
   Estilo para awa-category-grid.phtml (8 cards estáticos)
   ═══════════════════════════════════════════════════════════ */
.awa-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 auto;
  max-width: 1280px;
}

.awa-category-grid__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: #fff;
  border: 1.5px solid var(--awa-border, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: var(--awa-text, #111827);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.18s;
  text-align: center;
}
.awa-category-grid__card:hover {
  border-color: var(--awa-red, #b73337);
  box-shadow: 0 4px 16px rgba(183, 51, 55, 0.12);
  transform: translateY(-2px);
  color: var(--awa-red, #b73337);
}
.awa-category-grid__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--awa-bg-alt, #f9fafb);
  border-radius: 50%;
  color: var(--awa-red, #b73337);
  transition: background 0.18s;
  flex-shrink: 0;
}
.awa-category-grid__card:hover .awa-category-grid__icon {
  background: rgba(183, 51, 55, 0.08);
}
.awa-category-grid__icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}
.awa-category-grid__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: inherit;
}

@media (max-width: 767px) {
  .awa-category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .awa-category-grid__card {
    padding: 14px 8px;
    gap: 6px;
  }
  .awa-category-grid__icon {
    width: 40px;
    height: 40px;
  }
  .awa-category-grid__icon svg {
    width: 22px;
    height: 22px;
  }
  .awa-category-grid__title {
    font-size: 11px;
  }
}
@media (max-width: 480px) {
  .awa-category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .awa-category-grid__card {
    padding: 10px 4px;
    border-radius: 8px;
    gap: 4px;
  }
  .awa-category-grid__icon {
    width: 36px;
    height: 36px;
  }
  .awa-category-grid__icon svg {
    width: 18px;
    height: 18px;
  }
  .awa-category-grid__title {
    font-size: 10px;
    letter-spacing: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   4. VERTICAL NAVIGATION — Rokanthemes sidebar menu
   ═══════════════════════════════════════════════════════════ */

/* Container do menu vertical */
.awa-vertical-nav,
.rokan-vertical-menu,
.block.block-categories-nav .block-content {
  font-family: var(--awa-font, inherit);
}

/* Links do menu vertical */
.rokan-vertical-menu ul > li > a,
.block-categories-nav .item > a,
.vertical-menu-content ul > li > a {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--awa-text, #111827);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.35;
}
.rokan-vertical-menu ul > li > a:hover,
.block-categories-nav .item > a:hover,
.vertical-menu-content ul > li > a:hover {
  background: var(--awa-red-light, rgba(183, 51, 55, 0.07));
  color: var(--awa-red, #b73337);
}
.rokan-vertical-menu ul > li.active > a,
.block-categories-nav .item.active > a,
.vertical-menu-content ul > li.active > a {
  background: var(--awa-red-light, rgba(183, 51, 55, 0.07));
  color: var(--awa-red, #b73337);
  font-weight: 700;
}

/* Submenu */
.rokan-vertical-menu ul > li > ul > li > a {
  padding-left: 28px;
  font-size: 12px;
  color: var(--awa-text-muted, #6b7280);
}
.rokan-vertical-menu ul > li > ul > li > a:hover {
  color: var(--awa-red, #b73337);
}

/* Filtro sidebar (category layered nav) */
.block.filter .filter-title strong,
#layered-ajax-filter-block .filter-title strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--awa-text, #111827);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   5. HOMEPAGE RHYTHM — seções com ritmo visual
   ═══════════════════════════════════════════════════════════ */

/* Wrapper da home */
.ayo-home5-wrapper {
  overflow-x: hidden;
}

/* Seção padrão */
.awa-home-section {
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Carousel de categoria com fundo alternado */
.awa-carousel-section--category {
  background: var(--awa-bg-alt, #f9fafb);
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Separador visual entre seções de produto */
.awa-carousel-section + .awa-carousel-section {
  border-top: 1px solid var(--awa-border, #e5e7eb);
}

/* Seção de categorias com fundo diferenciado não necessita borda */
.awa-carousel-section--category + .awa-carousel-section,
.awa-carousel-section + .awa-carousel-section--category {
  border-top: none;
}

/* Benefits bar espaçamento */
.awa-benefits-bar {
  margin: 0;
}

/* Notification ticker */
.block_notification {
  padding: 12px 0;
  background: #fff;
  border-top: 1px solid var(--awa-border, #e5e7eb);
  border-bottom: 1px solid var(--awa-border, #e5e7eb);
}

/* Category carousel section ("Busque por Categorias") */
.top-home-content--category-carousel {
  padding-top: 48px;
  padding-bottom: 48px;
  background: #fff;
  border-bottom: 1px solid var(--awa-border, #e5e7eb);
}

/* Mobile home sections */
@media (max-width: 767px) {
  .awa-home-section,
  .awa-carousel-section--category {
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .top-home-content--category-carousel {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

/* ═══════════════════════════════════════════════════════════
   6. MINICART DROPDOWN — refinamentos visuais
   ═══════════════════════════════════════════════════════════ */

/* Minicart panel */
.minicart-wrapper .block-minicart {
  border-radius: 12px;
  border: 1.5px solid var(--awa-border, #e5e7eb);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* Título do minicart */
.minicart-wrapper #minicart-content-wrapper .block-title {
  padding: 16px 20px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--awa-text, #111827);
  border-bottom: 1px solid var(--awa-border, #e5e7eb);
}

/* Item do minicart */
.minicart-wrapper .minicart-items .product-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--awa-bg-alt, #f9fafb);
}

/* Nome do produto no minicart */
.minicart-wrapper .product-item-details .product-item-name a {
  font-size: 13px;
  font-weight: 600;
  color: var(--awa-text, #111827);
  text-decoration: none;
  transition: color 0.15s;
}
.minicart-wrapper .product-item-details .product-item-name a:hover {
  color: var(--awa-red, #b73337);
}

/* Preço no minicart */
.minicart-wrapper .product-item-details .price {
  font-size: 14px;
  font-weight: 700;
  color: var(--awa-red, #b73337);
}

/* Botões do minicart */
.minicart-wrapper .action.checkout {
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   7. RODAPÉ — mobile melhorado
   ═══════════════════════════════════════════════════════════ */

/* Mobile footer nav toggle */
@media (max-width: 767px) {
  .page_footer .footer-nav-item,
  .page_footer .footer-column {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .page_footer .footer-nav-item:last-child,
  .page_footer .footer-column:last-child {
    border-bottom: none;
  }

  /* Accordion toggle */
  .page_footer .footer-nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

/* ═══════════════════════════════════════════════════════════
   8. EMPTY STATE — categoria sem produtos
   ═══════════════════════════════════════════════════════════ */
.catalog-category-view .page-main .message.empty,
.catalogsearch-result-index .page-main .message.empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--awa-bg-alt, #f9fafb);
  border-radius: 12px;
  border: 1.5px dashed var(--awa-border, #e5e7eb);
  color: var(--awa-text-muted, #6b7280);
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════
   9. TOOLBAR BADGE — contagem de resultados
   ═══════════════════════════════════════════════════════════ */
:is(body.catalog-category-view, body.catalogsearch-result-index)
  .toolbar-amount .toolbar-number {
  font-weight: 700;
  color: var(--awa-text, #111827);
}

/* ═══════════════════════════════════════════════════════════
   10. QUICK VIEW MODAL — refinamentos
   ═══════════════════════════════════════════════════════════ */
.fancybox-overlay .fancybox-wrap {
  border-radius: 12px;
  overflow: hidden;
}
.rokan-quickview-wrapper .product-info-main {
  padding: 20px;
}
.rokan-quickview-wrapper .product-info-main .product.attribute.sku {
  font-size: 12px;
  color: var(--awa-text-muted, #6b7280);
}

/* ═══════════════════════════════════════════════════════════
   11. CATEGORY PAGE — título e descrição da categoria
   ═══════════════════════════════════════════════════════════ */
.catalog-category-view .page-title-wrapper .page-title {
  font-size: clamp(22px, 2vw + 14px, 32px);
  font-weight: 700;
  color: var(--awa-text, #111827);
  margin-bottom: 8px;
}
.catalog-category-view .category-description {
  font-size: 14px;
  color: var(--awa-text-muted, #6b7280);
  line-height: 1.6;
  max-width: 640px;
}

/* Breadcrumb da categoria */
.catalog-category-view .breadcrumbs {
  padding: 12px 0 8px;
}

/* ═══════════════════════════════════════════════════════════
   12. CHECKOUT CART — botão de checkout destacado
   ═══════════════════════════════════════════════════════════ */
body.checkout-cart-index .checkout-methods-items .action.primary.checkout {
  background: var(--awa-red, #b73337);
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 14px;
  min-height: 48px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
body.checkout-cart-index .checkout-methods-items .action.primary.checkout:hover {
  background: var(--awa-red-dark, #8e2629);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   13. ACCOUNT DASHBOARD — melhor legibilidade B2B
   ═══════════════════════════════════════════════════════════ */
.customer-account-index .block-dashboard-info .block-title strong,
.customer-account-index .block-dashboard-addresses .block-title strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--awa-text, #111827);
}

.customer-account-index .box-title > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--awa-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════
   14. PREÇOS — consistência em toda a loja
   ═══════════════════════════════════════════════════════════ */

/* Preço especial (com desconto) */
.price-box .special-price .price {
  font-weight: 700;
  color: var(--awa-red, #b73337);
}
.price-box .old-price .price {
  color: var(--awa-text-muted, #6b7280);
  text-decoration: line-through;
  font-weight: 400;
}

/* Preço regular (sem desconto) */
.price-box .regular-price .price,
.price-box .price {
  font-weight: 700;
  color: var(--awa-red, #b73337);
}

/* ═══════════════════════════════════════════════════════════
   15. NOTIFICAÇÕES / FLASH MESSAGES
   ═══════════════════════════════════════════════════════════ */
.page.messages .message {
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  border-left-width: 4px;
}
.page.messages .message-success,
.page.messages .message.success {
  background: rgba(22, 163, 74, 0.08);
  border-color: #16a34a;
  color: #14532d;
}
.page.messages .message-error,
.page.messages .message.error {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
  color: #7f1d1d;
}
.page.messages .message-notice,
.page.messages .message.notice,
.page.messages .message-warning,
.page.messages .message.warning {
  background: rgba(217, 119, 6, 0.08);
  border-color: #d97706;
  color: #451a03;
}
.page.messages .message-info,
.page.messages .message.info {
  background: rgba(14, 165, 233, 0.08);
  border-color: #0ea5e9;
  color: #0c4a6e;
}
