@media (max-width: 640px) {

  /* Reset leve */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  img,
  video,
  canvas {
    max-width: 100%;
    height: auto;
    display: block;
  }

  button {
    font: inherit;
    cursor: pointer;
  }

  /* FORMULÁRIOS BASE */
  form {
    width: min(94%, 600px);
    margin: 28px auto;
    padding: 22px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    color: #000;
    animation: fadeForm .35s ease-out;
  }

  form input,
  form select,
  form textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 12px 0;
    border: 1px solid #c7c7c7;
    border-radius: 8px;
    font-size: 16px;
    background: #f8f9fc;
    transition: border-color .25s, box-shadow .25s;
  }

  form input:focus {
    border-color: #5d8bff;
    box-shadow: 0 0 5px rgba(93, 139, 255, .4);
    outline: none;
  }

  /* BOTÕES GERAIS */
  button,
  .btn {
    padding: 12px 20px;
    margin: 12px 0;
    border: none;
    border-radius: 10px;
    background-color: #5d8bff;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .25s, transform .15s;
    min-height: 44px;
  }

  button:hover,
  .btn:hover {
    background: #4a76e8;
  }

  button:active {
    transform: scale(.98);
  }

  /* ==================== LOGIN ==================== */

  .formLogin label {
    font-weight: 600;
    color: #3b3b98;
  }

  .formLogin input {
    margin-bottom: 18px;
  }

  /* Header login */
  .headerLogin {
    background: linear-gradient(135deg, #5553f2, #48437d);
    width: 100%;
    height: 10dvh;
    color: #e7e6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 6px;
  }

  /* Botão cadastro */
  .btnCadastrar {
    width: min(90%, 340px);
    margin: 20px auto 0;
    padding: 14px;
    border-radius: 14px;
    background: #5d8bff;
    color: #fff;
    text-align: center;
    font-weight: 800;
    letter-spacing: .4px;
    transition: filter .15s, transform .05s;
  }

  .btnCadastrar:hover {
    filter: brightness(1.06);
  }

  .btnCadastrar:active {
    transform: translateY(1px);
  }

  /* Texto "ou" */
  .ou {
    text-align: center;
    font-weight: 700;
    color: #3b3b98;
    margin: 8px 0;
  }

  /* Some o texto lateral */
  .TextoLogin {
    display: none;
  }

  /* ==================== CADASTRO ==================== */

  .TelaCadastro {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    background: linear-gradient(135deg, #300399, #6e6cfa);
    padding: 20px;
  }

  .formCadastro {
    width: min(94%, 700px);
    background: #ffffff;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    animation: fadeForm .35s ease-out;
  }

  .formCadastro label {
    font-weight: 600;
    color: #3b3b98;
  }

  .formCadastro input {
    margin-bottom: 18px;
  }

  .formCadastro button {
    margin-top: 12px;
  }

  /* Header cadastro */
  .headerCadastro {
    background: linear-gradient(135deg, #5553f2, #48437d);
    width: 100%;
    height: 10dvh;
    color: #e7e6ff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 6px;
  }

  /* Animação */
  @keyframes fadeForm {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Texto lateral do login: some no mobile para não sobrepor */
  .TextoLogin {
    position: absolute;
    left: 20px;
    top: 100px;
    max-width: 300px;
    color: rgb(175, 203, 255);
    text-align: right;
  }

  @media (max-width: 768px) {
    .TextoLogin {
      display: none;
    }
  }

  /* ==================== DASHBOARD / SIDEBAR ==================== */
  body.body-funcionarios {
    background: rgb(230, 210, 210);
    margin: 0;
  }

  .sidebar {
    width: 150px;
    background: #96bddf;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: transform .25s ease;
  }

  @media (max-width: 1024px) {
    body.body-funcionarios {
      margin-left: 0;
    }

    .sidebar.open {
      transform: translateX(0);
    }

    /* adicione/retire .open via JS */
  }

  /* Header */
  .dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    text-align: center;
    padding: 16px 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .dashboard-header .btn-add {
    padding: 10px 20px;
    background-color: #5553f2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }

  /* ==================== TOKENS ==================== */
  :root {
    --azul-escuro: #073477;
    --azul-medio: #1e5ab6;
    --azul-claro: #eaf3fb;
    --azul-hover: #0a47a1;
    --cinza: #f5f5f5;
    --cinza-claro: #e0e0e0;
    --branco: #fff;
    --sombra: 0 4px 24px rgba(7, 52, 119, .08);
    --borda: 1px solid #e0e0e0;

    --azul-900: #0f1f3d;
    --azul-700: #1d3f73;
    --azul-600: #24559c;
    --azul-500: #2f6fca;
    --azul-300: #9ec0ff;
    --azul-100: #eaf2ff;
    --bege-50: #fff9ef;
    --bege-100: #f6efe1;
    --bege-200: #e9dcc3;
    --txt-prim: #18233b;
    --txt-sec: #51607a;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --shadow-sm: 0 6px 16px rgba(15, 31, 61, .08);
    --shadow-md: 0 12px 28px rgba(15, 31, 61, .14);
    --shadow-lg: 0 18px 44px rgba(15, 31, 61, .18);
  }



  /* Hero */
  .home {
    background: url('https://www.agenciabravia.com.br/wp-content/uploads/2024/10/Boa-Padaria-e-Confeitaria.png') center/cover no-repeat;
    width: 100%;
    height: 42vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(36, 85, 156, .08);
  }

  /* ==================== TÍTULOS / HEADER ==================== */
  .titulo {
    padding: 26px 16px 8px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .75));
    backdrop-filter: blur(6px);
  }

  .titulo h1 {
    font-size: clamp(28px, 4vw, 42px);
    color: var(--azul-700);
    letter-spacing: .4px;
  }

  .paragrafo p {
    margin-top: 6px;
    font-size: 15px;
    color: var(--txt-sec);
  }

  /* ==================== MENU DE CATEGORIAS ==================== */
  nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(36, 85, 156, .08);
  }

  nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding: 12px 16px;
    overflow: auto;
  }

  nav ul li {
    flex: 0 0 auto;
  }

  nav ul li a {
    text-decoration: none;
    font-weight: 700;
    color: var(--azul-700);
    background: var(--bege-100);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(36, 85, 156, .10);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    white-space: nowrap;
  }

  nav ul li a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  /* ==================== CONTAINER ==================== */
  .container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px 4px;
  }

  .container>h2 {
    color: var(--azul-600);
    font-size: clamp(18px, 2.4vw, 22px);
    margin: 10px 6px 14px;
    letter-spacing: .3px;
  }

  /* ==================== GRID / CARD PRODUTO ==================== */
  .produtos-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
  }

  @media (min-width:560px) {
    .produtos-grid {
      gap: 18px;
    }
  }

  @media (min-width:900px) {
    .produtos-grid {
      gap: 20px;
    }
  }

  .card {
    grid-column: span 12;
    background: linear-gradient(180deg, #fff, var(--bege-50));
    border: 1px solid rgba(36, 85, 156, .08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  }

  @media (min-width:560px) {
    .card {
      grid-column: span 6;
    }
  }

  @media (min-width:900px) {
    .card {
      grid-column: span 4;
    }
  }

  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(36, 85, 156, .16);
  }

  .card img {
    width: 116px;
    height: 116px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--bege-200);
    box-shadow: inset 0 0 0 1px rgba(36, 85, 156, .08);
  }

  .card-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .card-details h3 {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--azul-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 10px 0 5px 0;
  }

  .card-details p {
    font-size: 14px;
    color: var(--txt-sec);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-details .preco {
    margin-top: 6px;
    font-weight: 800;
    color: var(--azul-600);
    display: inline-block;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--bege-100);
    border: 1px solid rgba(36, 85, 156, .10);
  }

  /* ==================== TABELAS ==================== */
  .produtos-table {
    margin-top: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 18px;
    min-width: 640px;
    /* permite scroll horizontal no mobile */
  }

  .products-table th,
  .products-table td {
    padding: 16px 18px;
    text-align: left;
    background: var(--branco);
    border-radius: 10px;
    font-size: 1rem;
    box-shadow: var(--sombra);
    border: none;
  }

  .products-table th {
    background: var(--azul-medio);
    color: var(--branco);
    font-weight: 700;
    letter-spacing: .5px;
    border-bottom: var(--borda);
  }

  .products-table tbody tr {
    transition: box-shadow .2s, transform .2s;
  }

  .products-table tbody tr:hover {
    box-shadow: 0 8px 32px rgba(30, 90, 182, .15);
    transform: scale(1.01);
  }

  /* ==================== ESTADOS / AÇÕES ==================== */
  .products-table td .status {
    padding: 6px 18px;
    border-radius: 20px;
    font-size: .95rem;
    font-weight: 600;
    background: var(--cinza-claro);
    color: var(--azul-escuro);
    display: inline-block;
  }

  .products-table td .status.ativo {
    background: var(--azul-medio);
    color: var(--branco);
  }

  .products-table td .status.inativo {
    background: #b0b0b0;
    color: var(--branco);
  }

  .products-table td .btn {
    background: var(--azul-medio);
    color: var(--branco);
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .98rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 8px;
    transition: background .2s;
    min-height: 44px;
  }

  .products-table td .btn:hover {
    background: var(--azul-hover);
  }

  /* ==================== MODAL GENÉRICO ==================== */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: rgba(7, 52, 119, .18);
    justify-content: center;
    align-items: center;
  }

  .modal.active,
  .modal[aria-hidden="false"] {
    display: flex !important;
  }

  .modal-dialog {
    background: var(--branco);
    padding: clamp(1.25rem, 4vw, 3rem);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(30, 90, 182, .18);
    width: clamp(320px, 90vw, 700px);
    position: relative;
    animation: modalShow .3s ease;
  }

  @media (min-width:768px) {
    .modal-dialog {
      width: 60vw;
      padding: 3rem 4rem;
    }
  }

  @keyframes modalShow {
    from {
      opacity: 0;
      transform: translateY(-40px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  .modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 2rem;
    color: var(--azul-medio);
    cursor: pointer;
  }

  .modal-close:hover {
    color: var(--azul-hover);
  }

  .modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
  }

  .modal-form input[type="text"],
  .modal-form input[type="number"],
  .modal-form textarea {
    padding: 10px 14px;
    border-radius: 8px;
    border: var(--borda);
    font-size: 1rem;
    background: var(--cinza);
    color: var(--azul-escuro);
    outline: none;
    transition: border .2s;
  }

  .modal-form input[type="text"]:focus,
  .modal-form input[type="number"]:focus,
  .modal-form textarea:focus {
    border: 1.5px solid var(--azul-medio);
  }

  .modal-form input[type="file"] {
    margin-top: 6px;
    font-size: .98rem;
  }

  .modal-form .btn-add {
    margin-top: 12px;
    width: 100%;
    padding: 12px 0;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  /* ==================== MODAL CARRINHO ==================== */
  qazz .modal-carrinho {
    display: none;
    position: fixed;
    /* fixa o modal */
    inset: 0;
    /* ocupa a tela toda */
    background: rgba(0, 0, 0, .6);
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
    /* scroll só no modal */
  }

  /* trava o fundo do site quando o modal abre */
  body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }


  .modal-carrinho.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* fixo no topo */
    padding-top: 40px;
    /* dá um respiro bonito */
  }


  .modal-dialog-carrinho {
    background: #fff;
    border-radius: 12px;
    width: min(92%, 800px);
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 90vh;
    /* nunca ultrapassa a altura da tela */
    overflow-y: auto;
    /* conteúdo rola dentro */
  }

  .modal-close-carrinho {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 99999;
    cursor: pointer;
    font-size: 28px;
    display: block;
  }


  .modal-close-carrinho:hover {
    color: #ff0000;
  }

  .modal-dialog-carrinho h2 {
    margin-top: 0;
    font-size: 24px;
    color: #222;
    text-align: center;
  }

  .carrinho-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
  }

  .carrinho-table th,
  .carrinho-table td {
    padding: 12px 10px;
    text-align: left;
  }

  .carrinho-table th {
    background: #f5f5f5;
    font-weight: 600;
  }

  .carrinho-table tr {
    display: block;
    background: #ffffff;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }

  .carrinho-table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .carrinho-table td:last-child {
    border-bottom: none;
  }

  /* Adiciona o "nome do campo" automaticamente */
  .carrinho-table td:before {
    content: attr(data-label);
    font-weight: 700;
    color: #3b3b98;
  }

  .total {
    text-align: right;
    font-size: 18px;
    margin-top: 12px;
    font-weight: bold;
    color: #222;
  }

  .finalizar-compra {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
  }

  .finalizar-compra .btn {
    background: #4053a8;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    transition: .2s;
  }

  .finalizar-compra .btn:hover {
    background: #303f8a;
  }

  @media (max-width: 600px) {
    .modal-dialog-carrinho {
      padding: 20px;
    }

    .carrinho-table th,
    .carrinho-table td {
      font-size: 14px;
      padding: 8px;
    }

    .total {
      font-size: 16px;
    }

    .finalizar-compra .btn {
      padding: 8px 16px;
      font-size: 14px;
    }
  }

  /* ==================== MODAL PRODUTO (sheet no mobile) ==================== */
  .modal-produto {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .55);
    z-index: 1000;
    padding: 24px;
  }

  .modal-produto.active {
    display: flex;
  }

  .modal-dialog-produto {
    background: #fff;
    color: #1f2937;
    width: min(960px, 96vw);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 20px;
    padding: 20px;
    position: relative;
    max-height: 88dvh;
    overflow: auto;
    animation: slideUp .2s ease-out;
    border: 1px solid rgba(36, 85, 156, .10);
  }

  .modal-close-produto {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 0;
    background: #f3f4f6;
    color: #111827;
    font-size: 22px;
    cursor: pointer;
  }

  .modal-produto-left {
    display: flex;
    align-items: stretch;
  }

  .modal-media {
    position: relative;
    width: 100%;
  }

  .modal-media img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 14px;
    background: #f3f4f6;
  }

  .media-badges {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
  }

  .badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    background: rgba(255, 255, 255, .9);
    color: #111827;
    backdrop-filter: blur(6px);
  }

  .badge.best {
    background: #fde68a;
  }

  .badge.time {
    background: #d1fae5;
  }

  .modal-produto-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .modal-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #111827;
  }

  .modal-head .descricao {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
  }

  .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .preco {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 800;
    color: #111827;
    font-size: 28px;
  }

  .rating {
    color: #10b981;
    font-weight: 700;
  }

  .rating small {
    color: #6b7280;
    font-weight: 600;
    margin-left: 4px;
  }

  .qty-notes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .qty-label,
  .notes-label {
    font-size: 13px;
    color: #374151;
    font-weight: 700;
  }

  .qty-stepper {
    display: inline-flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px;
  }

  .qty-stepper input {
    width: 72px;
    text-align: center;
    border: 0;
    background: transparent;
    font-size: 16px;
    color: #111827;
  }

  .qty-stepper .step {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
  }

  .qty-stepper .step:hover {
    background: #f3f4f6;
  }

  .notes {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    resize: vertical;
    min-height: 70px;
    font: inherit;
    color: #111827;
    background: #fff;
  }

  .notes::placeholder {
    color: #9ca3af;
  }

  .subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
  }

  .subtotal-row strong {
    font-size: 18px;
    color: #111827;
  }

  .cta-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .btn.full {
    width: 100%;
  }

  .btn.btn-add {
    background: linear-gradient(90deg, #7c3aed, #4f46e5);
    border: 0;
  }

  .btn.btn-pay.ghost {
    background: #fff;
    color: #4f46e5;
    border: 2px solid #e5e7eb;
  }

  .btn.btn-pay.ghost:hover {
    border-color: #c7c9cf;
  }

  @media (max-width: 900px) {
    .modal-dialog-produto {
      grid-template-columns: 1fr;
      padding: 16px;
      width: 100%;
      border-radius: 16px;
    }
  }

  @media (max-width: 640px) {
    .modal-produto {
      align-items: flex-end;
      padding: 0;
    }

    @keyframes slideUp {
      from {
        transform: translateY(24px);
        opacity: .96;
      }

      to {
        transform: none;
        opacity: 1;
      }
    }
  }

  /* ==================== FOOTER ==================== */
  .rodape {
    margin-top: 28px;
    padding: 18px 12px;
    text-align: center;
    color: #fff;
    background: linear-gradient(90deg, var(--azul-700), var(--azul-600));
  }

  /* ==================== AJUSTES FINOS ==================== */
  @media (max-width: 520px) {
    .card {
      padding: 10px;
    }

    .card img {
      width: 96px;
      height: 96px;
    }

    nav ul {
      gap: 10px;
      padding: 10px;
    }
  }

  /* ===== BAG FLUTUANTE ===== */
  .BagFlutuante {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
  }

  .bag-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, #1d3f73, #2f6fca);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 10px 14px 10px 12px;
    box-shadow: 0 14px 34px rgba(15, 31, 61, .25);
  }

  .bag-btn:hover {
    filter: brightness(1.06);
  }

  .bag-icone {
    position: relative;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08);
  }

  .bag-icone::before {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    top: -6px;
    height: 10px;
    border: 3px solid #fff;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
  }

  .bag-icone::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    top: 10px;
    height: 6px;
    background: rgba(29, 63, 115, .25);
    border-radius: 4px;
  }

  .bag-contador {
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    background: #ff3d3d;
    color: #fff;
    font-weight: 800;
    text-align: center;
    border-radius: 999px;
    font-size: 13px;
    padding: 0 6px;
  }

  .bag-contador[data-zero="true"] {
    display: none;
  }

  .bag-total {
    font-weight: 800;
    font-size: 14px;
    background: rgba(255, 255, 255, .16);
    padding: 6px 10px;
    border-radius: 12px;
  }

  @media (max-width: 460px) {
    .bag-total {
      font-size: 13px;
    }

    .bag-btn {
      padding: 9px 12px 9px 10px;
    }

    .bag-icone {
      width: 28px;
      height: 28px;
    }
  }

  /* ==================== PORTAIS (cards lado a lado) ==================== */
  .portal-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    margin: 20px auto;
    max-width: 900px;
    flex-wrap: wrap;
  }

  .portal {
    flex: 1;
    min-width: 280px;
    background: #fff8e1;
    border: 2px solid #4053a8;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    transition: transform .2s, box-shadow .2s;
  }

  .portal:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(64, 83, 168, .2);
  }

  .portal-icon {
    font-size: 36px;
    color: #4053a8;
    margin-right: 15px;
  }

  .portal-text {
    flex: 1;
  }

  .portal-text h3 {
    margin: 0;
    font-size: 18px;
    color: #132574;
  }

  .portal-text p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #555;
  }

  .btn_meusepdidos {
    background: #4053a8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background .2s;
    min-height: 44px;
    width: 85px;
  }

  .btn_meusepdidos:hover {
    background: #2d3f85
  }


  .portal-btn {
    background: #4053a8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background .2s;
    min-height: 44px;
  }

  .portal-btn:hover {
    background: #2d3f85;
  }

  .modal-endereco.active {
    display: flex;
  }

  .modal-header-endereco {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .btn-localizacao {
    background: #4053a8;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    min-height: 44px;
  }

  .btn-localizacao:hover {
    background: #2d3f85;
  }

  .field label {
    display: block;
    font-size: 13px;
    color: #4053a8;
    margin-bottom: 6px;
    font-weight: 700;
  }

  .field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e6e6f2;
    background: #fff;
    font-size: 16px;
    color: #222;
    outline: none;
  }

  .field input:focus {
    border-color: #4053a8;
    box-shadow: 0 0 0 3px rgba(64, 83, 168, .12);
  }

  .grid-dupla {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  @media (max-width: 600px) {
    .grid-dupla {
      grid-template-columns: 1fr;
    }
  }

  .endereco-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 4px;
  }

  .btn-outline {
    background: #fff;
    color: #4053a8;
    border: 2px solid #4053a8;
  }

  .btn-outline:hover {
    background: #f4f6ff;
  }

  .modal-close-endereco {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #4053a8;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
  }

  .modal-close-endereco:hover {
    background: #2d3f85;
  }

  /* Resumo */
  .modal-endereco-resumo {
    display: none;
  }

  .modal-endereco-resumo.active {
    display: block;
  }

  /* ==================== TOAST (topo direito, com notch) ==================== */
  #toast-root {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
    top: 12px !important;
    right: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
  }

  @supports(padding: env(safe-area-inset-top)) {
    #toast-root {
      padding-top: env(safe-area-inset-top) !important;
    }
  }

  .bd-toast {
    display: block !important;
    opacity: 1 !important;
  }



  /*/*
/* ====== PATCH MOBILE (cole no final do arquivo) ====== */

  /* 1) Correções gerais */
  html,
  body {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* evita zoom no iOS */

  /* 2) LOGIN: garante que o botão "Criar Conta" não escape */
  .TelaLogin {
    padding: 16px 0 28px;
    background-color: #000;
  }

  .formLogin {
    width: min(94%, 420px);
    margin: 32px auto 8px;
    position: relative;
  }


  /* 3) MODAL DE ENDEREÇO – layout realmente mobile */
  .modal-endereco {
    padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom) 12px;
  }

  .modal-dialog-endereco {
    width: 100%;
    max-width: 560px;
    margin: 8px auto;
    padding: 16px 16px 88px;
    /* espaço pro footer sticky */
    border-radius: 14px;
    border-width: 1.5px;
  }

  .endereco-form {
    gap: 12px;
  }

  .field input {
    padding: 13px 14px;
    border-radius: 12px;
    line-height: 1.25;
  }

  /* GRID dupla que colapsa cedo (melhor para iPhone) */
  .grid-dupla {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  @media (max-width: 640px) {
    .grid-dupla {
      grid-template-columns: 1fr;
    }
  }

  /* 3.1) Footer sticky com botões iguais (Salvar | Excluir | Usar endereço) */
  .endereco-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px;
    margin: 0;
    gap: 10px;
    z-index: 1;
    border-top: 1px solid #e9e9f3;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .endereco-actions .btn,
  .endereco-actions button {
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
  }

  .endereco-actions .btn-outline {
    background: #fff;
    color: #4053a8;
    border: 2px solid #4053a8;
  }

  @media (max-width: 420px) {
    .endereco-actions {
      grid-template-columns: 1fr;
    }
  }

  /* 4) Evita corte lateral de qualquer botão grande no iPhone */
  button,
  .btn {
    max-width: 100%;
  }

  /* 5) Ajuste fino: inputs dentro do modal respeitam largura do container */
  .modal-dialog-endereco .field input {
    width: 100%;
  }

  /* 6) (Opcional) Títulos do modal: mantém espaço e legibilidade no mobile */
  .modal-header-endereco h2 {
    font-size: 18px;
    margin: 0;
  }
}


