@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  :root {
    --mobile-header-offset: clamp(180px, 28vh, 240px);
  }

  .header {
    position: fixed;
    top: 0;
    height: auto;
    padding: calc(8px + env(safe-area-inset-top)) 12px 10px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 0;
    z-index: 10100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 102, 204, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  }

  .left-area,
  .logo-area,
  .right-area {
    position: static;
  }

  .logo-area {
    left: auto;
    transform: none;
  }

  .left-area {
    width: 100%;
    order: 2;
    padding: 6px 0 2px;
  }

  .menu {
    gap: 8px;
    font-size: 0.82rem;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .menu a,
  .menu-auth-btn,
  .menu-cart-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 0;
    font-weight: 600;
  }

  .menu-auth-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
  }

  .logo-area {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 6px;
    min-height: 54px;
  }

  .logo {
    width: min(240px, 62vw);
    display: block;
    height: auto;
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .brand-home {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }

  .brand-text {
    display: none;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .brand-home.logo-error .brand-text {
    display: inline;
  }

  .brand-home.logo-error .logo {
    display: none;
  }

  .right-area {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .lang-selector {
    gap: 8px;
    align-items: center;
  }

  .lang-selector img {
    width: 26px;
    height: 26px;
  }

  .hero,
  .checkout {
    padding-top: var(--mobile-header-offset);
  }

  .hero {
    min-height: auto;
    align-items: center;
    justify-content: center;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero-content {
    margin-top: 0;
    padding: 18px 16px;
  }

  .hero h1 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .btn-hero,
  .btn-card {
    min-height: 42px;
  }

  .produtos {
    padding: 36px 12px 56px;
  }

  .produtos h2 {
    font-size: 1.5rem;
    margin-bottom: 22px;
  }

  .products-search-wrap {
    margin: 0 auto 14px;
    max-width: 100%;
  }

  .products-search {
    font-size: 16px;
    padding: 11px 12px;
  }

  .grid-produtos {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 16px;
  }

  .card-img {
    height: 140px;
  }

  .card h3 {
    font-size: 1rem;
  }

  .card p {
    font-size: 0.86rem;
  }

  .auth-modal {
    top: 0 !important;
    bottom: 0;
    padding: 14px 10px calc(12px + env(safe-area-inset-bottom));
    align-items: flex-end !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(88vh, 760px);
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 16px calc(22px + env(safe-area-inset-bottom));
  }

  .auth-form input,
  .auth-form button {
    font-size: 16px;
  }

  .cart-modal {
    width: 100%;
    right: -100%;
    border-radius: 18px 18px 0 0;
  }

  .cart-modal.active {
    right: 0;
  }

  .cart-modal-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .cart-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #f0f0f0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .fab-container {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .fab {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .footer {
    padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
    font-size: 0.82rem;
  }

  a:focus-visible,
  button:focus-visible,
  input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-header-offset: clamp(170px, 30vh, 220px);
  }

  .header {
    padding-inline: 10px;
  }

  .logo {
    width: min(210px, 68vw);
    max-height: 64px;
    max-width: 100%;
  }

  .brand-text {
    font-size: 0.76rem;
  }

  .menu {
    gap: 6px;
    font-size: 0.76rem;
  }

  .menu a,
  .menu-auth-btn,
  .menu-cart-btn {
    min-height: 38px;
    padding: 4px 0;
    white-space: normal;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .hero p {
    font-size: 0.85rem;
  }

  .lang-selector img {
    width: 24px;
    height: 24px;
  }

  .fab {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}