/* ================================
   B2B Store - Estilos Principais
   ================================ */

:root {
    --primary: #0f3d1e;
    --primary-dark: #0a2912;
    --primary-light: #166534;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ================================
   Landing / Login Page
   ================================ */

.landing-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(160deg, #0f3d1e 0%, #071a0c 50%, #030a05 100%);
}

.landing-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 80px;
    color: var(--white);
}

.landing-logo {
    margin-bottom: 20px;
}

.landing-logo .logo-img {
    max-width: 180px;
    height: auto;
}

.landing-logo span {
    font-size: 2rem;
    font-weight: 800;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: var(--radius);
}

.landing-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.landing-text {
    font-size: 0.95rem;
    line-height: 1.8;
    opacity: 0.85;
    max-width: 480px;
    font-weight: 300;
}

.landing-text p {
    margin-bottom: 20px;
}

.landing-text strong {
    color: #d4af37;
    font-weight: 500;
}

.register-info {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--gray-600);
}

.register-info p {
    margin-bottom: 10px;
}

.register-info p:last-child {
    margin-bottom: 0;
}

.admin-gear {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.3s;
    z-index: 100;
}

.admin-gear:hover {
    color: rgba(255,255,255,0.8);
}

.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.auth-footer p {
    margin: 4px 0;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .landing-page {
        flex-direction: column;
    }
    
    .landing-left {
        padding: 40px 30px;
    }
    
    .landing-right {
        width: 100%;
    }
}

.landing-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 500px;
    margin-bottom: 40px;
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.landing-feature i {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-right {
    width: 500px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.auth-box {
    width: 100%;
    max-width: 380px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--gray-200);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ================================
   Layout Principal
   ================================ */

.main-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--gray-100);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-btn {
    position: relative;
    background: var(--gray-100);
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--gray-700);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
}

.store-header {
    background: linear-gradient(160deg, #0f3d1e 0%, #071a0c 50%, #030a05 100%);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.store-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.store-logo {
    flex-shrink: 0;
}

.store-logo-img {
    height: 50px;
    width: auto;
}

.store-search {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: 25px;
    overflow: hidden;
}

.store-search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    outline: none;
}

.store-search-input::placeholder {
    color: #94a3b8;
}

.store-search-btn {
    padding: 12px 20px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

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

.store-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.store-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.2s;
}

.store-nav-icon:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.store-cart-icon {
    position: relative;
}

.store-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ================================
   Container e Grid
   ================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.page-subtitle {
    color: var(--gray-500);
    margin-top: 4px;
}

/* ================================
   Cards
   ================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ================================
   Catálogo de Produtos
   ================================ */

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

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

.category-count {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-image {
    height: 220px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 3rem;
    padding: 12px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-image-link {
    display: block;
}

.product-detail-image {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 8px 0;
    color: var(--gray-800);
}

.product-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-name-link:hover .product-name {
    color: var(--primary);
}

.product-sku {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

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

.product-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 1rem;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    font-size: 1rem;
}

/* ================================
   Carrinho
   ================================ */

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.cart-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.cart-summary {
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius-lg);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--gray-200);
    padding-top: 12px;
    margin-top: 12px;
}

/* ================================
   Painel Admin
   ================================ */

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(160deg, #0f3d1e 0%, #071a0c 50%, #030a05 100%);
    color: var(--white);
    padding: 24px;
}

.admin-logo {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
}

.admin-menu {
    list-style: none;
}

.admin-menu-item {
    margin-bottom: 4px;
}

.admin-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-300);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.admin-menu-link:hover, .admin-menu-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-content {
    padding: 32px;
    background: var(--gray-100);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--gray-500);
    margin-top: 4px;
}

/* ================================
   Tabelas
   ================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    background: var(--gray-50);
}

.table tr:hover {
    background: var(--gray-50);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ================================
   Alertas
   ================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ================================
   Modal
   ================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ================================
   Status Pendente
   ================================ */

