/* ================================================
   MOBILE APP DESIGN — Mercearia Sandra
   Referências: Rappi, iFood, Shopee mobile
   Adiciona no <head> de todos os HTMLs
================================================ */

/* ================================================
   VARIÁVEIS MOBILE
================================================ */
:root {
  --mobile-bottom-nav: 64px;
  --radius-card: 16px;
  --purple: #6d28d9;
  --purple-light: rgba(109,40,217,0.12);
  --gold: #fbbf24;
  --green: #16a34a;
  --surface: #1a1f35;
  --surface2: #0f172a;
}

/* ================================================
   BASE MOBILE — só aplica em telas pequenas
================================================ */
@media (max-width: 768px) {

  /* ── Esconde scrollbar no body ── */
  body { overflow-x: hidden; }

  /* ── Container com padding mobile ── */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* ================================================
     HEADER MOBILE — fixo, compacto, bonito
  ================================================ */
  .site-header {
    height: 56px !important;
    min-height: 56px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    background: rgba(10, 15, 30, 0.92) !important;
    border-bottom: 1px solid rgba(148,163,184,0.08) !important;
  }

  .site-header__inner {
    height: 56px !important;
    padding: 0 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
  }

  .site-header__brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-decoration: none !important;
  }

  .site-header__logo-img {
    height: 28px !important;
    width: auto !important;
    border-radius: 6px !important;
  }

  /* esconde o texto "Sandra Pernambucana" do header no mobile */
  .site-header__brand p {
    display: none !important;
  }

  /* ── Hamburguer ── */
  .site-header__toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 5px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 36px !important;
    height: 36px !important;
    z-index: 201 !important;
    transition: background 0.2s !important;
  }

  .site-header__toggle:hover {
    background: rgba(255,255,255,0.12) !important;
  }

  .site-header__toggle-line {
    display: block !important;
    width: 18px !important;
    height: 2px !important;
    background: #e2e8f0 !important;
    border-radius: 2px !important;
    transition: all 0.25s ease !important;
    transform-origin: center !important;
  }

  /* hamburguer animado quando aberto */
  .site-header__toggle.is-open .site-header__toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }
  .site-header__toggle.is-open .site-header__toggle-line:nth-child(2) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* ── Carrinho no header ── */
  .cart-icon {
    width: 36px !important;
    height: 36px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
  }

  /* ================================================
     MENU FULLSCREEN MOBILE — tipo app
  ================================================ */
  .site-header__nav {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(7, 10, 20, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
    z-index: 200 !important;
  }

  .site-header__nav.is-open {
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .site-header__menu {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 280px !important;
  }

  .site-header__menu-item {
    width: 100% !important;
    border-bottom: 1px solid rgba(148,163,184,0.08) !important;
  }

  .site-header__menu-item:first-child {
    border-top: 1px solid rgba(148,163,184,0.08) !important;
  }

  .site-header__link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.1rem 1rem !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    letter-spacing: 0.02em !important;
    transition: color 0.2s, background 0.2s !important;
    border-radius: 0 !important;
  }

  .site-header__link:hover,
  .site-header__link.is-active {
    color: #fff !important;
    background: rgba(109,40,217,0.15) !important;
  }

  /* esconde o ícone de carrinho dentro do menu fullscreen */
  .site-header__nav .cart-icon {
    display: none !important;
  }

  /* ── Logo centralizada no menu aberto ── */
  .site-header__nav::before {
    content: "🛒 Mercearia Sandra";
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
  }

  /* ── Fechar ao tocar fora ── */
  .site-header__nav::after {
    content: "✕ Fechar";
    display: block;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
  }

  /* ================================================
     PADDING TOP — compensa o header fixo
  ================================================ */
  main, .product-page, .contact-page,
  .collections-page main, .products-page main {
    padding-top: 56px !important;
  }

  /* ================================================
     HERO MOBILE — impactante
  ================================================ */
  .hero {
    min-height: auto !important;
    padding: 0 !important;
  }

  .hero__content {
    flex-direction: column !important;
    padding: 2rem 1rem 2.5rem !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
  }

  .hero__text {
    text-align: left !important;
  }

  .hero__eyebrow {
    font-size: 0.75rem !important;
    letter-spacing: 0.1em !important;
    opacity: 0.7 !important;
    margin-bottom: 0.5rem !important;
  }

  .hero__title {
    font-size: 1.75rem !important;
    line-height: 1.15 !important;
    letter-spacing: -0.04em !important;
    margin-bottom: 0.75rem !important;
  }

  .hero__subtitle {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
    color: #94a3b8 !important;
    margin-bottom: 1.25rem !important;
  }

  .hero__actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.6rem !important;
    flex-wrap: nowrap !important;
  }

  .hero__actions .btn {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 0.75rem 0.5rem !important;
    font-size: 0.85rem !important;
    border-radius: 12px !important;
  }

  .hero__meta {
    margin-top: 1rem !important;
    font-size: 0.75rem !important;
    opacity: 0.6 !important;
  }

  /* ── Hero card (oferta) ── */
  .hero__highlight {
    width: 100% !important;
  }

  .hero-card {
    border-radius: 20px !important;
    padding: 1.5rem !important;
    background: linear-gradient(135deg, rgba(109,40,217,0.2), rgba(109,40,217,0.05)) !important;
    border: 1px solid rgba(109,40,217,0.3) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .hero-card::before {
    content: "" !important;
    position: absolute !important;
    top: -40px !important;
    right: -40px !important;
    width: 120px !important;
    height: 120px !important;
    background: radial-gradient(circle, rgba(109,40,217,0.3), transparent 70%) !important;
    pointer-events: none !important;
  }

  .hero-card__label {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    color: #a78bfa !important;
    font-weight: 700 !important;
    margin-bottom: 0.4rem !important;
  }

  .hero-card__title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.35rem !important;
    letter-spacing: -0.03em !important;
  }

  .hero-card__desc {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.5 !important;
  }

  .hero-card__price,
  .hero-card__price + p,
  #oferta-preco {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    margin-bottom: 1rem !important;
  }

  /* ================================================
     SECTIONS MOBILE
  ================================================ */
  .section {
    padding: 2rem 0 !important;
  }

  .section__header {
    margin-bottom: 1.25rem !important;
    text-align: left !important;
  }

  .section__title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
  }

  .section__subtitle {
    font-size: 0.85rem !important;
    color: #64748b !important;
    margin-top: 0.25rem !important;
  }

  /* ================================================
     PRODUTOS GRID MOBILE — 2 colunas tipo app
  ================================================ */
  .products-grid,
  .products-page__grid,
  #colecao-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* ── Product Card mobile ── */
  .product-card {
    border-radius: var(--radius-card) !important;
    overflow: hidden !important;
    background: #1a1f35 !important;
    border: 1px solid rgba(148,163,184,0.08) !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .product-card:active {
    transform: scale(0.97) !important;
  }

  .product-card__image-wrapper {
    position: relative !important;
    padding-top: 100% !important;
    overflow: hidden !important;
    background: #0f172a !important;
  }

  .product-card__image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
  }

  .product-card__body {
    padding: 0.65rem 0.75rem 0.75rem !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
  }

  .product-card__name,
  .product-card__name--listing {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin: 0 !important;
  }

  .product-card__description {
    display: none !important;
  }

  .product-card__price,
  .product-card__price--listing {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    margin: 0 !important;
  }

  .product-card__footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: auto !important;
    gap: 0.4rem !important;
  }

  .product-card__buy,
  .product-card .btn,
  .product-card .btn--primary {
    font-size: 0.72rem !important;
    padding: 0.4rem 0.6rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }

  /* ── Botão de adicionar ao carrinho nos cards ── */
  .product-card__add-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    background: var(--purple) !important;
    color: #fff !important;
    border: none !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s !important;
  }

  /* ================================================
     COLLECTIONS GRID MOBILE
  ================================================ */
  .collections-grid,
  #home-collections-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .collections-card,
  .collection-card {
    border-radius: var(--radius-card) !important;
    overflow: hidden !important;
  }

  /* ================================================
     PRODUCT DETAIL MOBILE
  ================================================ */
  .product-detail {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding: 1rem 0 3rem !important;
  }

  .product-detail__gallery {
    position: static !important;
  }

  .product-detail__main-img {
    border-radius: 16px !important;
    aspect-ratio: 1 !important;
    width: 100% !important;
    object-fit: cover !important;
    max-height: 320px !important;
  }

  .product-detail__thumbs {
    display: flex !important;
    gap: 0.5rem !important;
    margin-top: 0.6rem !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
    scrollbar-width: none !important;
  }

  .product-detail__thumbs::-webkit-scrollbar { display: none !important; }

  .product-detail__thumb {
    width: 56px !important;
    height: 56px !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
  }

  .product-detail__info {
    gap: 0.85rem !important;
  }

  .product-detail__nome {
    font-size: 1.4rem !important;
    letter-spacing: -0.04em !important;
  }

  .product-detail__preco {
    font-size: 1.6rem !important;
  }

  .product-detail__actions {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }

  .product-detail__actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.9rem !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
  }

  /* ================================================
     ABOUT SECTION MOBILE
  ================================================ */
  .about {
    flex-direction: column !important;
    gap: 1.5rem !important;
    text-align: left !important;
  }

  .about__image-wrapper {
    width: 100% !important;
    max-width: 200px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  .about__image {
    width: 100% !important;
    border-radius: 16px !important;
  }

  /* ================================================
     NEWSLETTER MOBILE
  ================================================ */
  .newsletter {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .newsletter__form {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }

  .newsletter__input,
  .newsletter-strip__input {
    width: 100% !important;
    font-size: 1rem !important;
    padding: 0.85rem 1rem !important;
    border-radius: 12px !important;
  }

  .newsletter__submit,
  .newsletter-strip__submit {
    width: 100% !important;
    padding: 0.85rem !important;
    border-radius: 12px !important;
  }

  .newsletter-strip__inner {
    flex-direction: column !important;
    gap: 1.5rem !important;
    text-align: center !important;
    padding: 2rem 1rem !important;
  }

  /* ================================================
     CONTACT CARDS MOBILE
  ================================================ */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .contact-card {
    padding: 1.25rem !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    border-radius: var(--radius-card) !important;
  }

  .contact-card__icon {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    font-size: 1.3rem !important;
    border-radius: 12px !important;
  }

  .contact-card__arrow {
    margin-top: 0 !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  .contact-hero {
    padding: 2rem 0 1.5rem !important;
    text-align: left !important;
  }

  .contact-hero__title {
    font-size: 1.5rem !important;
  }

  .contact-map {
    border-radius: 16px !important;
    margin-bottom: 2rem !important;
  }

  .contact-map iframe {
    height: 240px !important;
  }

  /* ================================================
     FOOTER MOBILE
  ================================================ */
  .site-footer__inner {
    flex-direction: column !important;
    gap: 1.5rem !important;
    padding: 2rem 1rem !important;
  }

  .site-footer__info {
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  .site-footer__bottom-inner {
    flex-direction: column !important;
    gap: 0.4rem !important;
    text-align: center !important;
    padding: 1rem !important;
  }

  .site-footer__copy,
  .site-footer__dev {
    font-size: 0.75rem !important;
  }

  /* ================================================
     SEARCH BAR MOBILE
  ================================================ */
  .products-page__header {
    padding-top: 0 !important;
  }

  .products-page__header .container {
    padding-top: 1.25rem !important;
    padding-bottom: 0.5rem !important;
  }

  .products-page__heading {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .products-page__title {
    font-size: 1.4rem !important;
    margin: 0 !important;
  }

  .products-toolbar {
    display: flex !important;
    gap: 0.5rem !important;
  }

  .products-toolbar__item {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(148,163,184,0.15) !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
  }

  .search-bar__input {
    font-size: 0.95rem !important;
    padding: 0.8rem 1rem !important;
    border-radius: 12px !important;
    width: 100% !important;
  }

  .search-bar-wrapper {
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
  }

  /* ================================================
     BREADCRUMB MOBILE
  ================================================ */
  .breadcrumb__list {
    font-size: 0.75rem !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }

  /* ================================================
     COLLECTIONS PAGE HEADER MOBILE
  ================================================ */
  .collections-header {
    padding-top: 1.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .collections-header__title {
    font-size: 1.4rem !important;
  }

  .collections-header__subtitle {
    font-size: 0.85rem !important;
  }

  /* ================================================
     PAGINATION MOBILE
  ================================================ */
  .pagination {
    justify-content: center !important;
    gap: 0.4rem !important;
    margin-top: 1.5rem !important;
    padding-bottom: 2rem !important;
  }

  .pagination__control,
  .pagination__page {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
  }

  /* ================================================
     WHATSAPP FLOAT — reposiciona no mobile
  ================================================ */
  .whatsapp-float {
    bottom: 1.25rem !important;
    right: 1rem !important;
    width: 52px !important;
    height: 52px !important;
  }

  /* ================================================
     CARRINHO MOBILE — fullscreen
  ================================================ */
  .cart-drawer {
    width: 100vw !important;
    border-left: none !important;
    border-radius: 0 !important;
  }

  .cart-drawer__header {
    padding: 1rem 1.25rem !important;
  }

  .cart-drawer__items {
    padding: 0.75rem 1rem !important;
  }

  .cart-drawer__footer {
    padding: 0.75rem 1rem 2.5rem !important;
  }

  /* ================================================
     ANIMAÇÕES MOBILE — suaves e rápidas
  ================================================ */

  /* cards entram de baixo */
  @keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .product-card,
  .collections-card,
  .collection-card,
  .contact-card {
    animation: cardSlideUp 0.4s ease both;
  }

  /* stagger nos grids */
  .products-grid .product-card:nth-child(1),
  .products-page__grid .product-card:nth-child(1) { animation-delay: 0.05s; }
  .products-grid .product-card:nth-child(2),
  .products-page__grid .product-card:nth-child(2) { animation-delay: 0.1s; }
  .products-grid .product-card:nth-child(3),
  .products-page__grid .product-card:nth-child(3) { animation-delay: 0.15s; }
  .products-grid .product-card:nth-child(4),
  .products-page__grid .product-card:nth-child(4) { animation-delay: 0.2s; }
  .products-grid .product-card:nth-child(5),
  .products-page__grid .product-card:nth-child(5) { animation-delay: 0.25s; }
  .products-grid .product-card:nth-child(6),
  .products-page__grid .product-card:nth-child(6) { animation-delay: 0.3s; }

  /* hero anima suave */
  .hero__eyebrow  { animation: cardSlideUp 0.5s ease 0.1s both; }
  .hero__title    { animation: cardSlideUp 0.5s ease 0.2s both; }
  .hero__subtitle { animation: cardSlideUp 0.5s ease 0.3s both; }
  .hero__actions  { animation: cardSlideUp 0.5s ease 0.4s both; }
  .hero-card      { animation: cardSlideUp 0.6s ease 0.35s both; }

  /* página entra suave */
  main { animation: fadeInPage 0.35s ease both; }

  @keyframes fadeInPage {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* reveal classes */
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* tap feedback nos botões */
  .btn:active,
  .product-card:active,
  .contact-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s ease !important;
  }

  /* ================================================
     SEÇÃO SOBRE MOBILE
  ================================================ */
  .section__title--left { font-size: 1.2rem !important; }
  .about__text { font-size: 0.88rem !important; line-height: 1.65 !important; }

  /* ================================================
     NEWSLETTER CARD MOBILE
  ================================================ */
  .newsletter-card {
    border-radius: 16px !important;
    padding: 1.25rem !important;
  }

  .newsletter-card__title {
    font-size: 1rem !important;
  }

  .newsletter-card__text {
    font-size: 0.85rem !important;
  }

  .btn--whatsapp.btn--block {
    padding: 0.85rem !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
  }

} /* fim @media 768px */

/* ================================================
   TELAS MUITO PEQUENAS (< 380px)
================================================ */
@media (max-width: 380px) {
  .products-grid,
  .products-page__grid,
  .collections-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .product-card__name { font-size: 0.72rem !important; }
  .product-card__price { font-size: 0.82rem !important; }

  .hero__title { font-size: 1.5rem !important; }
  .hero__actions { flex-direction: column !important; }
  .hero__actions .btn { padding: 0.7rem !important; }
}

/* ================================================
   TABLET (769 — 1024px)
================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .products-grid,
  .products-page__grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .collections-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .hero__content {
    gap: 2rem !important;
  }

  .product-detail {
    gap: 2rem !important;
  }
}