/* ==========================================================================
   QR SmartMenu - Frontend Styles
   ========================================================================== */

:root {
    --qr-primary: #6366f1;
    --qr-primary-dark: #4f46e5;
    --qr-success: #10b981;
    --qr-danger: #ef4444;
    --qr-warning: #f59e0b;
    --qr-dark: #1f2937;
    --qr-light: #f9fafb;
    --qr-border: #e5e7eb;
    --qr-text: #374151;
    --qr-text-light: #6b7280;
    --qr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --qr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --qr-radius: 12px;
    --qr-radius-sm: 8px;
}

/* Reset e Base */
.qr-smartmenu-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--qr-text);
    line-height: 1.6;
    max-width: 100%;
    margin: 0 auto;
    background: var(--qr-light);
    min-height: 100vh;
}

.qr-smartmenu-container * {
    box-sizing: border-box;
}

/* Header */
.qr-menu-header {
    background: white;
    padding: 1.5rem;
    box-shadow: var(--qr-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-menu-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--qr-dark);
    margin: 0;
}

.qr-menu-subtitle {
    color: var(--qr-text-light);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

/* Botão do Carrinho */
.qr-cart-button {
    position: relative;
    background: var(--qr-primary);
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: var(--qr-shadow);
}

.qr-cart-button:hover {
    background: var(--qr-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--qr-danger);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Navegação de Categorias */
.qr-category-nav {
    background: white;
    border-bottom: 1px solid var(--qr-border);
    position: sticky;
    top: 76px;
    z-index: 99;
}

.qr-category-nav-scroll {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.qr-category-nav-scroll::-webkit-scrollbar {
    display: none;
}

.qr-category-link {
    background: var(--qr-light);
    color: var(--qr-text);
    padding: 0.5rem 1rem;
    border-radius: var(--qr-radius-sm);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

/* Menu Content */
.qr-menu-content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.qr-menu-section {
    margin-bottom: 3rem;
}

.qr-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--qr-dark);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--qr-primary);
}

/* Menu Grid */
.qr-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.qr-menu-item {
    background: white;
    border-radius: var(--qr-radius);
    overflow: hidden;
    box-shadow: var(--qr-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.qr-menu-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-item-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--qr-light);
}

.qr-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.qr-menu-item:hover .qr-item-image img {
    transform: scale(1.05);
}

.qr-item-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qr-item-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--qr-dark);
    margin: 0 0 0.5rem;
}

.qr-item-description {
    color: var(--qr-text-light);
    font-size: 0.95rem;
    margin: 0 0 1rem;
    flex: 1;
}

.qr-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.qr-item-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--qr-primary);
}

.qr-add-to-cart {
    background: var(--qr-primary);
    color: white;
    border: none;
    border-radius: var(--qr-radius-sm);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qr-add-to-cart:hover {
    background: var(--qr-primary-dark);
    transform: scale(1.05);
}

.qr-button-icon {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Carrinho Sidebar */
.qr-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-cart-panel.active {
    pointer-events: all;
    opacity: 1;
}

.qr-cart-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.qr-cart-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.qr-cart-panel.active .qr-cart-sidebar {
    transform: translateX(0);
}

.qr-cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--qr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--qr-dark);
}

.qr-cart-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--qr-text);
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.3s ease;
}

.qr-cart-close:hover {
    color: var(--qr-danger);
}

.qr-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.qr-cart-empty {
    text-align: center;
    color: var(--qr-text-light);
    padding: 3rem 1rem;
}

.qr-cart-item {
    background: var(--qr-light);
    border-radius: var(--qr-radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-cart-item-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--qr-dark);
}

.qr-cart-item-price {
    color: var(--qr-primary);
    font-weight: 600;
}

.qr-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qr-cart-qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border-radius: var(--qr-radius-sm);
    padding: 0.25rem;
}

.qr-cart-qty-btn {
    background: var(--qr-primary);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

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

.qr-cart-qty {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.qr-cart-item-remove {
    background: transparent;
    border: none;
    color: var(--qr-danger);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.qr-cart-footer {
    border-top: 1px solid var(--qr-border);
    padding: 1.5rem;
}

.qr-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.qr-cart-total strong {
    color: var(--qr-primary);
    font-size: 1.75rem;
}

.qr-cart-observations {
    margin-bottom: 1rem;
}

.qr-cart-observations label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--qr-dark);
}

.qr-cart-observations textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--qr-border);
    border-radius: var(--qr-radius-sm);
    font-family: inherit;
    resize: vertical;
}

.qr-send-order {
    width: 100%;
    background: var(--qr-success);
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-send-order:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-send-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botão Solicitar Conta */
.qr-request-bill {
    width: 100%;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-request-bill:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-bill-icon {
    font-size: 1.25rem;
}

/* Botão Chamar Garçom */
.qr-call-waiter {
    width: 100%;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qr-call-waiter:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-call-waiter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qr-waiter-icon {
    font-size: 1.25rem;
}

/* Botão Encerrar Sessão */
.qr-end-session {
    width: 100%;
    background: #666;
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qr-end-session:hover:not(:disabled) {
    background: #444;
    transform: translateY(-2px);
    box-shadow: var(--qr-shadow-lg);
}

.qr-end-session:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qr-exit-icon {
    font-size: 1.25rem;
}

/* Modal */
.qr-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-content {
    background: white;
    border-radius: var(--qr-radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

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

.qr-modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.qr-modal-content h2 {
    color: var(--qr-dark);
    margin: 0 0 1rem;
}

.qr-modal-content p {
    color: var(--qr-text-light);
    margin: 0 0 1.5rem;
}

.qr-modal-close {
    background: var(--qr-primary);
    color: white;
    border: none;
    border-radius: var(--qr-radius);
    padding: 0.75rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.qr-modal-close:hover {
    background: var(--qr-primary-dark);
}

/* Responsivo */
@media (max-width: 768px) {
    .qr-menu-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-cart-sidebar {
        max-width: 100%;
    }
    
    .qr-menu-title {
        font-size: 1.5rem;
    }
}

/* Empty State */
.qr-empty-menu {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--qr-text-light);
}
