/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent layout shifts and improve rendering performance */
html {
    scroll-behavior: smooth;
    /* Prevent horizontal scrolling at root level */
    overflow-x: hidden;
    width: 100%;
}

/* Add CSS containment for better performance during updates */
.product-item, .cart-item {
    contain: layout style;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #003366;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    max-width: 100vw;
}

/* Remove animated background gradient keyframes - no longer needed */
/* Circuit board pattern overlay - simplified */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 85, 153, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 85, 153, 0.05) 0%, transparent 50%);
    background-size: 100px 100px, 150px 150px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #003366;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 85, 153, 0.3);
    border: 1px solid #005599;
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Header */
header {
    background: #003366;
    color: #ffffff;
    padding: 1.5rem;
    border-bottom: 2px solid #005599;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

header h1 {
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 0.5rem;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #005599;
    border: 1px solid #005599;
    font-weight: 500;
}

nav a:hover {
    background: #3399cc;
    transform: translateY(-1px);
}

/* POS Layout */
.pos-layout {
    display: flex;
    min-height: calc(100vh - 120px);
    width: 100%;
    overflow: hidden; /* Prevent layout overflow */
    flex-wrap: wrap;
}

.product-section {
    flex: 2;
    padding: 2rem;
    border-right: 2px solid #005599;
    background: #003366;
    min-width: 0; /* Allow flex item to shrink */
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    box-sizing: border-box;
}

.cart-section {
    flex: 1;
    padding: 2rem;
    background: #003366;
    min-width: 0; /* Allow flex item to shrink */
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    box-sizing: border-box;
}

/* Search Box */
.search-box {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

#product-search {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #005599;
    border-radius: 6px;
    font-size: 16px;
    background: #003366;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

#product-search::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#product-search:focus {
    outline: none;
    border-color: #3399cc;
    background: #003366;
}

#search-btn {
    padding: 12px 24px;
    background: #005599;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: #3399cc;
    transform: translateY(-1px);
}

/* Product List */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    /* Prevent layout shifts during updates */
    contain: layout style;
    min-height: 200px; /* Maintain minimum height to prevent jumps */
    will-change: contents; /* Optimize for dynamic content changes */
}

.product-item {
    border: 2px solid #005599;
    border-radius: 8px;
    padding: 1.5rem;
    background: #003366;
    transition: all 0.3s ease;
}

.product-item:hover {
    border-color: #3399cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 85, 153, 0.3);
}

.product-info {
    margin-bottom: 1rem;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.product-code {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: #3399cc;
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #005599;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #3399cc;
    transform: translateY(-1px);
}

.add-to-cart-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
}

/* Cart Styles */
.cart-section h2 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
}

.cart-items {
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
    /* Prevent layout shifts during updates */
    contain: layout style;
    will-change: contents; /* Optimize for dynamic content changes */
    /* Smooth scrolling for better UX */
    scroll-behavior: smooth;
}

.cart-items::-webkit-scrollbar {
    width: 8px;
}

.cart-items::-webkit-scrollbar-track {
    background: rgba(0, 85, 153, 0.2);
    border-radius: 4px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #005599;
    border-radius: 4px;
}

.cart-item {
    background: #003366;
    border: 1px solid #005599;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: #3399cc;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.item-price {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input {
    width: 60px;
    padding: 6px;
    border: 1px solid #005599;
    border-radius: 4px;
    text-align: center;
    background: #003366;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.quantity-input:focus {
    outline: none;
    border-color: #3399cc;
}

.remove-item {
    padding: 6px 12px;
    background: #ff4757;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background: #e74c3c;
    transform: translateY(-1px);
}

.item-subtotal {
    font-weight: 700;
    color: #3399cc;
    text-align: right;
}

.cart-total {
    background: #005599;
    color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    border: 2px solid #005599;
}

.total-label {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Checkout Section */
.checkout-section {
    margin-bottom: 2rem;
}

.payment-input {
    margin-bottom: 1rem;
}

.payment-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #ffffff;
}

#payment-amount {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #005599;
    border-radius: 6px;
    font-size: 16px;
    background: #003366;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

