/* CSS Variables for Theme */
:root {
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(240, 4%, 16%);
    --primary: hsl(217, 91%, 45%);
    --primary-foreground: hsl(217, 91%, 98%);
    --card: hsl(240, 2%, 96%);
    --card-foreground: hsl(240, 4%, 16%);
    --border: hsl(240, 4%, 89%);
    --muted: hsl(240, 5%, 90%);
    --muted-foreground: hsl(240, 3%, 38%);
    --accent: hsl(240, 6%, 88%);
    --destructive: hsl(0, 84%, 42%);
    --shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    --font-sans:
        "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
}

.dark {
    --background: hsl(240, 4%, 9%);
    --foreground: hsl(240, 3%, 92%);
    --primary: hsl(217, 91%, 52%);
    --primary-foreground: hsl(217, 91%, 98%);
    --card: hsl(240, 3%, 11%);
    --card-foreground: hsl(240, 3%, 92%);
    --border: hsl(240, 4%, 16%);
    --muted: hsl(240, 4%, 17%);
    --muted-foreground: hsl(240, 3%, 68%);
    --accent: hsl(240, 5%, 18%);
    --destructive: hsl(0, 84%, 42%);
    --shadow: 0px 2px 12px rgba(0, 0, 0, 0.4);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

/* Header */
.header {
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--foreground);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--foreground);
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
}

.logo-text {
    white-space: nowrap;
}

.nav-menu-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.nav-link {
    padding: 1rem 1.5rem;
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.938rem;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--accent);
    color: var(--primary);
}

.nav-link.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-bottom-color: var(--primary);
}

/* Dropdown Wrapper */
.dropdown-wrapper {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.938rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.dropdown-toggle:hover {
    background-color: var(--primary);
    opacity: 0.9;
    transform: translateY(-1px);
}

.dropdown-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.dropdown-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    min-width: 250px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    padding: 0.875rem 1.5rem;
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.938rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    display: block;
    text-align: left;
}

.dropdown-link:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.dropdown-link:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.dropdown-link:hover {
    background-color: var(--accent);
    color: var(--primary);
}

.dropdown-link.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--background);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}

.dark .sun-icon {
    display: inline;
}

.dark .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: inline;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 1.5rem 1rem;
}

.billionaire-avatar {
    margin-bottom: 1rem;
    animation: fadeInScale 0.6s ease-out;
}

.avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow);
    object-fit: cover;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.avatar-initial {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    font-weight: 500;
}

.budget-display {
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
    transition: all 0.3s ease;
}

.budget-display.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--background);
    padding: 0.5rem 1rem;
    z-index: 999;
    border-bottom: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.current-budget {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
    transition: transform 0.3s ease;
}

.budget-display.sticky .current-budget {
    font-size: 1.5rem;
    margin-bottom: 0;
    line-height: 1.2;
}

.budget-display.sticky .budget-info {
    font-size: 0.7rem;
    margin: 0;
}

.current-budget.update {
    animation: budgetPulse 0.3s ease;
}

.budget-info {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Shopping Container */
.shopping-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1500px;
    margin: 0 auto;
}

/* Item Card */
.item-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    animation: fadeInUp 0.4s ease-out backwards;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.item-image-container {
    aspect-ratio: 1;
    background-color: var(--muted);
    overflow: hidden;
    max-height: 300px;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    padding: 1.25rem;
}

