/* ================================
   Gráfica Luart – Tema CSS
   Paleta:
   - Azul principal: #0D3B8A
   - Vermelho CTA:  #D62327
   - Cinza escuro:  #333333
   - Cinza médio:   #555555
   - Cinza claro:   #F3F3F3
   - Branco:        #FFFFFF
   ================================ */

:root {
  --blue: #0D3B8A;
  --red: #D62327;
  --gray-900: #333333;
  --gray-700: #555555;
  --gray-400: #A8A8A8;
  --gray-200: #F3F3F3;
  --white: #FFFFFF;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --transition: .2s ease;
}

/* Tipografia & base */
html { scroll-behavior: smooth; }
body {
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Utilitários */
.container { max-width: 1220px; margin: 0 auto; padding: 0 16px; }
.shadow { box-shadow: var(--shadow); }
.rounded { border-radius: var(--radius); }

/* ================= HEADER ================= */
.topbar {
  background: var(--gray-200);
  color: var(--blue);
  font-size: .92rem;
  padding: 6px 0;
}
.header {
  background: var(--white);
  border-bottom: 1px solid #ececec;
}
.header .logo { height: 54px; display: flex; align-items: center; }
.header .actions { display: flex; align-items: center; gap: 12px; }

/* Busca */
.search-box { position: relative; }
.search-box input[type="search"],
.search-box input[type="text"] {
  width: 100%;
  height: 46px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  padding: 0 48px 0 16px;
  outline: none;
}
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 59, 138, .12); }
.search-box .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--gray-700); }

/* Botões (CTA) */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition); }
.btn:focus-visible { outline: 3px solid rgba(13, 59, 138, .35); outline-offset: 2px; }
.btn-primary { background: var(--red); color: var(--white); box-shadow: 0 8px 20px rgba(214, 35, 39, .18); }
.btn-primary:hover { filter: brightness(0.96); transform: translateY(-1px); }
.btn-secondary { background: var(--blue); color: var(--white); box-shadow: 0 8px 20px rgba(13, 59, 138, .18); }
.btn-secondary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-ghost:hover { background: rgba(13, 59, 138, .06); }