#payment-amount:focus {
    outline: none;
    border-color: #3399cc;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: #ff4757;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkout-btn:hover {
    background: #e74c3c;
    transform: translateY(-1px);
}

.checkout-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group .checkout-btn {
    flex: 1;
    min-width: 120px;
}

/* Test Print Button */
.test-print-btn {
    padding: 16px 20px;
    background: #28a745;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.test-print-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Test Connectivity Button */
.test-connectivity-btn {
    padding: 8px 12px;
    background: #17a2b8;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.test-connectivity-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Change Display */
.change-display {
    background: #3399cc;
    color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #3399cc;
}

.change-display h3 {
    margin-bottom: 1rem;
    font-size: 28px;
    font-weight: 700;
}

#new-sale-btn {
    padding: 12px 24px;
    background: #003366;
    color: #ffffff;
    border: 2px solid #005599;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#new-sale-btn:hover {
    background: #005599;
    transform: translateY(-1px);
}

/* Admin Styles */
.admin-section {
    padding: 2rem;
}

.admin-section h2,
.admin-section h3 {
    margin-bottom: 1rem;
}

.admin-form {
    background: #003366;
    border: 2px solid #005599;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #005599;
    border-radius: 6px;
    font-size: 14px;
    background: #003366;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3399cc;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-primary {
    background: #005599;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: #3399cc;
    transform: translateY(-1px);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: #003366;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #005599;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #005599;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
}

.data-table th {
    background: #005599;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: rgba(0, 85, 153, 0.1);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    padding: 6px 12px;
    background: #3399cc;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: #005599;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .pos-layout {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: auto;
    }
    
    .product-section {
        border-right: none;
        border-bottom: 2px solid #005599;
        padding: 1rem;
        flex: none;
        width: 100%;
    }
    
    .cart-section {
        padding: 1rem;
        flex: none;
        width: 100%;
    }
    
    .product-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    nav {
        flex-wrap: wrap;
    }

    nav a {
        margin-bottom: 0.5rem;
        padding: 0.6rem 1rem;
        font-size: 14px;
    }
    
    /* Touch-friendly buttons */
    .add-to-cart-btn {
        padding: 14px;
        font-size: 14px;
        min-height: 44px; /* iOS recommendation for touch targets */
    }
    
    .checkout-btn, .test-print-btn, .test-connectivity-btn {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Better mobile input handling */
    #product-search, #payment-amount, .quantity-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #search-btn {
        padding: 14px 24px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Cart items mobile optimization */
    .cart-items {
        max-height: none; /* Remove height restriction on mobile */
        overflow-y: visible;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: left;
    }
    
    .item-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .quantity-input {
        width: 80px;
        flex-shrink: 0;
    }
    
    .remove-item {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    /* Payment section mobile */
    .checkout-section {
        margin-top: 1rem;
    }
    
    .payment-input {
        margin-bottom: 1rem;
    }
    
    .button-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Status indicators mobile positioning */
    #connection-status {
        font-size: 14px;
        padding: 8px;
        /* Ensure proper stacking on mobile */
        top: 0;
    }
    
    #connection-status.show {
        transform: translateY(0);
    }
    
    /* When update banner is shown on mobile, adjust connection status */
    body.has-update-banner #connection-status {
        top: 42px; /* Smaller mobile banner height */
    }

    #sync-status {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 12px;
    }

    #install-button {
        bottom: 10px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    #update-banner {
        font-size: 14px;
        padding: 8px;
    }
    
    /* Adjust container margin for mobile status bars */
    body.has-connection-status .container,
    body.has-update-banner .container {
        margin-top: 42px; /* Smaller mobile status bar */
    }

    body.has-update-banner.has-connection-status .container {
        margin-top: 84px; /* Both mobile banners visible */
    }
}

