:root {
  --bg-dark: #0d080a;
  --bg-card: #170e12;
  --bg-card-hover: #211319;
  --bg-surface: #1f1318;
  --wine-primary: #8b1e2f;
  --wine-light: #b8293f;
  --gold: #d4af37;
  --gold-light: #f1d37a;
  --gold-muted: #9e8236;
  --text-main: #f7f2eb;
  --text-muted: #b8a99a;
  --border-subtle: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.42);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* Top announcement bar */
.top-bar {
  background: linear-gradient(90deg, #4b0f19, #751828, #4b0f19);
  color: #f9ebd2;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar strong {
  color: var(--gold-light);
}

/* Header / Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 8, 10, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

.brand-text h1 {
  font-size: 1.35rem;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-gold {
  background: linear-gradient(135deg, #e0bd52 0%, #b88c28 100%);
  color: #160d08;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  filter: brightness(1.06);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-light);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.12);
}

.btn-wine {
  background: linear-gradient(135deg, var(--wine-light), var(--wine-primary));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-wine:hover {
  filter: brightness(1.12);
}

.cart-btn {
  position: relative;
}

.cart-badge {
  background: var(--wine-light);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 24px;
  background: radial-gradient(circle at 75% 35%, rgba(139, 30, 47, 0.35), rgba(13, 8, 10, 0.98) 70%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-container {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.15;
  margin-bottom: 16px;
  color: #fff;
}

.hero h2 span {
  color: var(--gold-light);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 26px;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.hero-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #e6dacb;
}

.hero-image-card {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-card img {
  width: 100%;
  max-width: 340px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(139, 30, 47, 0.45);
}

/* Catalog Controls & Filters */
.section-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 24px;
}

.catalog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  padding: 9px 16px;
  border-radius: 99px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--wine-primary);
  color: #fff;
  border-color: var(--gold);
}

.search-box {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 99px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--gold);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.badge-tag {
  padding: 4px 9px !important;
  border-radius: 6px;
  font-size: 0.64rem !important;
  line-height: 1 !important;
  height: 23px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
}

.badge-gold,
.badge-offer {
  background: rgba(212, 175, 55, 0.92);
  color: #160c08;
}

.badge-ready {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-order {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.product-img-wrap {
  height: 265px;
  background: radial-gradient(circle, #2a1319 0%, #10090b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.product-img-wrap img {
  max-height: 185px;
  max-width: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-meta {
  font-size: 0.76rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: #fff;
}

.product-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-pricing {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.old-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.current-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold-light);
}

.pix-price-hint {
  font-size: 0.78rem;
  color: #4ade80;
  margin-bottom: 12px;
}

/* Custom Order ("Sob Encomenda") Banner */
.encomenda-banner {
  background: linear-gradient(135deg, #251118 0%, #140b0e 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin: 40px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.encomenda-form {
  background: rgba(0, 0, 0, 0.35);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: #dfd3c3;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: #10090c;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

/* Modals / Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

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

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

/* Cart Items inside Checkout */
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0d080a;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 8px;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
}

/* Payment Selector Tabs */
.payment-methods-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.pay-tab {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-subtle);
  background: #10090c;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.pay-tab.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
}

.pay-tab strong {
  display: block;
  font-size: 1rem;
  color: var(--gold-light);
}

.pay-tab span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Pix QR Code Display */
.pix-result-box {
  text-align: center;
  padding: 24px;
  background: #110a0d;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.qr-canvas-wrap {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 16px 0;
}

.pix-copy-textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
  background: #080506;
  color: #4ade80;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  resize: none;
  margin-bottom: 12px;
}

/* Admin Panel Layout */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #120a0d;
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav-btn:hover,
.admin-nav-btn.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border-color: var(--border-subtle);
}

.admin-main {
  padding: 32px;
  overflow-y: auto;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-card span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-card strong {
  display: block;
  font-size: 1.75rem;
  color: var(--gold-light);
  margin-top: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.admin-table th,
.admin-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.88rem;
}

.admin-table th {
  background: #1f1217;
  color: var(--gold-light);
  font-weight: 600;
}

/* Floating WhatsApp Button */
.whatsapp-float {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 18px;
  background: #25d366;
  color: #fff;
  padding: 12px 18px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* Footer */
footer {
  background: #080506;
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Otimização Mobile Completa para iOS (iPhone/iPad) e Android */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

.navbar {
  -webkit-backdrop-filter: blur(14px);
}

.modal-backdrop {
  -webkit-backdrop-filter: blur(5px);
  -webkit-overflow-scrolling: touch;
}

.modal-box {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 860px) {
  .hero-container,
  .encomenda-banner,
  .form-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px;
  }

  .admin-main {
    padding: 18px 14px;
    overflow-x: auto;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand {
    justify-content: center;
    text-align: left;
  }

  .nav-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-actions .btn {
    flex: 1 1 auto;
    font-size: 0.82rem;
    padding: 10px 12px;
    min-height: 44px;
  }

  .hero {
    padding: 34px 16px;
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-highlights {
    justify-content: center;
  }

  .hero-image-card img {
    max-width: 240px;
  }

  .section-container {
    padding: 28px 16px;
  }

  .catalog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .encomenda-banner {
    padding: 22px 16px;
    gap: 22px;
  }

  .encomenda-form {
    padding: 18px 14px;
  }

  /* Evita o auto-zoom forçado do Safari no iPhone (iOS exige >= 16px em inputs) */
  input,
  select,
  textarea,
  .form-control,
  .search-box input {
    font-size: 16px !important;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-box {
    max-height: 92dvh;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 12px 12px;
  }

  .payment-methods-tabs {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .cart-item-row {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .top-bar {
    font-size: 0.76rem;
    padding: 7px 10px;
  }

  .brand-text h1 {
    font-size: 1.18rem;
  }

  .brand-text span {
    font-size: 0.7rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-float {
    padding: 10px 14px;
    font-size: 0.82rem;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