/* ========================
   CARRINHO - MOBILE FIX  
   ======================== */

/* Só aplica no celular */
@media (max-width: 650px) {

  /* Esconde o cabeçalho da tabela no celular */
  .carrinho-table thead {
    display: none !important;
  }

  /* Cada item vira um card */
  .carrinho-table tbody tr {
    display: block;
    background: #ffffff;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  }

  /* Cada célula vira uma linha descritiva */
  .carrinho-table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .carrinho-table td:last-child {
    border-bottom: none;
  }

  /* “Produto / Qtd / Preço / Subtotal” aparece antes dos valores */
  .carrinho-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #3b3b98;
    margin-right: 10px;
  }

  /* Ajuste no título e no botão para caber bonitinho */
  .modal-dialog-carrinho h2 {
    font-size: 22px;
    text-align: center;
  }

  .finalizar-compra .btn {
    width: 100%;
    margin-top: 10px;
  }
}


/* Linha completa de cada item */
.carrinho-table tr {
  padding: 18px 14px;
  border-radius: 14px;
  background: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Campo de quantidade */
.carrinho-table input.qtd {
  width: 48px !important;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 16px;
}

/* Remover setinhas no iPhone/Chrome */
.carrinho-table input.qtd::-webkit-inner-spin-button,
.carrinho-table input.qtd::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Linha quantidade: input + botão remover */
.carrinho-table td .qtd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  /* espaço maior do input para o X */
}

