/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #FFD93D;
    --background-color: #FAFAFA;
    --surface-color: #FFFFFF;
    --text-primary: #2D3436;
    --text-secondary: #636e72;
    --success-color: #00b894;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface-color);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* Logo Styles */
.app-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px auto;
    display: block;
    box-shadow: var(--shadow-card);
    border: 3px solid white;
}

.header-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.user-profile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    background-image: url('../img/user_placeholder.png');
    /* Fallback */
    background-size: cover;
}

/* Hero Section */
.hero {
    padding: 20px;
    margin-bottom: 10px;
}

.promo-card {
    background: linear-gradient(135deg, var(--primary-color), #FF8E8E);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: white;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.promo-card h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.promo-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* Categories */
.category-scroll {
    display: flex;
    overflow-x: auto;
    padding: 10px 20px;
    gap: 15px;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    padding: 8px 16px;
    background: #F0F0F0;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-pill.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-cat {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.add-btn {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

/* Auth Screens */
.auth-screen {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
}

.auth-title {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    padding: 15px;
    border: none;
    background: #F0F0F0;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: background 0.3s;
}

.input-field:focus {
    background: #E8E8E8;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.2);
    margin-top: 10px;
}

.link-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.link-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    /* Relative to app-container */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    gap: 4px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 24px;
}

/* Utility to hide/show */
.hidden {
    display: none;
}

/* Cart & Modal Styles */
.cart-floating-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    cursor: pointer;
    z-index: 99;
    animation: bounceIn 0.5s;
    text-decoration: none;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}

.cart-item-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

.remove-btn {
    color: #ff7675;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.checkout-section {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.btn-success {
    background-color: var(--success-color);
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.2);
}

/* Payment Options */
.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.payment-card {
    border: 2px solid #eee;
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #FAFAFA;
}

.payment-card ion-icon {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.payment-card span {
    font-size: 12px;
    font-weight: 600;
}

.payment-card.active {
    border-color: var(--primary-color);
    background: #FFF5F5;
}

.payment-card.active ion-icon {
    color: var(--primary-color);
}

.pix-info {
    background: #e1fcf6;
    border: 1px solid #00b894;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    text-align: center;
    display: none;
    /* Hidden by default */
}

.pix-key {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    display: block;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

/* Card Form Styles */
.card-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    display: none;
    /* Hidden by default */
}

.card-row {
    display: flex;
    gap: 10px;
}

.card-icon-display {
    position: absolute;
    right: 15px;
    top: 42px;
    /* Adjust based on label */
    font-size: 20px;
    color: var(--text-secondary);
}