/**
 * DELIVERY MODERN DESIGN SYSTEM (iFood & Uber Eats inspired)
 * Sistema WAFOOD 2026
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Cores Neutras & Superfícies */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  
  /* Textos */
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Cores de Ação & Status */
  --brand-primary: #ea1d2c;
  --brand-primary-hover: #d31624;
  --brand-primary-rgb: 234, 29, 44;
  --brand-success: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --brand-info: #0284c7;
  
  /* Bordas e Sombras */
  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-focus: rgba(234, 29, 44, 0.4);
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.16);
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Global e Tipografia */
body {
  font-family: var(--font-main) !important;
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Header & Banner da Loja Estilo App Delivery */
.delivery-header-hero {
  position: relative;
  background: #0f172a;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.delivery-header-cover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.45);
  transform: scale(1.05);
}

.delivery-header-content {
  position: relative;
  z-index: 2;
  padding: 24px 16px 20px 16px;
  max-width: 1140px;
  margin: 0 auto;
}

.delivery-store-logo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 3px solid #ffffff;
}

.delivery-store-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 6px;
}

.delivery-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.delivery-status-badge.status-open {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.delivery-status-badge.status-closed {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.delivery-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.delivery-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #ffffff !important;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none !important;
}

.delivery-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: #ffffff;
}

/* Categorias Horizontais Sticky (Pills Estilo iFood) */
.delivery-categories-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.delivery-categories-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px;
  max-width: 1140px;
  margin: 0 auto;
}

.delivery-categories-scroll::-webkit-scrollbar {
  display: none;
}

.delivery-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  flex-shrink: 0;
}

.delivery-cat-pill img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.delivery-cat-pill:hover,
.delivery-cat-pill.active {
  background: var(--text-main);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Grid e Cards de Produtos Estilo iFood */
.delivery-section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin: 28px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delivery-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--brand-primary);
  border-radius: var(--radius-xs);
}

.delivery-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 576px) {
  .delivery-products-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.delivery-product-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  text-decoration: none !important;
  box-shadow: var(--shadow-xs);
}

.delivery-product-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.delivery-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.delivery-product-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.35;
}

.delivery-product-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delivery-product-price {
  font-size: 16px;
  font-weight: 800;
  color: #16a34a;
  letter-spacing: -0.01em;
}

.delivery-product-image-box {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.delivery-product-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.delivery-product-card:hover .delivery-product-image-box img {
  transform: scale(1.06);
}

.delivery-product-add-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.delivery-product-card:hover .delivery-product-add-btn {
  transform: scale(1.1);
  background: var(--brand-primary-hover);
}

/* Barra Flutuante de Carrinho / Sacola Mobile (Bottom Sticky Bar) */
.delivery-floating-cart-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 540px;
  margin: 0 auto;
  z-index: 1050;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 12px 18px;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.delivery-floating-cart-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

.delivery-floating-cart-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delivery-floating-cart-badge {
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  min-width: 24px;
  text-align: center;
}

.delivery-floating-cart-total {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.delivery-floating-cart-btn {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modais Modernizados (Bottom Sheet no Mobile, Dialog no Desktop) */
.modal {
  z-index: 1060 !important;
}

.modal-dialog {
  margin: 1.75rem auto !important;
  max-width: 520px !important;
}

.modal-content {
  border-radius: var(--radius-lg) !important;
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--bg-surface) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 16px 20px !important;
  background: var(--bg-surface) !important;
  flex-shrink: 0 !important;
}

.modal-title {
  font-weight: 800 !important;
  font-size: 16.5px !important;
  color: var(--text-main) !important;
}

.modal-body {
  padding: 16px 20px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: calc(90vh - 70px) !important;
}

.modal-footer {
  border-top: 1px solid var(--border-subtle) !important;
  padding: 14px 20px !important;
  flex-shrink: 0 !important;
}

/* Mobile Bottom-Sheet (iFood Style) */
@media (max-width: 768px) {
  .modal-dialog {
    margin: auto 0 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  .modal-content {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    max-height: 90vh !important;
    margin-bottom: 0 !important;
  }

  .modal-body {
    max-height: calc(90vh - 65px) !important;
    padding-bottom: 30px !important;
  }

  .modal.fade .modal-dialog {
    transform: translateY(100%) !important;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  }

  .modal.show .modal-dialog {
    transform: translateY(0) !important;
  }
}

/* Formulários, Inputs e Botoes */
.form-control {
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border-default) !important;
  padding: 10px 14px !important;
  font-size: 14.5px !important;
  color: var(--text-main) !important;
  background-color: var(--bg-surface) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  transition: all var(--transition-fast) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #1e3c72 0%, #2563eb 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px) !important;
}

.btn-success:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
  transform: translateY(-1px) !important;
}

/* Select2 Dropdown Z-Index Fix & Elevation */
.select2-container {
  z-index: 1050 !important;
}

.select2-dropdown {
  z-index: 99999 !important;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--border-default) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
  background-color: var(--bg-surface) !important;
}

.select2-container--open {
  z-index: 99999 !important;
}

/* Ajuste de Z-Index da coluna fixa de resumo */
.card.sticky-top {
  z-index: 10 !important;
}