/* Botão remover */
.carrinho-table .rm {
  background: #3f5efb;
  color: #fff;
  border: none;
  width: 40px;
  height: 38px;
  border-radius: 10px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.carrinho-table .rm:active {
  transform: scale(0.95);
}
/* layout geral */
.produtos {
    padding: 20px;
    max-width: 1100px;
    margin: auto;
    font-family: "Poppins", sans-serif;
}

/* Título */
.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #2E2E2E;
    margin-bottom: 20px;
}

/* Barra de busca estilo iFood */
.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #E4E4E4;
    background: #fafafa;
    transition: 0.2s;
    font-size: 16px;
}
.search-bar input:focus {
    border-color: #fe4a16;
    box-shadow: 0 0 0 3px rgba(254, 74, 22, 0.15);
}

/* Categoria */
.category-header {
    font-size: 21px;
    font-weight: 600;
    margin: 15px 0 10px;
    color: #3a3a3a;
}

/* GRID de produtos */
.product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* CARD estilo iFood */
.product-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: 0.25s;
    border: 1px solid #f1f1f1;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Nome e preço */
.product-name {
    font-size: 18px;
    font-weight: 600;
    color: #2E2E2E;
}
.product-price {
    font-size: 17px;
    font-weight: 700;
    margin-top: 5px;
    color: #fe4a16;
}