/* ================= MENU LATERAL ================= */
.sidebar {
  background: var(--gray-200);
  border-radius: 14px;
  padding: 12px;
}
.sidebar-title { font-weight: 800; font-size: 1rem; color: var(--blue); padding: 8px 10px; }
.category-list { list-style: none; margin: 0; padding: 6px; }
.category-list a {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--gray-900); font-weight: 600;
}
.category-list a:hover { background: #e9eef7; color: var(--blue); }
.category-list a.is-active { background: var(--blue); color: var(--white); }

/* ================= VITRINE / PRODUTOS ================= */
.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card {
  background: var(--white);
  border: 1px solid #eee;
  border-radius: 18px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #e4e4e4; }
.product-thumb { background: #fafafa; display: grid; place-items: center; padding: 16px; min-height: 180px; }
.product-info { padding: 14px 16px 18px; }
.product-title { font-size: 1rem; font-weight: 800; color: var(--blue); margin: 4px 0 8px; }
.product-meta { color: var(--gray-700); font-size: .92rem; min-height: 40px; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.price .current { font-size: 1.25rem; font-weight: 800; color: var(--blue); }
.price .old { color: var(--gray-400); text-decoration: line-through; font-weight: 600; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.badge.sale { background: #ffe8ea; color: var(--red); }
.badge.new { background: #e7eefc; color: var(--blue); }

.product-actions { display: flex; gap: 10px; }
.product-actions .btn { flex: 1; }

/* Botão Comprar na listagem */
.buy-bar { padding: 12px 16px 18px; display: flex; gap: 10px; }
.buy-bar .btn-primary { width: 100%; }

/* ================= PÁGINA DO PRODUTO ================= */
.product-page { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; }
.product-gallery { background: var(--white); border: 1px solid #eee; border-radius: 16px; padding: 16px; }
.product-summary { background: var(--white); border: 1px solid #eee; border-radius: 16px; padding: 20px; }
.product-summary .title { font-size: 1.4rem; font-weight: 800; color: var(--blue); }
.product-summary .cta { display: flex; gap: 10px; margin-top: 16px; }

/* Quantidade */
.qty { display: inline-flex; align-items: center; border: 1px solid #e6e6e6; border-radius: 12px; overflow: hidden; }
.qty input { width: 54px; text-align: center; border: 0; padding: 10px 8px; }
.qty button { background: var(--gray-200); border: 0; padding: 10px 12px; cursor: pointer; }
.qty button:hover { background: #e6ebf5; }

/* ================= BREADCRUMB & PAGINAÇÃO ================= */
.breadcrumb { font-size: .9rem; color: var(--gray-700); display: flex; gap: 8px; align-items: center; }
.pagination { display: flex; gap: 8px; align-items: center; }
.pagination a, .pagination button { border: 1px solid #e6e6e6; background: var(--white); padding: 8px 12px; border-radius: 10px; }
.pagination .is-active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ================= ALERTAS / STATUS ================= */
.alert { padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.alert.info { background: #e7eefc; color: var(--blue); }
.alert.success { background: #e8f7ef; color: #1a8a4b; }
.alert.warning { background: #fff5e1; color: #8a5b00; }
.alert.danger { background: #ffe8ea; color: var(--red); }

/* ================= CARRINHO / MINI-CART ================= */
.cart-widget { position: relative; }
.cart-count { position: absolute; top: -6px; right: -6px; background: var(--red); color: var(--white); border-radius: 999px; padding: 2px 6px; font-size: .75rem; font-weight: 800; }

/* ================= RODAPÉ ================= */
.footer { background: var(--blue); color: var(--white); padding: 36px 0; margin-top: 36px; }
.footer a { color: #dfe8ff; }
.footer a:hover { color: var(--white); }
.footer .title { color: var(--white); font-weight: 800; margin-bottom: 12px; }

/* ================= WHATSAPP FLUTUANTE ================= */
.whatsapp-float { position: fixed; bottom: 20px; left: 20px; z-index: 90; display: inline-flex; align-items: center; gap: 10px; background: #25D366; color: var(--white); padding: 12px 16px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 800; }
.whatsapp-float:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* ================= FORMULÁRIOS ================= */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; border: 1px solid #e5e5e5; border-radius: 12px; padding: 12px 14px; outline: none; background: var(--white);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 59, 138, .1); }
label { font-weight: 700; color: var(--gray-700); margin-bottom: 6px; display: inline-block; }

/* ================= TABELAS ================= */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid #eee; }
.table th { text-align: left; font-weight: 800; color: var(--blue); }

/* ================= MODAIS ================= */
.modal { background: rgba(24, 24, 27, .45); position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 100; }
.modal.is-open { display: flex; }
.modal .box { background: var(--white); border-radius: 18px; padding: 22px; max-width: 560px; width: 92%; box-shadow: var(--shadow); }

/* ================= RESPONSIVIDADE ================= */
@media (max-width: 1200px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
  .product-page { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .grid-products { grid-template-columns: repeat(2, 1fr); }
  .sidebar { position: relative; top: 0; border-radius: 12px; }
}
@media (max-width: 480px) {
  .grid-products { grid-template-columns: 1fr; }
  .btn { padding: 12px 14px; }
}

/* ================= ACESSIBILIDADE ================= */
:focus-visible { outline: 3px solid rgba(214, 35, 39, .35); outline-offset: 2px; }
[aria-busy="true"] { cursor: progress; }

/* ================= EXTRAS (ajustes de plataforma) ================= */
/* Ajuste genérico de cartões/listagens */
.listing .product, .card {
  background: var(--white); border: 1px solid #eee; border-radius: 16px; overflow: hidden;
}

/* Ícones padrão dentro de botões */
.btn i, .btn .fa { font-size: 1.05em; }

/* Tooltip simples */
.tooltip { position: relative; }
.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: #111827; color: #fff; padding: 8px 10px; border-radius: 8px; white-space: nowrap; font-size: .8rem; box-shadow: var(--shadow);
}
