/* Mobile-first responsive design */

/* Base typography */
body {
    font-size: 16px;
    line-height: 1.5;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }

@media (min-width: 768px) {
    h1 { font-size: 32px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
}

/* Touch-friendly buttons - Apple HIG 44x44px */
.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    font-size: 16px;
}

.btn-sm { min-height: 36px; padding: 6px 12px; }
.btn-lg { min-height: 52px; padding: 14px 24px; }

/* Input fields - 16px prevents zoom */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px !important;
    padding: 12px;
    min-height: 44px;
}

/* Container padding - mobile first */
.container {
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 576px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Table responsive with smooth scroll */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    font-size: 14px;
    margin-bottom: 0;
}

.table th {
    font-size: 12px;
    font-weight: 700;
    padding: 10px 8px;
    text-transform: uppercase;
}

.table td {
    padding: 10px 8px;
    vertical-align: middle;
}

@media (min-width: 768px) {
    .table { font-size: 15px; }
    .table th, .table td { padding: 12px 12px; }
}

/* Cards */
.card {
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-body { padding: 16px; }

@media (min-width: 768px) {
    .card { margin-bottom: 20px; }
    .card-body { padding: 20px; }
}

/* ============================================================================
   Touch & Mobile Enhancements
   ============================================================================ */

/* Tap highlight removal */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

/* ============================================================================
   iOS Double-Tap Zoom Prevention
   CRITICAL: Prevents zoom on rapid button taps (especially +/- buttons)
   ============================================================================ */

/* All buttons and clickable elements - prevent double-tap zoom */
button,
.btn,
[role="button"],
input[type="button"],
input[type="submit"] {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Specifically target quantity control buttons */
button[onclick*="increment"],
button[onclick*="decrement"] {
    touch-action: manipulation !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Touch feedback for interactive elements */
@media (hover: none) and (pointer: coarse) {
    .btn:active,
    .card:active,
    a.card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .prize-card:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* Safe area insets for notch devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .navbar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default focus outline */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Prize carousel swipe hint */
@media (max-width: 768px) {
    .prize-carousel-container {
        position: relative;
    }
    
    .prize-carousel-container::after {
        content: 'Свайп →';
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 12px;
        pointer-events: none;
        opacity: 0;
        animation: fadeInOut 3s ease-in-out 1s;
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* ============================================================================
   Orders Page Mobile Optimization
   ============================================================================ */

/* Order Cards for Mobile */
@media (max-width: 767px) {
    /* Order cards styling */
    .card {
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    /* Touch feedback for cards */
    .card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Better spacing for order cards */
    .card-body {
        padding: 1rem;
    }
    
    /* Order number styling */
    .card h5 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    /* Badge improvements */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
        font-weight: 600;
    }
    
    /* Total bonus display */
    .fs-5 {
        font-size: 1.25rem !important;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 8px;
    }
    
    /* Better tap targets for filters */
    .form-select, .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Filter section improvements */
    .card.shadow-sm {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Pagination improvements */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        border-radius: 8px;
        margin: 0 2px;
    }
    
    /* Hide ellipsis on mobile for cleaner look */
    .page-item.disabled .page-link {
        display: none;
    }
    
    /* Status badge colors optimization - muted v22 */
    .badge.bg-info {
        background-color: var(--color-partners, #6DB3C0) !important;
        color: #fff;
    }

    .badge.bg-warning {
        background-color: var(--color-gold-muted, #D4B85A) !important;
        color: #fff;
    }

    .badge.bg-success {
        background-color: var(--color-success-muted, #5EAD6C) !important;
    }

    .badge.bg-secondary {
        background-color: #6c757d !important;
    }
}

/* Smooth transitions for all screen sizes */
.card, .btn, .badge {
    transition: all 0.2s ease;
}

/* Better contrast for small text */
.text-muted.small {
    font-size: 0.875rem;
    color: #6c757d !important;
}

/* Optimize tab navigation for mobile */
@media (max-width: 576px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        margin-bottom: 1rem;
    }
    
    .nav-tabs .nav-item {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Tab scroll hint */
    .nav-tabs::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, white);
        pointer-events: none;
    }
}

/* ============================================================================
   Bonuses Page Mobile Optimization
   ============================================================================ */

/* Balance card improvements */
@media (max-width: 767px) {
    /* Display size adjustments */
    .display-4 {
        font-size: 2.5rem !important;
    }
    
    /* Center balance on mobile */
    .card-body.text-center {
        padding: 1.5rem 1rem;
    }
    
    /* Balance card specific */
    .card.bg-primary .card-title {
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.9;
    }
    
    .card.bg-primary .display-4 {
        font-weight: 700;
        margin: 0.5rem 0;
    }
    
    .card.bg-primary .card-text {
        font-size: 0.875rem;
        opacity: 0.9;
    }
    
    /* Info card improvements */
    .list-unstyled li {
        padding: 0.25rem 0;
        font-size: 0.9rem;
    }
    
    .list-unstyled .bi {
        margin-right: 0.5rem;
    }
    
    /* Transaction cards */
    .card.border {
        border-color: rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .card.border:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    /* Transaction amount display */
    .fs-5 {
        font-size: 1.125rem !important;
    }
    
    /* Help card at bottom */
    .card .card-title {
        font-size: 1rem;
    }
    
    .card .small {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

/* Responsive display classes */
@media (min-width: 768px) {
    .display-md-3 {
        font-size: 4.5rem !important;
    }
}

/* Balance animation on mobile */
@media (max-width: 767px) {
    @keyframes balancePulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.02); }
    }
    
    .card.bg-primary {
        animation: balancePulse 2s ease-in-out;
    }
}

/* ============================================================================
   Reports Page Mobile Optimization
   ============================================================================ */

/* Period filter buttons - vertical on mobile */
@media (max-width: 575px) {
    .btn-group-vertical .btn {
        border-radius: 0;
    }
    
    .btn-group-vertical .btn:first-child {
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
    }
    
    .btn-group-vertical .btn:last-child {
        border-bottom-left-radius: 6px;
        border-bottom-right-radius: 6px;
    }
    
    .btn-group-vertical {
        width: 100%;
    }
}

/* Page header responsive */
.reports-header {
    gap: 12px;
}

@media (max-width: 575px) {
    .reports-header h2 {
        font-size: 20px;
    }
}

/* Inactive partners cards */
.inactive-partner-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inactive-partner-card:active {
    transform: scale(0.98);
}

/* Top partners cards */
.top-partner-card {
    border-left: 3px solid transparent;
}

.top-partner-card:nth-child(1) {
    border-left-color: #ffd700; /* Gold */
}

.top-partner-card:nth-child(2) {
    border-left-color: #c0c0c0; /* Silver */
}

.top-partner-card:nth-child(3) {
    border-left-color: #cd7f32; /* Bronze */
}

/* Summary statistics - compact on mobile */
@media (max-width: 575px) {
    .summary-stat-card .card-body {
        padding: 12px !important;
    }
    
    .summary-stat-card h3 {
        font-size: 1.75rem;
    }
    
    .summary-stat-card h6 {
        font-size: 0.8rem;
    }
}

/* Alert optimization */
@media (max-width: 575px) {
    .alert {
        padding: 12px;
        font-size: 14px;
    }
    
    .alert h5 {
        font-size: 16px;
    }
}

/* Contact buttons full width on mobile */
@media (max-width: 575px) {
    .contact-btn {
        width: 100%;
        margin-top: 8px;
    }
}

/* ============================================================================
   Partners Page Mobile Optimization
   ============================================================================ */

/* Partner cards */
@media (max-width: 767px) {
    /* Partner card layout */
    .partner-card-body {
        padding: 1rem;
    }
    
    /* Contact buttons grid */
    .partner-contact-buttons .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Status badge compact */
    .partner-status-badge {
        font-size: 0.75rem;
        padding: 0.35em 0.5em;
        white-space: nowrap;
    }
    
    /* Role badge styling */
    .partner-role-badge {
        font-size: 0.8rem;
        padding: 0.4em 0.8em;
    }
    
    /* Last order info compact */
    .partner-last-order {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* Balance badge for admin */
    .partner-balance-badge {
        font-size: 0.9rem;
        padding: 0.5em 0.75em;
    }
}

/* Partner card hover effects */
.partner-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Contact button hover */
@media (min-width: 768px) {
    .partner-contact-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================================================
   Profile Page Mobile Optimization
   ============================================================================ */

/* Profile page layout */
@media (max-width: 767px) {
    /* Reduce card margins on mobile */
    .profile-card {
        margin-bottom: 1rem;
    }
    
    /* Balance display optimization */
    .balance-display {
        font-size: 2.5rem !important;
    }
    
    /* Table in profile - more compact */
    .table-borderless td {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }
    
    .table-borderless td:first-child {
        width: 35%;
        font-size: 0.85rem;
    }
    
    /* Quick actions buttons */
    .profile-quick-actions .btn {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }
    
    /* Alert optimization */
    .profile-alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Profile cards spacing */
.profile-card {
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

/* Balance card animation */
@keyframes balanceGlow {
    0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3); }
}

.card-balance {
    animation: balanceGlow 3s ease-in-out infinite;
}

/* ============================================================================
   Prize Pages Mobile Optimization
   ============================================================================ */

/* Prize Catalog - Filters */
@media (max-width: 767px) {
    /* Catalog header compact */
    .prize-catalog-header {
        margin-bottom: 1rem;
    }
    
    /* Balance alert compact */
    .prize-balance-alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Filter buttons full width */
    .prize-filters .btn {
        width: 100%;
    }
    
    /* Prize cards in grid */
    .prize-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .prize-card:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    /* Prize image optimization */
    .prize-card .card-img-top {
        height: 200px !important;
    }
}

/* Prize Detail Page */
@media (max-width: 991px) {
    /* Detail image height */
    .prize-detail-image {
        max-height: 350px !important;
    }
    
    /* Progress card compact */
    .prize-progress-card .fs-4 {
        font-size: 1.25rem !important;
    }
}

/* Prize History - already has responsive grid */

/* My Orders - Statistics and Tables */
@media (max-width: 767px) {
    /* Statistics cards compact */
    .prize-orders-stats .card-body {
        padding: 1rem;
    }
    
    .prize-orders-stats h2 {
        font-size: 1.75rem;
    }
    
    .prize-orders-stats h5 {
        font-size: 1rem;
    }
    
    /* Order image size */
    .prize-order-image {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Prize grid stagger animation */
.prize-grid-item {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.prize-grid-item:nth-child(1) { animation-delay: 0.1s; }
.prize-grid-item:nth-child(2) { animation-delay: 0.2s; }
.prize-grid-item:nth-child(3) { animation-delay: 0.3s; }
.prize-grid-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar mobile optimization */
.navbar {
    padding: 12px 0;
}

.navbar-brand {
    font-size: 20px;
    margin-bottom: 0;
}

.nav-link {
    padding: 8px 12px !important;
    font-size: 15px;
}

.navbar-toggler {
    border: none;
    padding: 8px;
}

@media (min-width: 768px) {
    .navbar { padding: 16px 0; }
    .navbar-brand { font-size: 24px; }
    .nav-link { padding: 10px 16px !important; font-size: 16px; }
}

/* Alerts and messages */
.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .alert { margin-bottom: 20px; padding: 14px 20px; }
}

/* Form groups */
.form-group, .mb-3 {
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-group, .mb-3 { margin-bottom: 24px; }
}

/* Responsive grid gaps */
.row {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 16px;
}

@media (min-width: 768px) {
    .row {
        --bs-gutter-x: 20px;
        --bs-gutter-y: 20px;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Mobile Optimization for Order Creation
   ======================================== */

/* Mobile Product Cards */
@media (max-width: 767px) {
    /* Product Cards on Mobile */
    .product-card-mobile {
        border: 1px solid #e0e0e0;
        transition: all 0.2s ease;
    }

    .product-card-mobile:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Make inputs bigger for touch */
    .product-card-mobile input[type="number"] {
        font-size: 16px !important; /* Prevents zoom on iOS */
        height: 44px;
        padding: 8px;
    }

    /* Product image in cards */
    .product-card-mobile img {
        border: 1px solid #dee2e6;
    }

    /* Total badge bigger on mobile */
    .product-card-mobile .badge {
        font-size: 1rem;
        padding: 8px 16px;
    }

    /* Labels smaller and uppercase */
    .product-card-mobile .form-label {
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #6c757d;
        font-weight: 600;
    }

    /* Balance info card on mobile */
    #balanceInfoMobile {
        border: 2px solid #e7f3ff;
    }

    #balanceInfoMobile .fs-4 {
        font-size: 2rem !important;
        font-weight: 700;
    }

    /* Payment method buttons on mobile */
    #paymentMethodGroupMobile .btn {
        padding: 12px;
        font-size: 1rem;
    }

    #paymentMethodGroupMobile .btn-check:checked + .btn {
        font-weight: 700;
    }

    /* Submit button full width on mobile */
    .d-grid .btn-lg {
        padding: 14px;
        font-size: 1.1rem;
        font-weight: 600;
    }

    /* Notes textarea */
    .form-control[rows="3"] {
        font-size: 16px !important;
        min-height: 100px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Desktop table but compact */
    .table th {
        font-size: 0.875rem;
        padding: 8px;
    }

    .table td {
        font-size: 0.875rem;
        padding: 8px;
    }

    /* Smaller input fields */
    .table input[type="number"] {
        font-size: 0.875rem;
        height: 36px;
    }

    /* Product images slightly smaller */
    .table img {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Cross-device improvements */

/* Better number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Success/error states for inputs */
.form-control.is-valid {
    border-color: #28a745;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Focus states for keyboard navigation */
.btn:focus,
.form-control:focus,
.btn-check:focus + .btn {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ==================== NEWS PAGES ==================== */

/* News card grid */
.news-card-grid .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* News card image */
.news-card-grid .card-img-top {
    transition: transform 0.3s ease;
}

.news-card-grid .card:hover .card-img-top {
    transform: scale(1.05);
}

.news-card-grid .card {
    overflow: hidden;
}

/* News content formatting */
.news-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.news-content p {
    margin-bottom: 1rem;
}

/* Mobile optimizations for news */
@media (max-width: 768px) {
    /* News list cards */
    .news-card-grid .card-img-top {
        height: 150px !important;
    }

    .news-card-grid .card-title {
        font-size: 1rem;
    }

    .news-card-grid .card-text {
        font-size: 0.875rem;
    }

    /* News detail page */
    .news-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Prev/Next navigation */
    .news-nav-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .news-nav-btn i {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    /* Even smaller on mobile */
    .news-card-grid .card-img-top {
        height: 120px !important;
    }

    .news-card-grid .card-body {
        padding: 0.75rem;
    }

    .news-card-grid .card-footer {
        padding: 0.5rem 0.75rem;
    }

    /* Stack prev/next buttons on mobile */
    .news-detail-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .news-detail-nav .btn {
        width: 100%;
        text-align: center;
    }
}

/* News audience badges */
.news-audience-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Empty state styling */
.news-empty-state {
    padding: 3rem 1rem;
}

.news-empty-state i {
    opacity: 0.3;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .news-card-grid .card:active {
        transform: scale(0.98);
    }
}

/* ===================================
   BOTTOM NAVIGATION (Mobile Only)
   =================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.7rem;
    padding: 8px 4px;
    transition: color 0.2s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Ripple effect */
.bottom-nav-item::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.3) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.bottom-nav-item:active::after {
    transform: scale(2.5);
    opacity: 1;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

/* Badge for pending orders */
.bottom-nav-icon-wrapper {
    position: relative;
    display: inline-block;
}

.bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.bottom-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    color: #0d6efd;
    text-decoration: none;
}

.bottom-nav-item.active {
    color: #0d6efd;
    font-weight: 600;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

/* Add padding to body to prevent content hiding behind bottom nav */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 80px;
    }
}

/* Safe area for iPhone with notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        height: calc(64px + env(safe-area-inset-bottom));
    }

    @media (max-width: 767.98px) {
        body {
            padding-bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }
}
