/**
 * MixUp Food - Estilos
 * Cores: Vermelho #e63946 | Verde #2d6a4f
 */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #2d6a4f;
    --secondary-dark: #1b4332;
    --success: #40916c;
    --warning: #f4a261;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --white: #ffffff;
    --chat-bg: #e5ddd5;
    --msg-out: #dcf8c6;
    --msg-in: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* ==================== HEADER ==================== */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo {
    height: 40px;
}

.app-header .title {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.header-icons a,
.header-icons button {
    color: white;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* ==================== TABS NAVEGAÇÃO ==================== */
.nav-tabs-app {
    display: flex;
    background: var(--primary);
    border-bottom: 3px solid var(--primary-dark);
}

.nav-tabs-app a {
    flex: 1;
    text-align: center;
    padding: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s;
}

.nav-tabs-app a.active {
    color: white;
}

.nav-tabs-app a.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
}

/* ==================== LISTA DE CONVERSAS ==================== */
.chat-list {
    list-style: none;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: var(--light);
}

.chat-item .avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid var(--gray-light);
}

.chat-item .avatar.loja {
    border-color: var(--secondary);
}

.chat-item .info {
    flex: 1;
    min-width: 0;
}

.chat-item .name {
    font-weight: 600;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-item .name .badge-loja {
    background: var(--secondary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.chat-item .preview {
    color: var(--gray);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item .meta {
    text-align: right;
}

.chat-item .time {
    font-size: 0.75rem;
    color: var(--gray);
}

.chat-item .unread {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    margin-left: auto;
}

/* ==================== TELA DE CHAT ==================== */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header .btn-back {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
}

.chat-header .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header .info {
    flex: 1;
}

.chat-header .name {
    font-weight: 600;
}

.chat-header .status {
    font-size: 0.8rem;
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--chat-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.message {
    max-width: 80%;
    margin-bottom: 10px;
    clear: both;
}

.message.out {
    float: right;
}

.message.in {
    float: left;
}

.message .bubble {
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.out .bubble {
    background: var(--msg-out);
    border-bottom-right-radius: 2px;
}

.message.in .bubble {
    background: var(--msg-in);
    border-bottom-left-radius: 2px;
}

.message .text {
    word-wrap: break-word;
    line-height: 1.4;
}

.message .time {
    font-size: 0.7rem;
    color: var(--gray);
    text-align: right;
    margin-top: 3px;
}

.message .status {
    font-size: 0.8rem;
    margin-left: 3px;
}

.message .status.read {
    color: #53bdeb;
}

/* Card de Produto no Chat */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 280px;
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-card .info {
    padding: 12px;
}

.product-card .name {
    font-weight: 600;
    margin-bottom: 5px;
}

.product-card .desc {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
}

.product-card .btn-add {
    width: 100%;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.product-card .btn-add:hover {
    background: var(--secondary-dark);
}

/* Card de Pedido no Chat */
.order-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 300px;
}

.order-card .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--gray-light);
}

.order-card .codigo {
    font-weight: 700;
    color: var(--primary);
}

.order-card .status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.order-card .items {
    margin-bottom: 12px;
}

.order-card .item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.order-card .total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid var(--gray-light);
}

/* Input de mensagem */
.chat-input {
    background: var(--light);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input .btn-attach {
    color: var(--gray);
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.chat-input input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    border-radius: 25px;
    background: white;
    font-size: 1rem;
}

.chat-input input:focus {
    outline: none;
}

.chat-input .btn-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-input .btn-send:hover {
    background: var(--secondary-dark);
}

/* ==================== LISTA DE LOJAS ==================== */
.search-box {
    padding: 15px;
    background: var(--primary);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 15px center;
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    padding: 15px;
    gap: 12px;
    background: white;
    border-bottom: 1px solid var(--gray-light);
}

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

.category-item {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
}

.category-item .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.category-item.active .icon,
.category-item:hover .icon {
    background: var(--primary);
    color: white;
}

.category-item .name {
    font-size: 0.8rem;
    color: var(--gray);
}

.store-list {
    padding: 15px;
}

.store-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.store-card .banner {
    height: 120px;
    background: var(--gray-light);
    position: relative;
}

.store-card .banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card .logo {
    position: absolute;
    bottom: -25px;
    left: 15px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid white;
    background: white;
    object-fit: cover;
}

.store-card .info {
    padding: 35px 15px 15px;
}

.store-card .name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.store-card .category {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.store-card .meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--gray);
}

.store-card .meta i {
    margin-right: 3px;
}

.store-card .rating {
    color: var(--warning);
}

.store-card .status-open {
    color: var(--success);
    font-weight: 600;
}

.store-card .status-closed {
    color: var(--danger);
    font-weight: 600;
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: white;
    display: flex;
    border-top: 1px solid var(--gray-light);
    z-index: 100;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 10px;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.bottom-nav a i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 3px;
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-nav a .badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 20px);
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ==================== CARRINHO FLUTUANTE ==================== */
.cart-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--secondary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.4);
    cursor: pointer;
    z-index: 99;
    transition: transform 0.2s;
}

.cart-float:hover {
    transform: scale(1.1);
}

.cart-float .count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== FORMULÁRIOS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== BOTÕES ==================== */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-block {
    width: 100%;
}

/* ==================== BADGES DE STATUS ==================== */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-aguardando { background: #ffeaa7; color: #d68910; }
.badge-confirmado { background: #81ecec; color: #00b894; }
.badge-preparando { background: #74b9ff; color: #0984e3; }
.badge-saiu { background: #a29bfe; color: #6c5ce7; }
.badge-entregue { background: #55efc4; color: #00b894; }
.badge-cancelado { background: #fab1a0; color: #d63031; }

/* ==================== TELA DE LOGIN ==================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo img {
    height: 80px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

.login-divider {
    text-align: center;
    margin: 25px 0;
    color: var(--gray);
    position: relative;
}

.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--gray-light);
}

.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

/* ==================== UTILITÁRIOS ==================== */
.text-center { text-align: center; }
.text-muted { color: var(--gray); }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }
.p-3 { padding: 15px; }

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 500px) {
    .app-container {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

/* ==================== ANIMAÇÕES ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}