/* Status estilo iFood */
.product-status {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    width: fit-content;
}
.product-status.ativo {
    background: #d6ffe7;
    color: #0d8a3c;
}
.product-status.inativo {
    background: #ffe1e1;
    color: #d64545;
}

/* Ações */
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.product-actions .btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
    font-weight: 600;
}

/* Editar */
.btn-edit {
    background: #ffa726;
    color: white;
}
.btn-edit:hover {
    background: #ff9800;
}

/* Status */
.btn-status {
    background: #42a5f5;
    color: white;
}
.btn-status:hover {
    background: #1e88e5;
}

/* Excluir */
.btn-delete {
    background: #e53935;
    color: white;
}
.btn-delete:hover {
    background: #c62828;
}

/* Modal estilo iFood */
.modal-dialog {
    background: white;
    padding: 25px;
    border-radius: 18px;
    max-width: 420px;
    width: 100%;
    animation: fadeUp .25s ease-out;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-form input,
.modal-form textarea,
.modal-form select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e4e4e4;
    margin-bottom: 10px;
}
.modal-form button {
    background: #fe4a16;
    color: white;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
}
.modal-form button:hover {
    background: #e94617;
}

/* ============================================================
   RESPONSIVIDADE TOTAL PARA CELULARES (TELAS ATÉ 480px)
============================================================ */

