/**
 * Pediaê - Estilos Principais Refinados
 * Design profissional e moderno
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8C5A;
    --secondary: #004E89;
    --secondary-light: #0066B3;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --dark-light: #374151;
    --gray: #6B7280;
    --gray-light: #9CA3AF;
    --border: #E5E7EB;
    --bg: #F9FAFB;
    --bg-white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Refinado */
.header {
    background: var(--bg-white);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 24px;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.nav a:not(.btn-primary):hover {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(255, 107, 53, 0.39);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(255, 107, 53, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Hero Section Refinado */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>');
    opacity: 0.3;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Restaurants Section */
.restaurants {
    padding: 80px 0;
}

.restaurants h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 48px;
    letter-spacing: -0.5px;
}

.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.restaurant-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    position: relative;
}

.restaurant-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.restaurant-card:hover::after {
    transform: scaleX(1);
}

.restaurant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.restaurant-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.restaurant-card:hover img {
    transform: scale(1.05);
}

.restaurant-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.restaurant-card-content {
    padding: 24px;
}

.restaurant-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.restaurant-card p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Restaurant Header */
.restaurant-header {
    background: var(--bg-white);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.restaurant-logo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 24px;
    border: 4px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.restaurant-logo:hover {
    transform: scale(1.05);
}

.restaurant-header h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.restaurant-header p {
    font-size: 18px;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto 16px;
}

.restaurant-header .min-order {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Menu Section */
.menu {
    padding: 60px 0;
}

.category-section {
    margin-bottom: 64px;
}

.category-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    letter-spacing: -0.5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.product-card-body {
    padding: 20px;
}

.product-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.product-card p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
    line-height: 1.6;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.price {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.btn-add {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-add:active {
    transform: scale(0.98);
}

/* Cart Refinado */
.cart-toggle {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.cart-toggle::before {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid white;
}

.cart-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 25px 50px -12px rgba(255, 107, 53, 0.5);
}

.cart-sidebar {
    position: fixed;
    right: -420px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.cart-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.close-cart {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-cart:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.cart-item:hover {
    background: var(--bg);
}

.cart-item-info {
    flex: 1;
}

.cart-item-info strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark);
}

.cart-item-info span {
    font-size: 14px;
    color: var(--gray);
}

.cart-item button {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item button:hover {
    background: var(--danger);
    color: white;
}

.cart-footer {
    padding: 24px;
    border-top: 2px solid var(--border);
    background: var(--bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
}

.cart-total strong {
    font-size: 18px;
    color: var(--dark);
}

.cart-total span {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-block {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
}

/* Auth Pages Refinadas */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 24px;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="%23e5e7eb" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.auth-box {
    background: var(--bg-white);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}

.auth-box h1 {
    margin-bottom: 32px;
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: var(--dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: #FEF2F2;
    color: var(--danger);
    border: 2px solid #FEE2E2;
}

.alert-success {
    background: #ECFDF5;
    color: var(--success);
    border: 2px solid #D1FAE5;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Footer Refinado */
.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 48px 0;
    margin-top: 80px;
}

.footer p {
    font-size: 14px;
    opacity: 0.8;
}

/* Modal Refinado */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-white);
    margin: 5% auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: var(--bg);
    color: var(--dark);
    transform: rotate(90deg);
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    border-left: 4px solid;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .restaurant-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .nav {
        width: 100%;
        margin-top: 12px;
        display: flex;
        gap: 8px;
    }
    
    .auth-box {
        padding: 32px 24px;
    }
    
    .restaurants h2 {
        font-size: 28px;
    }
    
    .category-section h2 {
        font-size: 24px;
    }
}