/* Medium screens (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .pos-layout {
        flex-direction: row;
    }
    
    .product-section {
        padding: 1.5rem;
    }
    
    .cart-section {
        padding: 1.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        margin: 0;
        border: none;
        box-shadow: none;
        /* Ensure no horizontal overflow on small screens */
        padding: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .product-section, .cart-section {
        padding: 0.75rem;
    }
    
    .product-item {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    nav a {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
    
    /* Prevent any text overflow issues */
    .product-name, .item-name {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Ensure buttons don't cause horizontal overflow */
    .add-to-cart-btn, .checkout-btn, .test-print-btn {
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Additional mobile-specific fixes for scroll issues */
@media (max-width: 768px) {
    /* Prevent rubber band scrolling on iOS */
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    /* Prevent zoom on double tap */
    .product-item, .cart-item, button, input {
        touch-action: manipulation;
    }
    
    /* Prevent horizontal scrolling in any child elements */
    .pos-layout, .product-section, .cart-section, .product-list, .cart-items {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
}

/* Messages */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.message.success {
    background: #3399cc;
    color: #ffffff;
    border: 1px solid #3399cc;
}

.message.error {
    background: #ff4757;
    color: #ffffff;
    border: 1px solid #ff4757;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state h3 {
    margin-bottom: 1rem;
    font-size: 24px;
    color: #ffffff;
    font-weight: 700;
}

.empty-cart {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-family: 'Montserrat', sans-serif;
}

/* PWA Specific Styles */
/* PWA Specific Styles */
#connection-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    z-index: 10000;
    transition: transform 0.3s ease;
    background: #005599;
    color: #ffffff;
    transform: translateY(-100%); /* Hidden by default */
}

/* Connectivity Icon Styles */
#connectivity-icon {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 9998;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    user-select: none;
}

#connectivity-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#connectivity-icon:active {
    transform: scale(0.95);
}

/* Ensure connectivity icon doesn't interfere with header on mobile */
@media (max-width: 768px) {
    #connectivity-icon {
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    /* Adjust header to account for connectivity icon */
    header {
        padding-left: 60px; /* Make room for the icon */
    }
}

@media (max-width: 480px) {
    #connectivity-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    header {
        padding-left: 55px;
    }
}

#connection-status.show {
    transform: translateY(0); /* Show when needed */
}

/* When update banner is shown, push connection status down */
#update-banner.show ~ #connection-status,
body.has-update-banner #connection-status {
    top: 50px; /* Adjust based on update banner height */
}

#sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    z-index: 9999;
    transition: opacity 0.3s ease;
    max-width: 300px;
    background: #003366;
    border: 1px solid #005599;
}

#install-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    background: #3399cc;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#install-button:hover {
    background: #005599;
    transform: translateY(-1px);
}

#update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #005599;
    color: #ffffff;
    padding: 10px;
    text-align: center;
    z-index: 10001; /* Highest priority */
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transform: translateY(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
}

#update-banner.show {
    transform: translateY(0); /* Show when needed */
}

/* Adjust main content when status bars are visible */
body.has-connection-status .container,
body.has-update-banner .container {
    margin-top: 50px; /* Adjust based on status bar height */
}

body.has-update-banner.has-connection-status .container {
    margin-top: 100px; /* Both banners visible */
}

.offline-indicator {
    background: #ff4757;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    margin-left: 10px;
}

.sync-indicator {
    background: #005599;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 50%;
    font-size: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #005599;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Offline mode adjustments */
.offline-mode {
    filter: grayscale(20%);
}

.offline-mode .add-to-cart-btn,
.offline-mode .checkout-btn {
    background: rgba(255, 255, 255, 0.1);
    position: relative;
}

.offline-mode .add-to-cart-btn::after,
.offline-mode .checkout-btn::after {
    content: '📱';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
}

/* PWA install prompt */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #003366;
    color: #ffffff;
    padding: 15px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top: 2px solid #005599;
}

.install-prompt.show {
    transform: translateY(0);
}

.install-prompt button {
    background: #005599;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.install-prompt button:hover {
    background: #3399cc;
    transform: translateY(-1px);
}

/* Footer Styles */
.app-footer {
    background: #003366;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 2px solid #005599;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.app-footer .version-info {
    color: #ffffff;
    font-weight: 600;
}

.app-footer .copyright {
    margin: 0;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .app-footer {
        padding: 0.75rem;
        font-size: 13px;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .app-footer {
        padding: 0.5rem;
        font-size: 12px;
    }
}