:root {
  --primary-color: #ff6f61;
  --secondary-color: #ffa07a;
  --text-color: #333;
  --light-text: #fff;
  --background: #fffaf0;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background);
  padding: 20px;
}

/* Navbar Styles */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.navbar-brand a {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 20px;
}

.navbar-menu li a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-menu li a:hover {
  color: var(--primary-color);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.navbar-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

.navbar-menu li a.active {
  color: var(--primary-color);
  font-weight: bold;
}

@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: var(--card-shadow);
    padding: 20px;
    border-radius: 0 0 10px 10px;
    z-index: 1000;
  }

  .navbar-menu.active {
    display: flex;
  }

  .navbar-menu li {
    margin: 10px 0;
  }

  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 0;
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

.header h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.header p {
  color: #7f8c8d;
  font-size: 1.1rem;
}

/* Hero Section */
.hero {
  position: relative;
  height: 500px;
  background: url("../images/hero-image.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 10px;
  margin-bottom: 40px;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  color: var(--light-text);
  z-index: 1;
}

.hero-content h2 {
  font-size: 2.8rem;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: var(--light-text);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cta-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* Featured Products Section */
.container {
  margin: 40px auto;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

/* Igual ao container mas ocupa toda a largura disponível (como o hero) */
.page-card {
  margin: 40px 0;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

.page-card h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: center;
}

.container h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: center;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 15px;
}

.featured-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  aspect-ratio: 4/3;
}

.featured-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-img {
  transform: scale(1.1);
}

.card-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--light-text);
  padding: 20px 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.featured-card:hover .card-caption {
  opacity: 1;
}

.card-caption h3 {
  margin-bottom: 5px;
  font-size: 1.2rem;
}

/* Products Section - layout original preservado */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 15px;
}

.product-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 15px;
  background-color: white;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.product-card > a {
  display: block;
  text-decoration: none;
}

.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  display: block;
  margin-bottom: 15px;
}

.product-info {
  text-align: center;
}

.product-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.product-info .price {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 10px;
}

.product-info p {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 15px;
}

.add-to-cart-btn {
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* About Section */
.about-section {
  text-align: center;
}

.about-section p {
  color: var(--text-color);
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Contact Section */
.contact-section ul,
#contact ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

.contact-section ul li,
#contact ul li {
  margin: 10px 0;
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Dentro do card, o formulário deve ocupar toda a largura disponível */
.contact-card .contact-form {
  max-width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.error-message {
  color: #d32f2f;
  font-size: 0.9rem;
  display: none;
}

.submit-button {
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  border-radius: 25px;
  font-weight: 500;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: center;
}

.submit-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 10px 0;
  margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero {
    height: 400px;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .hero {
    height: 350px;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .contact-form {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .hero {
    height: 300px;
  }

  .hero-content h2 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .container h2 {
    font-size: 1.6rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.9rem;
  }

  .submit-button {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

/* Acrescentos funcionais sem alterar a identidade visual original */
.navbar-menu .nav-badge {
  background: var(--primary-color);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
}
.auth-box {
  max-width: 520px;
  margin: 40px auto;
}
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}
.error-message,
.alert-error {
  color: #c0392b;
  font-size: 0.92rem;
}
.alert-success {
  color: #217a3b;
}
.alert-box {
  padding: 12px 15px;
  border-radius: 8px;
  background: #fff3ef;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
}
.submit-button,
.btn,
button.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}
.submit-button:hover,
.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}
.btn-secondary {
  background: #555;
}
.btn-danger {
  background: #c0392b;
}
.btn-small {
  padding: 7px 12px;
  font-size: 0.9rem;
}
.inline-form {
  display: inline;
}
.products-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 15px 15px;
}
.filter-select {
  max-width: 280px;
}
.price-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
  text-align: left;
}
.price-box {
  background: #fffaf0;
  border: 1px solid #ffe1d7;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.9rem;
}
.price-box strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 6px;
}
.price-box ul {
  padding-left: 18px;
}
.product-actions select,
.product-actions input {
  width: 100%;
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 7px;
}
.product-actions .hint {
  color: #7f8c8d;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.cart-table,
.admin-table,
.orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.cart-table th,
.cart-table td,
.admin-table th,
.admin-table td,
.orders-table th,
.orders-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
}
.cart-table th,
.admin-table th,
.orders-table th {
  color: var(--primary-color);
}
.cart-thumb {
  width: 70px;
  height: 55px;
  object-fit: cover;
  border-radius: 8px;
}
.total-box {
  text-align: right;
  font-size: 1.3rem;
  color: var(--primary-color);
  font-weight: bold;
  margin-top: 20px;
}
.password-row {
  position: relative;
}
.password-row input {
  padding-right: 110px;
}
.show-pass {
  position: absolute;
  right: 7px;
  top: 31px;
  border: 0;
  background: #eee;
  color: #333;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  max-width: 1300px;
  margin: 40px auto;
}
.admin-sidebar,
.admin-content {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 20px;
}
.admin-sidebar h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}
.admin-sidebar a {
  display: block;
  color: var(--text-color);
  text-decoration: none;
  padding: 9px 0;
  border-bottom: 1px solid #f2f2f2;
}
.admin-sidebar a:hover {
  color: var(--primary-color);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 25px;
}
.stat-card {
  background: #fffaf0;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--card-shadow);
}
.stat-card strong {
  display: block;
  color: var(--primary-color);
  font-size: 2rem;
}
.status-pill {
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--secondary-color);
  color: var(--light-text);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}
