/* index.css - Design System & Styling for Ponto do Sabor Digital Menu */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Tokens */
  --bg-primary: #120f0d;
  --bg-secondary: #1a1512;
  --card-bg: rgba(38, 30, 27, 0.75);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-active: #d4a373;
  
  --primary: #d4a373;
  --primary-rgb: 212, 163, 115;
  --accent: #e65f2b;
  --accent-rgb: 230, 95, 43;
  
  --text-main: #f5f2eb;
  --text-muted: #a8a096;
  --text-inverse: #120f0d;
  
  --success: #48bb78;
  --success-bg: rgba(72, 187, 120, 0.1);
  --danger: #f56565;
  
  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(230, 95, 43, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(212, 163, 115, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 120px; /* Space for floating checkout bar */
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* App Container */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, rgba(18, 15, 13, 0.95), rgba(18, 15, 13, 0));
}

.logo-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
  border-radius: var(--radius-full);
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 24px rgba(230, 95, 43, 0.25);
  animation: logoPulse 4s infinite ease-in-out;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
  background-color: #fff;
}

.restaurant-title {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.restaurant-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hero Section */
.hero-card {
  position: relative;
  margin: 0 16px 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
}

.hero-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: var(--transition-smooth);
}

.hero-card:hover .hero-image {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(18, 15, 13, 0.95) 10%, rgba(18, 15, 13, 0.5) 60%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.product-badge {
  align-self: flex-start;
  background-color: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(230, 95, 43, 0.35);
}

.product-title {
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Content Sections */
.section-container {
  padding: 0 16px;
  margin-bottom: 24px;
}

.section-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Group Headers */
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.group-title {
  font-size: 1.1rem;
  color: #fff;
}

.group-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: rgba(212, 163, 115, 0.1);
  color: var(--primary);
}

.group-badge.required {
  background-color: rgba(230, 95, 43, 0.1);
  color: var(--accent);
}

/* Options Grid / List */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.option-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 163, 115, 0.3);
}

.option-item.active {
  background: rgba(212, 163, 115, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(212, 163, 115, 0.15);
}

/* Radio & Checkbox Styling */
.selector-control {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--text-muted);
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.option-item.active .selector-control {
  border-color: var(--primary);
  background-color: var(--primary);
}

.selector-control::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--text-inverse);
  transform: scale(0);
  transition: var(--transition-fast);
}

.option-item.active .selector-control::after {
  transform: scale(1);
}

/* Checkbox Style */
.checkbox-item .selector-control {
  border-radius: 4px;
}
.checkbox-item.active .selector-control::after {
  content: '✓';
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  transform: scale(1);
}

.option-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.option-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
}

.option-description {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.option-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  margin-left: 12px;
}

/* Input Fields & Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(212, 163, 115, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

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

/* Payment Section specific details */
.payment-details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--card-border);
  display: none;
  animation: slideDown 0.3s ease-out forwards;
}

.pix-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.pix-key-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pix-key {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  user-select: all;
  word-break: break-all;
  margin-bottom: 8px;
}

.copy-btn {
  background: rgba(212, 163, 115, 0.1);
  border: 1px solid rgba(212, 163, 115, 0.3);
  color: var(--primary);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: rgba(212, 163, 115, 0.2);
}

/* Floating Checkout Bar */
.checkout-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(18, 15, 13, 0.98) 80%, rgba(18, 15, 13, 0.8));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  padding: 16px 20px 24px;
  z-index: 100;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.checkout-bar-content {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.total-wrapper {
  display: flex;
  flex-direction: column;
}

.total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.submit-btn {
  flex-grow: 1;
  background: linear-gradient(135deg, var(--accent), #ff7e47);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(230, 95, 43, 0.35);
  transition: var(--transition-smooth);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 95, 43, 0.45);
}

.submit-btn:active {
  transform: translateY(1px);
}

/* Success Overlay */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.success-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.success-circle {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: var(--success-bg);
  border: 2px solid var(--success);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 24px;
  transform: scale(0.6);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.active .success-circle {
  transform: scale(1);
}

.success-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: #fff;
}

.success-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 30px;
}

.success-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.success-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes logoPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(230, 95, 43, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 12px 32px rgba(230, 95, 43, 0.35);
    transform: scale(1.02);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utilities */
.text-accent {
  color: var(--primary);
}

.divider {
  height: 1px;
  background-color: var(--card-border);
  margin: 16px 0;
}
