/* ==========================================================================
   DESIGN SYSTEM E GLOBAIS
   ========================================================================== */
:root {
  --color-primary: #111827;
  --color-primary-hover: #0f172a;
  --color-accent: #2563eb;
  --color-success: #16a34a;
  --color-danger: #ef4444;
  --color-promo: #f59e0b;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-border: #e5e7eb;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .10);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box }

html, body { height: 100% }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background: var(--color-background);
  padding-bottom: 80px;
}

/* ==========================================================================
   COMPONENTES DA PÁGINA
   ========================================================================== */

/* Header da Loja */
.legacy-store .header-container { position: relative; margin: 0 auto 2.5rem }
.legacy-store .store-header {
  width: 100%; max-width: 1100px; height: 200px; margin: 0 auto;
  background: #d9d9d9 center/cover no-repeat;
  border-radius: 0 0 16px 16px; box-shadow: var(--shadow-sm);
}
.legacy-store .store-logo {
  position: absolute; left: 50%; top: 200px;
  transform: translate(-50%, -50%); /* Centralizado por padrão */
  width: 112px; height: 112px; border-radius: 20px; border: 5px solid #fff;
  background-color: #E5E7EB; /* ✅ MODIFICADO PARA CINZA CLARO */
  box-shadow: var(--shadow-md); object-fit: cover;
  z-index: 2;
}
.legacy-store .store-text {
  max-width: 1100px; margin: 65px auto 0; padding: 0 16px; text-align: center;
  position: relative; z-index: 1;
}
.legacy-store .store-name { font: 700 1.75rem/1.2 var(--font-heading); margin: 0 0 8px; text-align: center }
.legacy-store .store-details { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--color-text-secondary); font-weight: 500; }
.legacy-store .store-details .open { color: var(--color-success) }
.legacy-store .store-details .closed { color: var(--color-danger) }
.legacy-store .info-link { color: var(--color-text-primary); text-decoration: none; font-weight: 600 }
.legacy-store .info-link:hover { color: var(--color-primary) }
.legacy-store .separator { color: #9aa0a6 }

/* Filtros e Busca */
.legacy-store .filters-container { max-width: 1100px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 0 16px }
.dropdown { position: relative }
.dropdown-panel {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; background: #fff;
  border: 1px solid rgba(0,0,0,.08); box-shadow: 0 10px 25px rgba(0,0,0,.08);
  border-radius: 10px; padding: 6px; z-index: 40; display: none;
}
.dropdown.open .dropdown-panel { display: block }
.dropdown-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: none; background: transparent; cursor: pointer; font-size: 14px; }
.dropdown-item:hover { background: #f3f4f6 }
.dropdown-item.active { background: #111827; color: #fff }
.tw-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(0,0,0,.12); padding: 8px 12px; border-radius: 10px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; }
.tw-btn:focus { outline: 2px solid #111827; outline-offset: 2px }
.tw-input { width: 100%; border: 1px solid rgba(0,0,0,.12); padding: 10px 12px; border-radius: 12px; font-size: 14px }
.tw-input:focus { outline: 2px solid #111827; outline-offset: 2px }

/* Listagem de Produtos */
.legacy-store .products-header { max-width: 1100px; margin: 22px auto 8px; padding: 0 16px }
.legacy-store .products-title { margin: 0 0 4px; font: 700 1.4rem var(--font-heading) }
.legacy-store .products-subtitle { margin: 0; color: var(--color-text-secondary) }
.legacy-store .products-container {
  max-width: 1100px; margin: 0 auto; padding: 0 16px 24px;
  display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.legacy-store .product-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--color-border); border-radius: 14px; padding: 8px;
  transition: transform .2s, box-shadow .2s; color: inherit; text-decoration: none;
}
.legacy-store .product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) }
.legacy-store .product-card.out-of-stock { filter: grayscale(.7); opacity: .6; pointer-events: none }
.legacy-store .product-image {
  border-radius: 12px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface); aspect-ratio: 1 / 1; height: auto;
}
.legacy-store .product-image img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }

.product-image .img-skeleton {
    position: absolute; inset: 0; border-radius: 8px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%; animation: vo-shimmer 1.15s ease-in-out infinite;
}
@keyframes vo-shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
.product-image.loaded .img-skeleton { display: none }
.product-image.loaded img { opacity: 1 }