.status-aguarda     { background: var(--secondary-color); color: #7a3b12; }
.status-pendente    { background: #ffb020; color: #5c3a00; }
.status-preparacao  { background: var(--primary-color); color: var(--light-text); }
.status-concluida   { background: #2f9e5c; color: var(--light-text); }
.status-cancelada   { background: #8a8f98; color: var(--light-text); }
.status-naopaga     { background: #6b7280; color: var(--light-text); }
.status-reembolsado { background: #b25bd6; color: var(--light-text); }

.btn-cancel {
  padding: 6px 14px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-cancel:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.order-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-actions-row .btn,
.order-actions-row .btn-cancel {
  margin: 0;
  white-space: nowrap;
}
.admin-table .order-actions-row select {
  padding: 9px 30px 9px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text-color);
  height: 38px;
  min-width: 170px;
  flex: 0 1 auto;
  box-sizing: border-box;
}
.order-actions-row .btn {
  height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-table .btn,
.order-actions .btn {
  text-align: center !important;
  justify-content: center !important;
}
.admin-table td {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}
.admin-table th:last-child,
.admin-table td:last-child {
  min-width: 190px;
}
/* ── Lista de categorias em cartões (substitui a tabela antiga) ── */
.admin-table-wrap {
  overflow-x: auto;
}

/* ── Tabelas de admin em cartões no telemóvel ─────────────────── */
@media (max-width: 700px) {
  .admin-table-wrap {
    overflow-x: visible;
  }
  .admin-table thead {
    display: none;
  }
  .admin-table,
  .admin-table tbody {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    display: block;
    background: #fff;
    border: 1px solid #f0e4d8;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 6px 14px;
    box-shadow: var(--card-shadow);
  }
  .admin-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5ece2;
    text-align: right;
  }
  .admin-table td:last-child {
    display: block;
    border-bottom: none;
    text-align: left;
    padding-top: 12px;
  }
  .admin-table td:last-child::before {
    display: block;
    margin-bottom: 8px;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.82rem;
    text-align: left;
    white-space: nowrap;
    padding-top: 2px;
  }
  .admin-table td .order-actions {
    width: 100%;
    align-items: stretch;
  }
  .admin-table td .order-actions-row {
    justify-content: flex-start;
  }
}
.category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}
.category-card {
  border: 1px solid #f0e4d8;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--card-shadow);
}
.category-card .category-edit-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.category-card .category-edit-form input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 42px !important;
  min-height: 0 !important;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
  box-sizing: border-box;
}
.category-card .category-edit-form .btn {
  flex: 0 0 auto;
  height: 42px;
  display: inline-flex;
  align-items: center;
}
.category-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f5ece2;
}
.category-product-count {
  color: #777;
  font-size: 0.9rem;
}
@media (max-width: 480px) {
  .category-card .category-edit-form {
    flex-wrap: wrap;
  }
  .category-card .category-edit-form input {
    flex: 1 1 100%;
  }
  .category-card .category-edit-form .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ── Grupo de preço (descrição + quantidade + preço) ──────────── */
.price-option-group label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: block;
}
.price-option-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
}
.price-option-row input {
  width: 100%;
  box-sizing: border-box;
}

/* ── Checkbox estilizada com a cor do site ─────────────────────── */
.form-group input.styled-checkbox,
input.styled-checkbox {
  width: 20px !important;
  height: 20px !important;
  min-height: 0 !important;
  max-width: 20px !important;
  flex: 0 0 20px;
  accent-color: var(--primary-color);
  vertical-align: middle;
  margin-right: 6px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .price-option-row {
    grid-template-columns: 1fr 1fr;
  }
  .price-option-row input:first-child {
    grid-column: 1 / -1;
  }
}
.text-muted { color: #aaa; font-size: 0.9rem; }
.price-list-imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.price-list-imgs img {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.user-chip {
  color: var(--primary-color);
  font-weight: bold;
}
@media (max-width: 768px) {
  .price-blocks {
    grid-template-columns: 1fr;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td,
  .cart-table th {
    display: block;
  }
  .cart-table thead {
    display: none;
  }
  .cart-table td {
    border-bottom: 0;
  }
  .cart-table tr {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
  }
}

/* Ajuste proporcional das imagens dos produtos em mobile */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-img {
    height: 180px;
  }
}

/* Opção de salgados mistos e ajustes de legibilidade sem alterar o layout original */
.mixed-choice {
  background: #fffaf0;
  border: 1px solid #ffe1d7;
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0 12px;
  text-align: left;
  overflow-wrap: anywhere;
}
.mixed-choice strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 5px;
}
.mixed-choice p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.mixed-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mixed-links .btn {
  flex: 1 1 130px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}
.form-hint {
  display: block;
  color: #666;
  line-height: 1.4;
  margin-bottom: 6px;
}
.product-info,
.price-box,
.product-actions,
.mixed-choice,
.cart-table {
  overflow-wrap: anywhere;
}
.product-actions select,
.product-actions input,
.product-actions button,
.form-group input,
.form-group textarea,
.form-group select {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .products-toolbar {
    align-items: stretch;
  }
  .products-toolbar .filter-select,
  .products-toolbar select,
  .products-toolbar span {
    width: 100%;
  }
  .product-actions {
    width: 100%;
  }
  .product-actions .add-to-cart-btn,
  .submit-button,
  .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .products-grid[style] {
    grid-template-columns: 1fr !important;
  }
  .products-grid > .product-img[style],
  .product-img[style] {
    height: auto !important;
    max-height: 280px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .price-box,
  .mixed-choice {
    font-size: 0.88rem;
  }
  .mixed-links {
    flex-direction: column;
  }
  .mixed-links .btn {
    flex-basis: auto;
    width: 100%;
  }
  .cart-thumb {
    width: 60px;
    height: 48px;
  }
}

/* Ajuste da barra inferior em todas as páginas — mantém o layout original */
html {
  min-height: 100%;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
footer {
  margin-top: auto;
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -20px;
  flex-shrink: 0;
}

footer {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

footer p {
  margin: 0;
  padding: 0 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  footer {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    padding: 12px 8px;
  }
  footer p {
    font-size: 0.92rem;
    line-height: 1.35;
  }
}


/* Melhorias pontuais pedidas — preserva o layout original */
.products-filter-toolbar {
  align-items: stretch;
  gap: 14px;
}
.filter-card {
  flex: 1 1 520px;
  background: #fffaf0;
  border: 1px solid #ffe1d7;
  border-radius: 14px;
  padding: 12px;
}
.filter-title {
  display: block;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 8px;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ffd5ca;
  background: #fff;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  transition: all 0.25s ease;
}
.filter-pill:hover,
.filter-pill.active {
  background: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}
.filter-note {
  flex: 1 1 260px;
  align-self: center;
  color: #666;
  line-height: 1.4;
}

.password-row {
  position: static;
}
.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-field input {
  width: 100%;
  padding-right: 98px;
}
.password-field .show-pass {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-width: 82px;
  height: calc(100% - 12px);
  border: 0;
  background: #fff3ef;
  color: var(--primary-color);
  padding: 0 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  line-height: 1;
}
.password-field .show-pass:hover {
  background: var(--primary-color);
  color: var(--light-text);
}

.admin-form-card,
.current-image-box {
  background: #fffaf0;
  border: 1px solid #ffe1d7;
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0 20px;
}
.category-inline-form,
.category-edit-form,
.current-image-box {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.category-name-field {
  flex: 1 1 260px;
  margin-bottom: 0;
}
.category-edit-form input {
  min-width: 220px;
  flex: 1 1 220px;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 7px;
}
.admin-product-preview {
  width: 120px;
  height: 90px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-top: 6px;
}
.current-image-box > div {
  flex: 1 1 220px;
}
.current-image-box button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.admin-content {
  overflow-x: auto;
}

@media (max-width: 768px) {
  .filter-card,
  .filter-note {
    flex-basis: 100%;
    width: 100%;
  }
  .filter-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-pill {
    width: 100%;
    text-align: center;
    white-space: normal;
  }
  .category-inline-form,
  .category-edit-form,
  .current-image-box {
    align-items: stretch;
  }
  .category-edit-form input,
  .category-edit-form .btn,
  .category-inline-form .submit-button,
  .current-image-box .btn {
    width: 100%;
  }
  .admin-table.category-table,
  .admin-table.category-table tbody,
  .admin-table.category-table tr,
  .admin-table.category-table td,
  .admin-table.category-table th {
    display: block;
    width: 100%;
  }
  .admin-table.category-table thead {
    display: none;
  }
  .admin-table.category-table tr {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
  }
  .admin-table.category-table td {
    border-bottom: 0;
  }
}

@media (max-width: 480px) {
  .filter-pills {
    grid-template-columns: 1fr;
  }
  .password-field input {
    padding-right: 88px;
  }
  .password-field .show-pass {
    min-width: 74px;
    font-size: 0.8rem;
  }
}

/* Ajuste proporcional de formulários — sem alterar o layout original */
form,
.form-group,
.contact-form,
.product-actions,
.admin-form-card,
.current-image-box,
.category-inline-form,
.category-edit-form {
  max-width: 100%;
  min-width: 0;
}

/* Secção de Contactos — mesma largura e estilo dos outros containers da página */
.contact-section {
  max-width: 800px !important;
  margin: 40px auto !important;
  padding: 20px calc(20px + 3rem);
}

.contact-section .contact-form,
.contact-card .contact-form {
  max-width: 100%;
  width: 100%;
}

.contact-section input,
.contact-section textarea,
.contact-card input,
.contact-card textarea {
  width: 100%;
  box-sizing: border-box;
}

.contact-section textarea,
.contact-card textarea {
  min-height: 160px;
  resize: vertical;
}

/* Campos sempre legíveis e proporcionais */
.form-group {
  width: 100%;
  margin-bottom: clamp(12px, 2vw, 18px);
}

.form-group label {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.form-group input,
.form-group textarea,
.form-group select,
.product-actions input,
.product-actions select,
.admin-table input,
.admin-table select,
.category-edit-form input {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  font-size: clamp(0.92rem, 1.4vw, 1rem);
  line-height: 1.35;
}

.form-group textarea {
  min-height: clamp(110px, 18vh, 180px);
}

.submit-button,
.btn,
button.btn,
.add-to-cart-btn {
  min-height: 42px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

/* Páginas administrativas: formulários acompanham a largura disponível */
.admin-layout {
  width: min(100%, 1300px);
  margin-top: clamp(24px, 5vh, 40px);
  margin-bottom: clamp(40px, 7vh, 80px);
}

.admin-content,
.admin-sidebar {
  min-width: 0;
}

.admin-content > .contact-form {
  width: min(100%, 760px);
  margin-left: 0;
  margin-right: auto;
}

.admin-form-card,
.current-image-box {
  width: 100%;
  padding: clamp(12px, 2vw, 18px);
}

.category-inline-form,
.category-edit-form,
.current-image-box {
  gap: clamp(10px, 2vw, 14px);
}

/* Formulários dentro de tabelas ficam flexíveis em ecrãs menores */
.admin-table form:not(.inline-form),
.orders-table form:not(.inline-form),
.cart-table form:not(.inline-form) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.admin-table form select,
.orders-table form select,
.cart-table form input {
  flex: 1 1 130px;
  min-width: 120px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  vertical-align: middle;
}

/* Produto/carrinho/checkout: mantém o formulário dentro do card */
.product-actions {
  width: 100%;
}

.product-actions select,
.product-actions input,
.product-actions button {
  width: 100%;
}

/* Botão de ver/ocultar continua alinhado e responsivo */
.password-field {
  min-width: 0;
}

.password-field input {
  min-width: 0;
}

.password-field .show-pass {
  white-space: nowrap;
}

/* Mobile: tudo ocupa a largura disponível sem cortar texto */
@media (max-width: 768px) {
  body {
    padding: clamp(10px, 4vw, 20px);
  }

  .container,
  .container.auth-box,
  .admin-content,
  .admin-sidebar {
    width: 100%;
    padding: clamp(14px, 4vw, 22px);
    margin-left: auto;
    margin-right: auto;
  }

  .container.auth-box {
    margin-top: clamp(18px, 4vh, 42px);
    margin-bottom: clamp(30px, 6vh, 70px);
  }

  .contact-form,
  .admin-content > .contact-form {
    width: 100%;
  }

  .submit-button,
  .contact-form .submit-button,
  .admin-content > .contact-form .submit-button {
    width: 100%;
    align-self: stretch;
  }

  .admin-table form:not(.inline-form),
  .orders-table form:not(.inline-form),
  .cart-table form:not(.inline-form),
  .inline-form {
    width: 100%;
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-table form select,
  .orders-table form select,
  .cart-table form input,
  .inline-form select,
  .inline-form button,
  .inline-form .btn {
    width: 100%;
    min-width: 0;
  }

  .password-field input {
    padding-right: 92px;
  }
}

@media (max-width: 420px) {
  .container.auth-box {
    width: 100%;
    padding: 14px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select,
  .product-actions input,
  .product-actions select {
    font-size: 0.92rem;
  }

  .password-field input {
    padding-right: 82px;
  }

  .password-field .show-pass {
    min-width: 68px;
    padding: 0 8px;
    font-size: 0.76rem;
  }
}

/* ── Páginas legais (Privacidade, Termos, Cookies) ───────────────────────── */
.legal-page {
  max-width: 780px;
  line-height: 1.7;
}
.legal-page .legal-updated {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 24px;
}
.legal-page h2 {
  color: var(--primary-color);
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.2rem;
}
.legal-page h2:first-of-type {
  margin-top: 0;
}
.legal-page p,
.legal-page ul {
  color: #444;
  margin-bottom: 12px;
}
.legal-page ul {
  padding-left: 22px;
}
.legal-page a {
  color: var(--primary-color);
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 0.92rem;
}
.legal-table th,
.legal-table td {
  border: 1px solid #eee0d8;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: #fff5f2;
  color: #7b3f00;
}
.legal-links {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #f0e4dc;
  font-size: 0.92rem;
}

/* ── Rodapé: links legais ─────────────────────────────────────────────────── */
.footer-legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.footer-legal-links a {
  color: inherit;
  opacity: 0.85;
  text-decoration: none;
}
.footer-legal-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Banner de cookies ───────────────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: #fff;
  border-top: 1px solid #e8d5c0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: 16px 20px;
  display: none;
}
#cookie-banner.show {
  display: block;
}
#cookie-banner .cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
#cookie-banner p {
  flex: 1 1 320px;
  margin: 0;
  color: #444;
  font-size: 0.9rem;
}
#cookie-banner p a {
  color: var(--primary-color);
}
#cookie-banner .cookie-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
#cookie-banner button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 600px) {
  #cookie-banner .cookie-inner { flex-direction: column; align-items: stretch; text-align: center; }
  #cookie-banner .cookie-actions { justify-content: center; }
}

/* ── Checkbox de aceitação de Termos/Privacidade (registo e checkout) ──────── */
.checkbox-group {
  background: #fffaf5;
  border: 1px solid #e8d5c0;
  border-radius: 8px;
  padding: 14px 16px;
}
.checkbox-group .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #444;
  cursor: pointer;
  font-weight: normal;
}
.checkbox-group .checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--primary-color);
  cursor: pointer;
}
.checkbox-label a {
  color: var(--primary-color);
}

/* ── Responsividade: páginas legais, rodapé, banner de cookies e checkbox ─── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tablet */
@media (max-width: 900px) {
  .legal-page {
    max-width: 100%;
  }
  .legal-page h2 {
    font-size: 1.1rem;
  }
  .legal-table {
    font-size: 0.86rem;
  }
  .footer-legal-links {
    gap: 14px;
  }
  #cookie-banner .cookie-inner {
    gap: 14px;
  }
}

/* Telemóvel */
@media (max-width: 600px) {
  .legal-page {
    line-height: 1.6;
  }
  .legal-page .legal-updated {
    margin-bottom: 18px;
  }
  .legal-page h2 {
    font-size: 1.05rem;
    margin-top: 22px;
  }
  .legal-page p,
  .legal-page ul {
    font-size: 0.93rem;
  }
  .legal-table {
    font-size: 0.82rem;
    min-width: 480px; /* mantém as colunas legíveis; a tabela desliza horizontalmente */
  }
  .legal-table th,
  .legal-table td {
    padding: 8px 10px;
  }
  .legal-links {
    font-size: 0.88rem;
  }

  .footer-legal-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  #cookie-banner {
    padding: 14px 16px;
  }
  #cookie-banner p {
    font-size: 0.85rem;
    text-align: center;
  }
  #cookie-banner .cookie-actions button {
    width: 100%;
  }

  .checkbox-group {
    padding: 12px 14px;
  }
  .checkbox-label {
    align-items: flex-start;
    font-size: 0.86rem;
    gap: 8px;
  }
  .checkbox-label input[type="checkbox"] {
    margin-top: 2px;
  }
}

/* Telemóveis muito pequenos */
@media (max-width: 380px) {
  .legal-page h2 {
    font-size: 1rem;
  }
  .checkbox-label {
    font-size: 0.82rem;
  }
}