:root {
    --primary-red: #C22129;
    --primary-blue: #00AEEF;
    --accent-yellow: #FEC600;
    --bg-color: #FAFAFA;
    --dark-text: #1D1D1D;
    --secondary-text: #6B7280;
    --border-color: #E5E7EB;
    --success: #16A34A;
    --error: #DC2626;
    --white: #FFFFFF;
    
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    
    --nav-height: 60px;
    --header-height: 64px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--dark-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

a {
    color: var(--primary-red);
    text-decoration: none;
}

/* App Container (Safe areas for iOS/Android WebView) */
.app-container {
    min-height: 100vh;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    transition: padding 0.3s ease;
    position: relative;
    overflow-x: hidden;
}
.app-container.has-header {
    padding-top: calc(var(--header-height) + var(--safe-area-top));
}
.app-container.has-bottom-nav {
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 20px);
}

/* Typography Classes */
.text-primary-red { color: var(--primary-red); }
.text-primary-blue { color: var(--primary-blue); }
.text-accent { color: var(--accent-yellow); }
.text-secondary-gray { color: var(--secondary-text); }
.bg-primary-red { background-color: var(--primary-red); color: var(--white); }
.bg-accent { background-color: var(--accent-yellow); color: var(--dark-text); }

/* Buttons */
.btn-frangoz {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
}
.btn-frangoz:active {
    transform: scale(0.97);
    background-color: #a31a20;
}
.btn-outline-frangoz {
    background-color: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
    border-radius: var(--radius-pill);
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
}
.btn-outline-frangoz:active {
    background-color: rgba(194, 33, 41, 0.1);
}

/* Animations */
.view-transition.ng-enter,
.view-transition.ng-leave {
    transition: all 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100vh;
}
.view-transition.ng-enter {
    opacity: 0;
    transform: translateX(20px);
}
.view-transition.ng-enter-active {
    opacity: 1;
    transform: translateX(0);
}
.view-transition.ng-leave {
    opacity: 1;
    transform: translateX(0);
}
.view-transition.ng-leave-active {
    opacity: 0;
    transform: translateX(-20px);
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    padding-top: var(--safe-area-top);
    box-shadow: 0 1px 0 var(--border-color);
}
.brand-logo {
    height: 32px;
    object-fit: contain;
}
.icon-btn {
    background: transparent;
    border: none;
    color: var(--dark-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}
.icon-btn:active {
    background: rgba(0,0,0,0.05);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: 0 -1px 0 var(--border-color);
    z-index: 1000;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    width: 100%;
    height: 100%;
    position: relative;
}
.nav-item.active {
    color: var(--primary-red);
}
.nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
}
.nav-item .material-symbols-rounded {
    font-size: 24px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}
.nav-item:active .material-symbols-rounded {
    transform: scale(0.9);
}
.nav-badge {
    position: absolute;
    top: 6px;
    right: 25%;
    background: var(--primary-red);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Floating Cart */
.floating-cart-btn {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-red);
    color: white;
    border: none;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease;
}
.floating-cart-btn:active {
    transform: scale(0.9);
}
.floating-cart-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-yellow);
    color: var(--dark-text);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--white);
}

/* Product Cards */
.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-card .img-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #f0f0f0;
}
.product-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.product-desc {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.product-price {
    font-weight: 700;
    color: var(--primary-red);
    font-size: 1.1rem;
}
.btn-add-cart {
    background: var(--accent-yellow);
    color: var(--dark-text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}
.btn-add-cart:active {
    transform: scale(0.9);
}

/* Search Bar */
.search-box {
    position: relative;
    width: 100%;
}
.search-box .material-symbols-rounded {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
}
.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}

/* Category Scroller */
.category-scroller {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin: 0 -20px;
    padding: 10px 20px;
}
.category-scroller::-webkit-scrollbar {
    display: none;
}
.category-pill {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.category-pill.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-sm);
}

/* Forms */
.form-control {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-family: var(--font-body);
}
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}
.form-label {
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

/* Utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

/* Desktop Optimizations */
@media (min-width: 768px) {
    .app-container {
        background: var(--white);
        min-height: 100vh;
    }
    .floating-cart-btn {
        right: 40px;
        bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 40px);
    }
    .bottom-nav {
        border-top: 1px solid var(--border-color);
        box-shadow: none;
    }
}