.legacy-store .tw-badge {
    position: absolute; top: 10px; left: 10px; background: var(--color-danger); color: #fff;
    font-weight: 700; padding: 4px 7px; border-radius: 999px; font-size: 12px;
}
.legacy-store .stock-overlay {
  position: absolute; inset: auto 8px 8px 8px;
  background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,.35));
  color: #fff; border-radius: 10px; padding: 6px 10px; text-align: center; font-weight: 700;
}
.legacy-store .product-info { padding: 0 6px 6px; text-align: center }
.legacy-store .product-name {
  margin: 2px 0 4px; font-weight: 700; color: var(--color-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legacy-store .price-container { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 0 }
.legacy-store .discount-price { font-weight: 800 }
.legacy-store .original-price { color: var(--color-text-secondary); text-decoration: line-through }

.quick-add-btn {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 999px; border: 0;
  background: rgba(17,24,39,.92); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-md); cursor: pointer; transition: transform .15s, opacity .15s, background .2s;
}
.quick-add-btn:hover { transform: scale(1.06) }

/* ✅ MODAL DE INFORMAÇÕES DA LOJA (ESTILOS ATUALIZADOS) */
.modal-vo { position: fixed; inset: 0; display: none; z-index: 3500; }
.modal-vo.open { display: block }
.modal-vo .backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45) }
.modal-vo .panel.modal-panel-enhanced {
    position: relative; max-width: 550px; width: 95%; margin: 6vh auto;
    background: #fff; border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    transform: scale(0.95); transition: transform 0.2s ease-out;
}
.modal-vo.open .modal-panel-enhanced { transform: scale(1); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; border-bottom: 1px solid #f0f0f0;
}
.modal-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.modal-close-btn {
    background: #f1f1f1; border: none; border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background-color 0.2s; color: #555;
}
.modal-close-btn:hover { background-color: #e0e0e0; }
.modal-body { padding: 1rem 1.5rem 1.5rem; }

/* Estilo para o Logo dentro do Modal */
.modal-store-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.modal-store-logo {
    width: 96px;
    height: 96px;
    border-radius: 18px; /* Ou 50% para um círculo perfeito */
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.tabs-vo { display: flex; gap: 6px; background: #f3f4f6; padding: 6px; border-radius: 10px }
.tab-btn { flex: 1; padding: 10px 12px; border-radius: 8px; font-weight: 600; border: none; background: transparent; cursor: pointer }
.tab-btn.active { background: #fff; box-shadow: var(--shadow-sm); }
.tab-pane { display: none }
.tab-pane.active { display: block }
.tab-content { padding-top: 1.5rem; }

/* Abas do Modal */
.info-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.info-item { display: flex; align-items: flex-start; gap: 1rem; }
.info-icon { flex-shrink: 0; margin-top: 2px; color: #555; }
.info-content .info-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; }
.info-content .info-text { margin: 0; color: #666; line-height: 1.6; }
.contact-links { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-links a { color: var(--color-accent); text-decoration: none; }
.contact-links a:hover { text-decoration: underline; }

.schedule-list { list-style: none; padding: 0; margin: 0; }
.schedule-item { display: flex; justify-content: space-between; padding: 0.75rem 0.25rem; border-bottom: 1px dashed #e5e5e5; }
.schedule-item:last-child { border-bottom: none; }
.schedule-day { font-weight: 600; }
.schedule-time { color: #555; }

.payment-list {
    list-style: none; margin: 0; padding: 0; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem;
}
.payment-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
    background-color: #fafafa; border: 1px solid #f0f0f0; border-radius: 12px;
}
.payment-item svg { color: #444; }


/* Footer */
.footer { background-color: #111827; color: #d1d5db; padding: 4rem 1.5rem 2rem; font-size: .9rem; margin-top: 2rem; }
.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem; padding-bottom: 2rem;
}
.footer-section { min-width: 200px; }
.footer-section h4 { font-weight: 700; color: #fff; margin-bottom: 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .5px; }
.store-name-footer { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0; }
.store-details-footer { margin-top: .25rem; font-size: .9rem; }
.store-address-footer { margin-top: 1rem; color: #9ca3af; }

.whatsapp-button {
  display: inline-flex; align-items: center; gap: .5rem; background: #25D366; color: #fff;
  padding: .6rem 1.2rem; border-radius: 9999px; font-weight: 600; text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}
.whatsapp-button:hover { background: #128C7E; transform: scale(1.05); color: #fff; }

.social-links { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 1rem; }
.social-links a { color: #9ca3af; display: block; width: 24px; height: 24px; transition: color .2s ease, transform .2s ease; }
.social-links a svg { width: 100%; height: 100%; }
.social-links a:hover { color: #fff; transform: scale(1.1); }

.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 2rem; margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1); text-align: center; font-size: .875rem; color: #9ca3af;
}
.footer-bottom .platform-text { margin: 0; }
.footer-bottom .platform-link { color: #d1d5db; text-decoration: none; }
.footer-bottom .platform-link:hover { text-decoration: underline; }


/* ==========================================================================
   RESPONSIVIDADE (SEÇÃO CONSOLIDADA)
   ========================================================================== */

/* Telas de tablet e menores */
@media (max-width: 1199.98px) {
  .legacy-store .products-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Telas de tablet (vertical) e menores */
@media (max-width: 991.98px) {
  .legacy-store .store-header { height: 180px; }
  .legacy-store .store-logo {
    top: 180px; width: 96px; height: 96px; border-width: 6px;
  }
  .legacy-store .store-text {
    margin-top: 56px; padding-top: 0;
  }
}

/* Telas de celular (maiores) */
@media (max-width: 767.98px) {
  .legacy-store .filters-container { padding: 0 16px; gap: 8px; }
  .legacy-store .products-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legacy-store .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-section { display: flex; flex-direction: column; align-items: center; }

  /* Esconde o texto "Filtros:" e os textos dos botões no mobile */
  .filter-label,
  .btn-text-desktop {
      display: none;
  }
  .category-filter .tw-btn, .sort-button-container .tw-btn {
    width: 44px; height: 44px; padding: 0; justify-content: center;
  }
  .modal-vo .panel { margin: 3vh 12px; }
}

@media (max-width: 400px) {
  .legacy-store .products-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .legacy-store .product-card { padding: 6px; }
  .legacy-store .product-image { border-radius: 10px; }
  .legacy-store .product-name { font-size: .875rem; }
  .legacy-store .price-container { font-size: .875rem; gap: 6px; }
  .legacy-store .quick-add-btn { width: 36px; height: 36px; right: 8px; bottom: 8px; }
  .legacy-store .tw-badge { font-size: .7rem; padding: 3px 6px; top: 8px; left: 8px; }
}


/* Refinamentos para Desktop */
@media (min-width: 768px) {
  .filter-label, .btn-text-desktop { display: inline; }
}