/* public/assets/css/layouts/layout_vitrine.css (ou CDN: /css/layouts/layout_vitrine.css) */

/* ==========================================================
   LAYOUT "VITRINE"
   - Escopado por html[data-layout="vitrine"]
   - Sem impor paleta de produto; consome tokens globais
   ========================================================== */

html[data-layout="vitrine"]{
  /* Identidade/base do layout */
  --vt-primary:    var(--brand, #3E2723);
  --vt-accent:     var(--brand-700, #D4AF37);
  --vt-bg:         var(--surface, var(--bg, #FAF9F6));
  --vt-header-bg:  var(--headerBg, #FFFFFF);

  --vt-text: var(--text, #2c2c2c);
  --vt-gray: var(--muted, #8d8d8d);

  --vt-font-serif: 'Georgia', 'Times New Roman', serif;
  --vt-font-sans:  'Inter', system-ui, sans-serif;

  --vt-container: 1320px;

  /* Raio do card: herda do tema/Bootstrap */
  --vt-radius: var(--radiusCard, var(--bs-card-border-radius, .5rem));

  /* Shadow do card vitrine (efeito OK) */
  --vt-shadow: var(--cardShadow, 0 4px 20px rgba(0, 0, 0, 0.06));

  /* ==========================================================
     HEADER ACTIONS (vt-header-grid) → HERDA MENUS/NAVEGAÇÃO
     ========================================================== */
  --vt-hbtn-bg:        var(--menuBg, var(--surface, #fff));
  --vt-hbtn-text:      var(--menuText, var(--text, #171717));
  --vt-hbtn-border:    var(--menuBorder, var(--cardBorder, #e5e7eb));
  --vt-hbtn-shadow:    var(--menuShadow, 0 2px 6px rgba(0,0,0,.08));
  --vt-hbtn-radius:    var(--radiusMenu, 999px);

  --vt-hbtn-bg-active:   var(--menuBgActive, var(--brand, #ea1d2c));
  --vt-hbtn-text-active: var(--menuTextActive, var(--brandText, #fff));

  /* Focus ring coerente com Bootstrap mapping */
  --vt-focus-ring: rgba(var(--bs-primary-rgb, 234,29,44), .25);

  /* ==========================================================
     NAVBAR CATEGORIAS (vt-navbar) → HERDA ETIQUETAS/CHIPS
     ========================================================== */
  --vt-chip-bg:            var(--tagBg, var(--chipBg, #f4f4f4));
  --vt-chip-text:          var(--tagText, var(--chipText, #111111));
  --vt-chip-border:        var(--tagBorder, var(--cardBorder, #e5e7eb));
  --vt-chip-radius:        var(--radiusChip, 999px);

  --vt-chip-bg-active:     var(--tagBgActive, var(--brand, #ea1d2c));
  --vt-chip-text-active:   var(--tagTextActive, var(--brandText, #ffffff));
  --vt-chip-shadow-active: var(--tagShadowActive, 0px 2px 4px rgba(0,0,0,.10));

  /* BRAND no header (quando usa ícone nativo + texto) */
  --vt-brand-icon: var(--brandHeadIcon, var(--vt-primary));
  --vt-brand-text: var(--brandHeadText, var(--vt-primary));

  /* ==========================================================
     STICKY TOP (dinâmico via JS) — usado por sticky-column-wrapper
     ========================================================== */
  --vt-sticky-gap: 16px;         /* respiro abaixo do stack topo */
  --vt-sticky-mobile-top: 20px;  /* fallback (mobile/sem JS) */
  --sticky-top: var(--vt-sticky-mobile-top);
}

html[data-layout="vitrine"] body{
  background-color: var(--vt-bg);
  color: var(--vt-text);
  font-family: var(--vt-font-sans);
  line-height: 1.6;
}

/* Container */
html[data-layout="vitrine"] .vitrine-container{
  width: 100%;
  max-width: var(--vt-container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- TOP BAR --- */
html[data-layout="vitrine"] .vt-topbar{
  background-color: var(--topbarBg, var(--vt-primary));
  color: var(--topbarText, #fff);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0;
  text-align: center;
  font-weight: 600;
}
html[data-layout="vitrine"] .vt-topbar span{ margin: 0 10px; }

/* --- HEADER --- */
html[data-layout="vitrine"] .vt-header{
  background: var(--vt-header-bg);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1040;
  border-bottom: 1px solid var(--headerBorder, rgba(0,0,0,0.05));
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

html[data-layout="vitrine"] .vt-header.scrolled{
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  background-color: var(--headerBg, #fff);
}

html[data-layout="vitrine"] .vt-header-grid{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  column-gap: 20px;
}

html[data-layout="vitrine"] .vt-header-left{
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

html[data-layout="vitrine"] .vt-header-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

/* ==========================================================
   AÇÕES DO HEADER → MENUS/NAVEGAÇÃO (menu*)
   ========================================================== */
html[data-layout="vitrine"] .vt-icon-btn{
  box-sizing: border-box;
  position: relative;

  -webkit-appearance: none;
  appearance: none;

  border: 1px solid var(--vt-hbtn-border);
  background-color: var(--vt-hbtn-bg);
  background-image: none;

  color: var(--vt-hbtn-text);
  font: inherit;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 8px 14px;
  height: 40px;
  border-radius: var(--vt-hbtn-radius);

  box-shadow: var(--vt-hbtn-shadow);

  transition: transform 0.2s, color 0.2s, background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

html[data-layout="vitrine"] .vt-icon-btn::-moz-focus-inner{
  border: 0;
  padding: 0;
}

html[data-layout="vitrine"] .vt-icon-btn i{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-style: normal;
  font-size: 1.15rem;
}

html[data-layout="vitrine"] .vt-icon-btn:hover,
html[data-layout="vitrine"] .vt-icon-btn:focus{
  background-color: var(--vt-hbtn-bg-active);
  border-color: var(--vt-hbtn-bg-active);
  color: var(--vt-hbtn-text-active);
  outline: none;
  text-decoration: none;
}

html[data-layout="vitrine"] .vt-icon-btn:focus-visible{
  box-shadow: var(--vt-hbtn-shadow), 0 0 0 .25rem var(--vt-focus-ring);
}

html[data-layout="vitrine"] .vt-icon-btn:active{
  transform: translateY(1px) scale(0.99);
}

html[data-layout="vitrine"] .vt-icon-label{
  font-size: 0.85rem;
  font-weight: 500;
}

html[data-layout="vitrine"] .vt-icon-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

html[data-layout="vitrine"] .vt-chat-badge{
  font-size: .65rem;
  transform: translate(25%, -30%);
}

/* ==========================================================
   Logo (Brand)
   ========================================================== */
html[data-layout="vitrine"] .vt-logo{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 0;
  border-radius: 0;

  border: 0;
  background: transparent;
  box-shadow: none;

  color: var(--vt-brand-text);
  text-decoration: none;

  min-width: 0;
  max-width: 100%;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html[data-layout="vitrine"] .vt-logo:hover{
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
}

html[data-layout="vitrine"] .vt-logo:focus,
html[data-layout="vitrine"] .vt-logo:active{
  outline: none;
  box-shadow: none;
}

html[data-layout="vitrine"] .vt-logo:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .25rem var(--vt-focus-ring);
  border-radius: 8px;
}

html[data-layout="vitrine"] .vt-logo-icon{
  font-size: 1.8rem;
  line-height: 1;
  display:flex;
  align-items:center;
}

html[data-layout="vitrine"] .vt-logo-text{
  font-family: var(--vt-font-serif);
  font-size: 1.4rem;
  line-height: 1.05;
  letter-spacing: -0.3px;
  color: currentColor;

  display: block;
  min-width: 0;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

html[data-layout="vitrine"] .vt-logo .brand-head-icon{ color: var(--vt-brand-icon); }
html[data-layout="vitrine"] .vt-logo .brand-head-text{ color: var(--vt-brand-text); }

html[data-layout="vitrine"] .vt-logo-icon i{
  display:block;
  line-height:1;
  position: relative;
  top: -3px;
}

/* Badge da Sacola */
html[data-layout="vitrine"] .vt-badge{
  position: absolute;
  top: -16px;
  right: -10px;

  background-color: var(--vt-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid var(--vt-hbtn-bg);
  pointer-events: none;
}

/* --- NAV BAR (Desktop) --- */
html[data-layout="vitrine"] .vt-navbar{
  border-top: 1px solid var(--headerBorder, rgba(0,0,0,0.03));
  border-bottom: 1px solid var(--headerBorder, rgba(0,0,0,0.03));
  background: var(--navBg, #fff);
  padding: 12px 0;
  display: none;
}
@media (min-width: 992px){
  html[data-layout="vitrine"] .vt-navbar{ display:block; }
}

html[data-layout="vitrine"] .vt-nav-scroller{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
html[data-layout="vitrine"] .vt-nav-scroller::-webkit-scrollbar{ display:none; }

html[data-layout="vitrine"] .vt-nav-list{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:10px;
  margin:0;
  padding:0 4px;
  list-style:none;
}

html[data-layout="vitrine"] .vt-nav-link{
  display:inline-flex;
  align-items:center;

  text-decoration:none;
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:600;
  white-space:nowrap;

  padding: 8px 12px;
  border-radius: var(--vt-chip-radius);

  background-color: var(--vt-chip-bg);
  color: var(--vt-chip-text);
  border: 1px solid var(--vt-chip-border);

  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

html[data-layout="vitrine"] .vt-nav-link:hover{
  background-color: color-mix(in srgb, var(--vt-chip-bg) 88%, var(--vt-chip-bg-active));
  border-color: color-mix(in srgb, var(--vt-chip-border) 60%, var(--vt-chip-bg-active));
  transform: translateY(-1px);
  text-decoration:none;
}

html[data-layout="vitrine"] .vt-nav-link:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .25rem var(--vt-focus-ring);
}

html[data-layout="vitrine"] .vt-nav-link.active{
  background-color: var(--vt-chip-bg-active);
  border-color: var(--vt-chip-bg-active);
  color: var(--vt-chip-text-active);
  box-shadow: var(--vt-chip-shadow-active);
}

/* Offcanvas do menu (aplica direto por ID) */
html[data-layout="vitrine"] #menuOffcanvas{
  background-color: var(--menuBg, #fff);
  color: var(--menuText, #171717);
}
html[data-layout="vitrine"] #menuOffcanvas .offcanvas-header{
  border-bottom: 1px solid var(--menuBorder, #f0f0f0);
}

/* --- HERO --- */
html[data-layout="vitrine"] .vt-hero-wrap{
  margin-bottom:40px;
  position:relative;
}
html[data-layout="vitrine"] .vt-hero-img{
  width:100%;
  height:auto;
  filter: brightness(0.95);
}

/* ==========================================================
   Cards de Produto (skin vitrine SEM impor cores/bordas)
   ========================================================== */
html[data-layout="vitrine"] .card-product{
  border-radius: var(--vt-radius);
  box-shadow: var(--vt-shadow);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
html[data-layout="vitrine"] .card-product:hover{
  transform: translateY(-5px);
  box-shadow: var(--cardShadowHover, 0 8px 24px rgba(0,0,0,0.08));
}

html[data-layout="vitrine"] .card-product img{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
  transition: transform .5s ease;
}
html[data-layout="vitrine"] .card-product:hover img{
  transform: scale(1.05);
}

html[data-layout="vitrine"] .card-product .title,
html[data-layout="vitrine"] .card-product .card-title,
html[data-layout="vitrine"] .vt-card-title{
  font-family: var(--vt-font-serif);
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--cardTitle, var(--text, #171717));
  font-weight: 400;
}

html[data-layout="vitrine"] .card-product .desc,
html[data-layout="vitrine"] .vt-card-desc{
  color: var(--cardDesc, var(--textMutedGlobal, var(--muted, #6b7280)));
}

html[data-layout="vitrine"] .card-product .price,
html[data-layout="vitrine"] .vt-card-price{
  font-weight: 600;
  color: var(--cardPrice, var(--text, #171717));
  font-size: 1rem;
}

/* Barra de busca (overlay) */
html[data-layout="vitrine"] .vt-search-bar{
  display:none;
  position:absolute;
  top:100%; left:0; width:100%;
  background: var(--surface, #fff);
  padding: 20px 0;
  border-bottom: 1px solid var(--headerBorder, #eee);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  z-index:1030;
}
html[data-layout="vitrine"] .vt-search-bar.is-open{ display:block; }

html[data-layout="vitrine"] .vt-search-input{
  border: none;
  border-bottom: 1px solid var(--formBorder, #ddd);
  font-size: 1.5rem;
  font-family: var(--vt-font-serif);
  padding: 10px 0;
  width: 100%;
  outline: none;
  text-align: center;
  background: transparent;
  color: var(--vt-text);
}

/* Grade de produtos: 4 colunas em telas grandes */
@media (min-width: 992px){
  html[data-layout="vitrine"] .product-grid{
    display:grid;
    gap:1rem;
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  html[data-layout="vitrine"] .vitrine-container .row.row-cols-md-3 > *,
  html[data-layout="vitrine"] .vitrine-container .row.row-cols-lg-3 > *{
    flex: 0 0 auto;
    width: 25%;
  }
}

/* ajuste fino (logo) */
html[data-layout="vitrine"] .vt-logo.brand-head .brand-head-img--logo{ height:36px; }
@media (min-width:992px){
  html[data-layout="vitrine"] .vt-logo.brand-head .brand-head-img--logo{ height:40px; }
}

/* MOBILE: HEADER 3 COLUNAS */
@media (max-width: 767.98px){
  html[data-layout="vitrine"] .vt-header-grid{
    grid-template-columns: 44px minmax(0,1fr) 44px;
    column-gap: 8px;
  }

  html[data-layout="vitrine"] .vt-header-left{ justify-content: flex-start; gap: 0; }
  html[data-layout="vitrine"] .vt-header-right{ justify-content: flex-end; gap: 0; }

  html[data-layout="vitrine"] .vt-header-left .vt-icon-btn i,
  html[data-layout="vitrine"] .vt-header-right .vt-icon-btn i{
    font-size: 1.25rem;
  }

  html[data-layout="vitrine"] .vt-header-grid .vt-logo{
    width: 100%;
    justify-content: center;
    padding: 0;
  }

  html[data-layout="vitrine"] .vt-logo-text{
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: break-word;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-layout="vitrine"] .vt-logo.brand-head .brand-head-img--logo{
    max-width: 62vw;
    width: auto;
    height: 32px;
  }
  html[data-layout="vitrine"] .vt-logo.brand-head .brand-head-img--icon{
    height: 30px;
    width: auto;
  }
}

@media (max-width: 575.98px){
  html[data-layout="vitrine"] .vitrine-container{
    padding-left:12px;
    padding-right:12px;
  }
}

/* STICKY TARGET: sticky-column-wrapper (ex.: show do item) */
@media (min-width: 768px){
  html[data-layout="vitrine"] .sticky-column-wrapper{
    position: -webkit-sticky;
    position: sticky;
    top: var(--sticky-top, 20px);
    align-self: flex-start;
    height: fit-content;
  }
}
