/* View Cart Button Styles */
.view-cart-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
}

.view-cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e74c3c;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.view-cart-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    color: white;
    text-decoration: none;
}

.cart-icon {
    font-size: 18px;
}

.cart-count-badge {
    background: white;
    color: #e74c3c;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
}

/* Animation for view cart button */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.view-cart-container.show {
    animation: bounceIn 0.5s ease-out;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .view-cart-container {
        bottom: 15px;
        right: 15px;
    }
    
    .view-cart-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Keep all your existing CSS styles here */
.crackers-display-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Search Container Styles */
.search-container {
    position: relative;
    margin-bottom: 30px;
    max-width: 400px;
}

.product-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
}

.product-search-input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    pointer-events: none;
}

.search-results-count {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.products-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 150px;
    gap: 15px;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
}

.product-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-row.updating {
    opacity: 0.7;
}

.product-row.updated {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.product-price {
    text-align: right;
}

.regular-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.sale-price,
.current-price {
    color: #e74c3c;
    font-weight: bold;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.qty-input {
    width: 60px;
    height: 35px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
}

.qty-input:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

/* Hide arrows from quantity input */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input {
    -moz-appearance: textfield;
}

.out-of-stock {
    color: #dc3545;
    font-weight: bold;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .product-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .product-row {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    
    .product-image {
        grid-row: 1 / 3;
    }
    
    .product-name {
        grid-column: 2;
        grid-row: 1;
    }
    
    .product-price {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }
    
    .product-cart {
        grid-column: 1 / 3;
        grid-row: 3;
        justify-self: center;
    }
}

/* Search highlight effect */
@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

.product-row.search-highlight {
    animation: highlight 1s ease-out;
}

/* Clear button for search */
.search-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #f0f0f0;
    color: #333;
}

/* Show clear button when there's text */
.product-search-input:not(:placeholder-shown) + .search-icon + .search-clear {
    display: block;
}

/* Success message styles */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1001;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Enhanced updating state */
.product-row.updating {
    opacity: 0.6;
    pointer-events: none;
}

.product-row.updating .quantity-controls {
    position: relative;
}

.product-row.updating .quantity-controls::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}