@media (max-width: 480px) {

    /* Layout geral */
    body.ifood-panel-body {
        flex-direction: column;
    }

    /* ----- SIDEBAR ----- */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 15px;
    }

    .sidebar-header h2 {
        font-size: 18px;
        text-align: center;
    }

    .sidebar-nav a {
        font-size: 15px;
        padding: 10px;
    }

    /* ----- MAIN CONTENT ----- */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .main-header h1 {
        font-size: 20px;
        text-align: center;
    }

    /* ----- GRID EM CARROSSEL ----- */
    .gestao-grid {
        display: flex;
        overflow-x: auto;
        gap: 14px;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
    }

    .gestao-grid .coluna {
        min-width: 300px;
        max-width: 300px;
        scroll-snap-align: center;
        background: #fff;
        padding: 12px;
        border-radius: 12px;
        border: 1px solid #e5e5e5;
    }

    .coluna h2 {
        font-size: 16px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        padding-bottom: 6px;
    }

    /* ----- CARDS ----- */
    .card-pedido {
        padding: 15px;
        font-size: 15px;
    }

    .card-pedido h3 {
        font-size: 16px;
    }

    .btn {
        padding: 9px;
        font-size: 14px;
    }

    /* ----- MODAL ----- */
    .pedido-modal {
        width: 92%;
        max-width: 92%;
        padding: 15px;
    }

    .modal-title {
        font-size: 20px;
    }

    #modal-content-wrapper p {
        font-size: 14px;
    }

    #modal-itens-lista li {
        font-size: 14px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================================
   TABLETS / TELAS MÉDIAS (481px - 768px)
============================================================ */

@media (max-width: 768px) {

    .sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: 190px;
    }

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

    .pedido-modal {
        width: 80%;
        max-width: 450px;
    }
}
