/* Açougue Silveira - Mobile First */
:root {
  --orange: #e85d04;
  --orange-dark: #d44d03;
  --green: #2d5a27;
  --green-dark: #1e3d1a;
  --green-light: #3d7a35;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-500: #6b7280;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--green);
  color: var(--white);
  line-height: 1.4;
  min-height: 100dvh;
  padding-top: calc(126px + var(--safe-top));
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--green-dark);
  color: var(--white);
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-tabs {
  max-width: 600px;
  margin: 12px auto 0;
  padding: 4px;
  background: rgba(0, 0, 0, .22);
  border-radius: 14px;
  display: flex;
  gap: 4px;
}

.category-tab {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .9);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s, transform .12s;
}

.category-tab.is-active {
  background: var(--orange);
  color: var(--white);
}

.category-tab:active {
  transform: scale(0.98);
}

.logo {
  height: 52px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-toggle,
.cart-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  color: var(--white);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.search-toggle {
  background: rgba(255,255,255,.16);
}

.cart-toggle {
  background: var(--orange);
}

.search-toggle:active,
.cart-toggle:active {
  transform: scale(0.96);
}

.search-panel {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 15px 0;
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-panel-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-panel input {
  width: 100%;
  height: 36px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 9px;
  background: rgba(30,61,26,.95);
  color: var(--white);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
}

.search-panel input::placeholder {
  color: rgba(255,255,255,.55);
}

.search-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9px;
  background: rgba(255,255,255,.16);
  color: var(--white);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  background: var(--white);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main - todas as seções visíveis */
.main {
  max-width: 600px;
  margin: 0 auto;
  padding: 22px 16px 24px;
}

.home-banner {
  width: 100%;
  margin: 0 0 12px;
}

.home-banner__media {
  width: 100%;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}

.home-banner__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.home-banner__controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.home-banner__controls[hidden] {
  display: none;
}

.home-banner__nav {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.home-banner__nav:disabled {
  opacity: .45;
  cursor: default;
}

.home-banner__dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255,255,255,.35);
  cursor: pointer;
}

.home-banner__dot.is-active {
  background: var(--orange);
}

.product-section {
  margin-bottom: 28px;
}

.product-section[hidden] {
  display: none;
}

.product-section:first-child {
  margin-top: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(0,0,0,.2);
  border-radius: 12px;
  border-left: 4px solid var(--orange);
}

/* Product list */
.product-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card {
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.1);
}

.product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.product-card-top .product-name {
  flex: 1;
  min-width: 0;
  width: auto;
}

.product-img-wrap {
  flex-shrink: 0;
}

.product-body {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.product-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  width: 100%;
}

.product-meta {
  flex: 1;
  min-width: 0;
}

.product-desc {
  font-size: 11px;
  line-height: 1.25;
  color: rgba(255,255,255,.75);
  margin-bottom: 3px;
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  margin-top: 2px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--orange);
  color: var(--white);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .1s;
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.product-cut-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
  max-width: min(160px, 48%);
}

.product-cut-label {
  font-size: 11px;
  color: rgba(255,255,255,.75);
}

.product-cut-select {
  width: 100%;
  min-width: 0;
  max-width: 160px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  color: #111;
  font-family: inherit;
}

.product-cut-select option {
  background: #fff;
  color: #111;
}

.product-cut-select:focus {
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 1px;
}

.product-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-btn {
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 10px;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 12px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}

/* Drawer - Carrinho */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
  transition: visibility .25s;
}

.drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s;
}

.drawer.is-open .drawer-backdrop {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--green-dark);
  box-shadow: -4px 0 24px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}

.drawer.is-open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.drawer-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear-cart {
  border: none;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-clear-cart:active {
  background: var(--orange-dark);
}

.drawer-close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
}

.drawer-close:active {
  background: rgba(255,255,255,.1);
}

.cart-list {
  list-style: none;
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-areas:
    "title title title"
    "image price controls";
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.cart-item-img-wrap {
  grid-area: image;
}

.cart-item-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
}

