/* ============================================================
   GUIA COMERCIAL - Estilos Principais
   ============================================================ */

:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #212529;
    --light: #f8f9fa;
    --card-shadow: 0 2px 15px rgba(0,0,0,.08);
    --card-hover-shadow: 0 8px 30px rgba(0,0,0,.15);
    --border-radius: 12px;
    --transition: all .25s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* ============================================================
   HERO / BUSCA
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 60%, #003d82 100%);
    padding: 70px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
}

.search-box {
    background: white;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 150px;
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 40px;
}

.search-box select {
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: .9rem;
    border-radius: 40px;
    background: #f0f4ff;
    color: #333;
    min-width: 130px;
}

.search-box button {
    border-radius: 40px;
    padding: 10px 28px;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Card de empresa */
.business-card .card-img-top { height: 180px; }
.business-card .business-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    margin-top: -30px;
    margin-left: 15px;
    background: white;
}

.business-card .badge-verified {
    background: #198754;
    color: white;
    font-size: .7rem;
    padding: 3px 8px;
    border-radius: 20px;
}

.business-card .badge-open {
    background: #198754;
    color: white;
    font-size: .7rem;
    padding: 3px 8px;
    border-radius: 20px;
}

.business-card .badge-closed {
    background: #dc3545;
    color: white;
    font-size: .7rem;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Card de produto */
.product-card .card-img-top { height: 200px; }
.product-card .price-original {
    text-decoration: line-through;
    color: #999;
    font-size: .85rem;
}
.product-card .price-promo {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1rem;
}
.product-card .price-normal {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Card de oferta */
.offer-card {
    border-left: 4px solid #dc3545;
}
.offer-card .discount-badge {
    background: #dc3545;
    color: white;
    font-weight: 700;
    font-size: .9rem;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ============================================================
   CATEGORIAS
   ============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.category-item {
    text-align: center;
    padding: 20px 10px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    text-decoration: none;
    color: #333;
    cursor: pointer;
}

.category-item:hover {
    background: #0d6efd;
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.category-item i {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
    color: #0d6efd;
    transition: var(--transition);
}

.category-item:hover i { color: white; }

.category-item span {
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
}

/* ============================================================
   SEÇÕES
   ============================================================ */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0;
}

.section-subtitle {
    color: #6c757d;
    font-size: .9rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================================
   PÁGINA DA EMPRESA
   ============================================================ */
.business-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.business-logo-lg {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,.2);
    margin-top: -50px;
    background: white;
}

.business-info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child { border-bottom: none; }

.info-item i {
    width: 20px;
    color: #0d6efd;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--card-hover-shadow); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: #212529;
}

.stat-label {
    font-size: .85rem;
    color: #6c757d;
    margin-top: 4px;
}

/* ============================================================
   SIDEBAR ADMIN/EMPRESÁRIO
   ============================================================ */
.sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 0;
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.sidebar-header {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    color: white;
    padding: 20px;
    text-align: center;
}

.sidebar-header img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.3);
    margin-bottom: 10px;
}

.sidebar-nav .nav-link {
    color: #555;
    padding: 12px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: #f0f4ff;
    color: #0d6efd;
    border-left-color: #0d6efd;
}

.sidebar-nav .nav-link i { width: 20px; text-align: center; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 10px 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--transition);
}

.btn-primary { background: #0d6efd; border-color: #0d6efd; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; border-color: #1da851; color: white; }

/* ============================================================
   AVALIAÇÕES
   ============================================================ */
.review-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0d6efd;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stars i { font-size: .9rem; }

/* ============================================================
   MAPA
   ============================================================ */
#map { height: 300px; border-radius: var(--border-radius); }

/* ============================================================
   BADGES
   ============================================================ */
.badge-status-pendente { background: #ffc107; color: #000; }
.badge-status-ativo { background: #198754; color: #fff; }
.badge-status-inativo { background: #6c757d; color: #fff; }
.badge-status-bloqueado { background: #dc3545; color: #fff; }

/* ============================================================
   TABELAS ADMIN
   ============================================================ */
.table-admin {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-admin thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6c757d;
    padding: 14px 16px;
}

.table-admin tbody td { padding: 14px 16px; vertical-align: middle; }
.table-admin tbody tr:hover { background: #f8f9ff; }

/* ============================================================
   IMAGEM PLACEHOLDER
   ============================================================ */
.img-placeholder {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
}

/* ============================================================
   CARRINHO
   ============================================================ */
.cart-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-item img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 768px) {
    .hero-section { padding: 40px 0 50px; }
    .search-box { border-radius: 16px; }
    .search-box input, .search-box select { border-radius: 8px; }
    .category-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .category-item { padding: 14px 6px; }
    .category-item i { font-size: 1.4rem; }
    .business-cover { height: 180px; }
    .sidebar { position: static; margin-bottom: 20px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-section h1 { font-size: 1.5rem; }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-lift { transition: var(--transition); }
.hover-lift:hover { transform: translateY(-3px); }

.bg-gradient-primary { background: linear-gradient(135deg, #0d6efd, #0056b3); }
.bg-gradient-success { background: linear-gradient(135deg, #198754, #0f5132); }
.bg-gradient-warning { background: linear-gradient(135deg, #ffc107, #e0a800); }
.bg-gradient-danger  { background: linear-gradient(135deg, #dc3545, #b02a37); }
.bg-gradient-info    { background: linear-gradient(135deg, #0dcaf0, #0aa2c0); }
.bg-gradient-purple  { background: linear-gradient(135deg, #6f42c1, #59359a); }

.rounded-xl { border-radius: var(--border-radius) !important; }

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

/* Favorito */
.btn-favorite {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
}
.btn-favorite.active, .btn-favorite:hover { color: #dc3545; }

/* Status pedido */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}
.status-aguardando  { background: #fff3cd; color: #856404; }
.status-recebido    { background: #cfe2ff; color: #084298; }
.status-confirmado  { background: #d1ecf1; color: #0c5460; }
.status-preparando  { background: #fff3cd; color: #856404; }
.status-pronto      { background: #d4edda; color: #155724; }
.status-concluido   { background: #d4edda; color: #155724; }
.status-cancelado   { background: #f8d7da; color: #721c24; }