.item-name {
    font-size: 1.188rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.item-price {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    font-variant-numeric: tabular-nums;
    margin-bottom: 1rem;
}

.quantity-badge {
    display: inline-block;
    background-color: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.item-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    font-size: 0.969rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-family: var(--font-sans);
}

.btn-sell {
    background-color: var(--card);
    color: var(--foreground);
}

.btn-sell:not(:disabled) {
    background-color: #f53b5d;
    color: white;
    border-color: #f53b5d;
}

.btn-sell:hover:not(:disabled) {
    background-color: #d63350;
}

.btn-buy {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-buy:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Receipt Sidebar */
.receipt-sidebar {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-top: 2rem;
}

.sticky ~ .shopping-container .receipt-sidebar {
    position: relative;
    top: auto;
}

.receipt-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.receipt-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-icon {
    font-size: 1.25rem;
}

.receipt-divider {
    height: 1px;
    background-color: var(--border);
    margin: 1rem 0;
}

.receipt-content {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.empty-receipt {
    text-align: center;
    color: var(--muted-foreground);
    padding: 2rem 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    animation: slideInLeft 0.3s ease-out;
}

.receipt-item-info {
    flex: 1;
    min-width: 0;
}

.receipt-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-item-details {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.receipt-item-total {
    font-weight: 600;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.receipt-footer {
    margin-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-weight: 600;
    font-size: 1rem;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1rem 2rem 1rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    background-color: var(--card);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.footer-description {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.footer-keywords {
    font-size: 0.813rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--muted);
    border-radius: 0.5rem;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.footer-keywords strong {
    color: var(--foreground);
}

.footer-links {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2.5rem 0 1.5rem 0;
    padding: 1.5rem 0;
    border-top: 2px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.footer-links a {
    color: var(--foreground) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.063rem;
    transition: all 0.2s ease;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    border: 1px solid transparent;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary) !important;
    background-color: var(--accent);
    border-color: var(--primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.footer-links a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.footer-copyright {
    font-size: 0.813rem;
    opacity: 0.8;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.footer-features {
    margin: 1.5rem auto;
    max-width: 900px;
    text-align: left;
}

.footer-subheading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.75rem;
}

.footer-features p {
    line-height: 1.8;
    color: var(--muted-foreground);
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes budgetPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .shopping-container {
        grid-template-columns: 1fr;
    }

    .receipt-sidebar {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        max-height: 50vh;
        z-index: 998;
        background-color: var(--card);
        border-top: 2px solid var(--border);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .receipt-sidebar.show {
        display: block;
        transform: translateY(0);
    }

    .receipt-sidebar.expanded {
        max-height: 80vh;
    }
    
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        padding-bottom: 2rem;
        max-width: 1000px;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-container {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        position: relative;
    }

    .header-logo {
        font-size: 1rem;
        gap: 0.375rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .logo-text {
        display: inline;
    }

    .nav-menu-wrapper {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0.75rem;
        right: 0.75rem;
        width: calc(100% - 1.5rem);
        order: 3;
        background-color: var(--card);
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
        z-index: 999;
    }

    .nav-menu-wrapper.active {
        max-height: 600px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-link {
        display: block;
        padding: 0.875rem 1.5rem;
        font-size: 0.938rem;
        color: var(--foreground);
        text-decoration: none;
        font-weight: 500;
        white-space: nowrap;
        line-height: 1.5;
        transition: background-color 0.2s ease, color 0.2s ease;
        border-bottom: 1px solid var(--border);
        text-align: center;
    }

    .nav-link:first-child {
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;
    }

    .dropdown-wrapper:last-child .dropdown-menu:last-child .dropdown-link:last-child,
    .dropdown-wrapper:last-child .dropdown-toggle {
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

    .dropdown-wrapper:last-child .dropdown-menu:not(.show) ~ .dropdown-toggle,
    .dropdown-wrapper:last-child .dropdown-menu.show:empty ~ .dropdown-toggle {
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

    .nav-link:hover {
        background-color: var(--accent);
        color: var(--primary);
    }

    .dropdown-wrapper {
        display: none;
    }

    .dropdown-toggle {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.938rem;
        justify-content: center;
        white-space: nowrap;
        text-align: center;
        background-color: transparent;
        border: none;
        border-radius: 0;
        color: var(--foreground);
        font-weight: 500;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
        gap: 0.5rem;
    }

    .dropdown-toggle:hover {
        background-color: var(--accent);
        color: var(--primary);
    }

    .dropdown-menu {
        position: relative;
        top: auto;
        left: 0;
        right: 0;
        max-height: none;
        overflow-y: visible;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--border);
        box-shadow: none;
        transform: none;
        background-color: transparent;
        margin-top: 0.5rem;
    }

    .dropdown-menu.show {
        transform: none;
    }

    .dropdown-link {
        padding: 0.875rem 1.5rem;
        font-size: 0.938rem;
        border-bottom: 1px solid var(--border);
        display: block;
        text-align: center;
    }

    .dropdown-link:last-child {
        border-bottom: none;
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

    .main-content {
        padding: 1rem 0.75rem 0 0.75rem;
    }

    .hero-section {
        padding: 1.5rem 0.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .current-budget {
        font-size: 2rem;
        word-break: break-word;
        line-height: 1.1;
    }

    .avatar-image,
    .avatar-placeholder {
        width: 100px;
        height: 100px;
    }

    .items-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }

    .item-card {
        min-width: 0;
    }

    .item-image-container {
        max-height: 350px;
    }

    .item-details {
        padding: 1.25rem;
    }

    .item-name {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .item-price {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.938rem;
    }
    
    .shopping-container {
        gap: 1rem;
        margin-bottom: 0;
    }

    .footer {
        padding: 2rem 1rem 1.5rem 1rem;
    }

    .footer-heading {
        font-size: 1.25rem;
    }

    .footer-description {
        font-size: 0.875rem;
    }
    
    .footer-links {
        gap: 1rem;
        padding: 1rem 0;
        margin: 2rem 0 1rem 0;
    }
    
    .footer-links a {
        font-size: 0.938rem;
        padding: 0.625rem 1.25rem;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .header-logo {
        font-size: 0.875rem;
    }

    .logo-icon {
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: 0.875rem;
    }

    .mobile-menu-toggle {
        padding: 0.375rem;
    }

    .mobile-menu-toggle span {
        width: 20px;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .main-content {
        padding: 1rem 0.5rem 0 0.5rem;
    }

    .hero-section {
        padding: 1rem 0.25rem;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .current-budget {
        font-size: 1.5rem;
    }

    .budget-info {
        font-size: 0.75rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .item-image-container {
        max-height: 350px;
    }

    .item-details {
        padding: 1.25rem;
    }

    .item-name {
        font-size: 1.188rem;
        margin-bottom: 1rem;
    }

    .item-price {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.938rem;
    }
    
    .shopping-container {
        gap: 0.5rem;
    }
    
    .budget-display.sticky {
        padding: 0.375rem 0.5rem;
    }

    .budget-display.sticky .current-budget {
        font-size: 1.125rem;
    }

    .budget-display.sticky .budget-info {
        font-size: 0.625rem;
    }

    .footer {
        padding: 1.5rem 0.75rem 1rem 0.75rem;
    }

    .footer-heading {
        font-size: 1.125rem;
    }

    .footer-description,
    .footer-features p {
        font-size: 0.813rem;
        line-height: 1.6;
    }

    .receipt-sidebar {
        max-height: 60vh;
    }

    .receipt-sidebar.expanded {
        max-height: 85vh;
    }

    .receipt-card {
        padding: 1rem;
    }

    .receipt-header h2 {
        font-size: 1.125rem;
    }
}

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

/* Focus Styles */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