.cart-item-name {
  font-weight: 600;
  display: block;
  min-width: 0;
}

.cart-item-cut {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}

.cart-item-qty-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 3px 6px;
  white-space: nowrap;
}

.cart-item-qty-input {
  width: 28px;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 2px 0;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cart-item-qty-input::-webkit-outer-spin-button,
.cart-item-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item-qty-input:focus {
  outline: none;
}

.cart-item-qty-unit {
  min-width: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.cart-item-price {
  grid-area: price;
  font-weight: 700;
  color: var(--orange);
}

.cart-item-main {
  grid-area: title;
  min-width: 0;
}

.cart-item-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  position: relative;
  overflow: visible;
}

.cart-item-weight-wheel-wrap {
  position: relative;
  min-width: 92px;
  width: 92px;
  margin: -10px 0;
  z-index: 2;
}

.cart-item-weight-wheel-wrap::before,
.cart-item-weight-wheel-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
  z-index: 3;
}

.cart-item-weight-wheel-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, var(--green-dark), rgba(30, 61, 26, 0));
}

.cart-item-weight-wheel-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, var(--green-dark), rgba(30, 61, 26, 0));
}

.cart-item-weight-wheel {
  width: 92px;
  height: 98px;
  background: transparent;
  color: rgba(255,255,255,.9);
  border: none;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  text-align: center;
  padding: 0;
  touch-action: pan-y;
  scroll-behavior: smooth;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: none;
  position: relative;
  z-index: 2;
  scrollbar-width: none;
}

.cart-item-weight-wheel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.cart-item-weight-option {
  display: block;
  padding: 6px 2px;
  min-height: 32px;
  line-height: 20px;
  background: transparent;
  color: rgba(255,255,255,.75);
  text-align: center;
  scroll-snap-align: none;
  user-select: none;
  -webkit-user-select: none;
}

.cart-item-weight-option.is-selected {
  color: var(--orange);
  font-weight: 700;
}

.cart-item-weight-wheel:focus {
  outline: none;
  box-shadow: none;
}

.cart-item-action {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cart-item-action:active {
  transform: translateY(1px);
}

.cart-item-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.cart-item-remove {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.drawer-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.drawer-footer .field {
  margin-bottom: 12px;
}

.field-help {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,.92);
  margin-bottom: 6px;
}

.cart-total {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-secondary {
  background: rgba(255,255,255,.2);
  color: var(--white);
}

/* Modal checkout */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  transition: visibility .25s;
}

.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s;
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 100%;
  max-height: 90vh;
  background: var(--green-dark);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s ease;
}

.modal.is-open .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
}

.modal-body {
  padding: 20px 16px;
  overflow: auto;
  flex: 1;
}

.label {
  font-size: 14px;
  color: rgba(255,255,255,.9);
  margin-bottom: 10px;
}

.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-option {
  flex: 1;
  min-width: 100px;
  padding: 14px;
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
}

.payment-option:has(input:checked) {
  border-color: var(--orange);
  background: rgba(232,93,4,.15);
}

.payment-option input {
  margin-right: 6px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: rgba(255,255,255,.9);
}

.field input {
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: 16px;
  font-family: inherit;
}

.field input::placeholder {
  color: rgba(255,255,255,.4);
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: #ef4444;
  font-weight: 600;
}

.resumo-pedido {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0,0,0,.2);
  border-radius: 12px;
  font-size: 14px;
  color: rgba(255,255,255,.9);
  white-space: pre-line;
}

.modal-footer {
  padding: 16px;
  display: flex;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.modal-footer .btn {
  flex: 1;
}

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  right: 20px;
  z-index: 90;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.5);
  transition: transform .2s;
}

.whatsapp-float:active {
  transform: scale(0.95);
}

/* Empty state */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,.7);
}

.empty-cart p {
  margin-bottom: 8px;
}

/* Performance: reduce motion if preferred */
@media (prefers-reduced-motion: reduce) {
  .drawer-content,
  .modal-content,
  .drawer-backdrop,
  .modal-backdrop {
    transition: none;
  }
}