.pending-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.pending-box {
    text-align: center;
    max-width: 500px;
    padding: 60px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.pending-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.pending-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.pending-text {
    color: var(--gray-600);
    line-height: 1.8;
}

/* ================================
   Responsivo
   ================================ */

@media (max-width: 1024px) {
    .landing-page {
        flex-direction: column;
    }
    
    .landing-left {
        padding: 40px;
    }
    
    .landing-title {
        font-size: 2rem;
    }
    
    .landing-right {
        width: 100%;
        padding: 40px;
    }
    
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Forçar elementos a respeitar largura da tela */
    .card,
    .cart-summary,
    form,
    table,
    .alert {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Texto e elementos que podem vazar */
    h1, h2, h3, h4, p, span, strong, td, th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Esconder elementos que vazam no header */
    .header-actions .cart-btn {
        white-space: nowrap;
    }
    
    .user-menu {
        display: none !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    /* Header compacto no mobile */
    .main-header {
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    .header-content {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    /* Esconder navegação desktop e busca no mobile */
    .nav-menu,
    .header-actions form,
    .user-menu span {
        display: none !important;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .cart-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Container com padding para header e bottom nav */
    body.app-layout {
        padding-top: 60px;
        padding-bottom: 70px;
    }
    
    .container {
        padding: 16px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .page-header {
        margin-bottom: 16px;
    }
    
    .page-title {
        font-size: 1.35rem;
    }
    
    /* Cards de produtos mobile */
    .product-card {
        border-radius: 12px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-category {
        font-size: 0.65rem;
    }
    
    .product-name {
        font-size: 0.9rem;
        margin: 4px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-sku {
        display: none;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }
    
    .quantity-control {
        justify-content: center;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
    }
    
    .quantity-input {
        width: 40px;
        font-size: 0.9rem;
    }
    
    .product-actions .btn {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    /* Sidebar como filtro horizontal */
    .catalog-layout {
        gap: 16px;
    }
    
    .sidebar {
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
        max-width: 100%;
    }
    
    .sidebar-title {
        display: none;
    }
    
    .category-list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 4px 0 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .category-list::-webkit-scrollbar {
        display: none;
    }
    
    .category-item {
        flex-shrink: 0;
        padding: 8px 16px;
        background: var(--white);
        border-radius: 20px;
        font-size: 0.85rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
        margin-bottom: 0;
    }
    
    .category-item.active {
        background: var(--primary);
        color: white;
    }
    
    /* Carrinho mobile */
    .cart-grid-mobile {
        grid-template-columns: 1fr !important;
    }
    
    .cart-table {
        display: block;
        width: 100%;
    }
    
    .cart-table thead {
        display: none;
    }
    
    .cart-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 16px;
        background: var(--white);
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
        gap: 12px;
        align-items: center;
    }
    
    .cart-table td {
        border: none;
        padding: 0;
    }
    
    .cart-table td:first-child {
        width: 100%;
    }
    
    .cart-table td:nth-child(2) {
        display: none;
    }
    
    .cart-table td:nth-child(3) {
        flex: 1;
    }
    
    .cart-table td:nth-child(4) {
        font-size: 1.1rem;
    }
    
    .cart-table td:last-child .btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .cart-item-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .cart-summary {
        padding: 16px;
    }
    
    /* Alertas mobile */
    .alert {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    /* Tabela de pedidos mobile */
    .table {
        display: block;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 16px;
        background: var(--gray-50);
        border-radius: 12px;
        gap: 8px;
        align-items: center;
    }
    
    .table td {
        border: none;
        padding: 0;
    }
    
    .table td:first-child {
        font-size: 1.1rem;
    }
    
    .table td:nth-child(2) {
        width: 100%;
        order: -1;
        font-size: 0.8rem;
        color: var(--gray-500);
        margin-bottom: 4px;
    }
    
    .table td:nth-child(3) {
        margin-left: auto;
    }
    
    .table td:nth-child(4),
    .table td:nth-child(5) {
        width: 100%;
        margin-top: 8px;
    }
    
    .table td:last-child {
        width: 100%;
        margin-top: 12px;
    }
    
    .table td:last-child .btn {
        width: 100%;
    }
    
    /* Grid carrinho mobile */
    .cart-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Checkout, carrinho e order detail grid mobile */
    .checkout-grid,
    .order-detail-grid,
    .cart-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Itens checkout mobile - tabela simplificada */
    .checkout-grid .table tbody {
        padding: 12px;
    }
    
    .checkout-grid .table tr {
        padding: 12px;
    }
    
    .checkout-grid .table td:nth-child(2) {
        order: 0;
        width: auto;
        font-size: 0.9rem;
        color: var(--gray-700);
        margin-bottom: 0;
    }
    
    .checkout-grid .table td:nth-child(3) {
        display: none;
    }
    
    /* Order detail table mobile */
    .order-detail-grid .table td:nth-child(2) {
        display: none;
    }
    
    .order-detail-grid .table td:nth-child(3) {
        order: 0;
        width: auto;
    }
    
    .order-detail-grid .table td:nth-child(4) {
        display: none;
    }
}

/* ================================
   Bottom Navigation - Mobile App Style
   ================================ */

.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 4px;
        color: var(--gray-500);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        transition: color 0.2s;
        position: relative;
    }
    
    .bottom-nav-item.active {
        color: var(--primary);
    }
    
    .bottom-nav-item svg {
        width: 24px;
        height: 24px;
    }
    
    .bottom-nav-item .nav-badge {
        position: absolute;
        top: 2px;
        right: 50%;
        transform: translateX(12px);
        background: var(--danger);
        color: white;
        font-size: 0.65rem;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 16px;
        text-align: center;
    }
}

/* ================================
   Mobile Search Bar
   ================================ */

.mobile-search {
    display: none;
}

@media (max-width: 768px) {
    .mobile-search {
        display: block;
        padding: 0 0 12px;
    }
    
    .mobile-search form {
        display: flex;
        gap: 8px;
    }
    
    .mobile-search .form-control {
        flex: 1;
        padding: 12px 16px;
        border-radius: 25px;
        font-size: 0.9rem;
        background: var(--white);
        border: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .mobile-search .btn {
        border-radius: 25px;
        padding: 12px 20px;
    }
}

/* ================================
   Pull to Refresh Effect
   ================================ */

@media (max-width: 768px) {
    .card {
        border-radius: 16px;
    }
    
    .btn {
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Empty state mobile */
    .card-body[style*="padding: 60px"] {
        padding: 40px 20px !important;
    }
    
    /* Garantir que cards não saiam da tela */
    .catalog-layout main,
    .catalog-layout main .card {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .catalog-layout main .card .card-body {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Products grid container */
    .products-grid {
        max-width: 100%;
        width: 100%;
    }
}

/* ================================
   iOS Safe Area
   ================================ */

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .bottom-nav {
            padding-bottom: max(8px, env(safe-area-inset-bottom));
        }
        
        body.app-layout {
            padding-bottom: calc(70px + env(safe-area-inset-bottom));
        }
    }
}
