/* Product Grid */
.products-header {
    margin-bottom: 2rem;
}

.products-header h2 {
    color: #4DB8E8;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.categories-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-badge {
    background: linear-gradient(135deg, #E3F5FC, #D0EDF8);
    color: #4DB8E8;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-badge:hover {
    border-color: #4DB8E8;
    transform: translateY(-2px);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(77, 184, 232, 0.15);
    transition: all 0.3s ease;
    border: 3px solid #E3F5FC;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(77, 184, 232, 0.25);
    border-color: #4DB8E8;
}

.product-card.border-warning {
    border-color: #ff9800;
    border-width: 3px;
}

.card-header {
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.2rem;
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 3;
}

.stock-unlimited {
    color: #2ECC71;
}

.stock-available {
    color: #2ECC71;
}

.stock-low {
    color: #F39C12;
    animation: pulse 2s infinite;
}

.stock-out {
    color: #E74C3C;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Product Info */
.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 0.3rem;
    min-height: 2.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kashrut-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #F0F8FF, #E6F3FF);
    border: 2px solid #4169E1;
    color: #4169E1;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    width: fit-content;
    min-height: 24px;
}

.kashrut-placeholder {
    min-height: 24px;
    margin-bottom: 0.5rem;
}

.product-price {
    color: #4DB8E8;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    margin-top: auto;
    text-align: center;
}

.cart-controls-wrapper {
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

/* Add to Cart Controls */
.cart-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: #F8F9FA;
    border-radius: 25px;
    padding: 0.4rem;
    border: 2px solid #E3F5FC;
    justify-content: center;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 700;
    color: #4DB8E8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.quantity-btn:hover:not(:disabled) {
    background: #4DB8E8;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(77, 184, 232, 0.3);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2C3E50;
}

.add-to-cart-btn {
    flex: 1;
    background: linear-gradient(135deg, #4DB8E8, #3A9FD5);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(77, 184, 232, 0.4);
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Admin Preview Warning */
.admin-preview-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 3px solid #ff9800;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.2);
}

.admin-preview-warning h4 {
    color: #856404;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.admin-preview-warning p {
    color: #856404;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.admin-preview-warning strong {
    color: #ff9800;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #2ECC71, #27AE60);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.4s ease, slideOut 0.4s ease 2.6s;
    opacity: 0;
}

.notification-toast.show {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

/* Empty State */
.empty-products {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #E3F5FC, #D0EDF8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #4DB8E8;
}

.empty-products h3 {
    font-size: 1.8rem;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.empty-products p {
    color: #999;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Login Required Message */
.login-required {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #E3F5FC, #D0EDF8);
    border-radius: 20px;
    margin: 2rem 0;
}

.login-required-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #4DB8E8;
    box-shadow: 0 5px 20px rgba(77, 184, 232, 0.2);
}

.login-required h3 {
    font-size: 2rem;
    color: #2C3E50;
    margin-bottom: 1rem;
}

.login-required p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.login-btn {
    display: inline-block;
    background: linear-gradient(135deg, #4DB8E8, #3A9FD5);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(77, 184, 232, 0.3);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(77, 184, 232, 0.4);
    color: white;
}

/* Shopping Summary Sidebar */
.products-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
}

.shopping-summary {
    position: sticky;
    top: 20px;
    width: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(77, 184, 232, 0.15);
    padding: 1.5rem;
    border: 2px solid #E3F5FC;
    flex-shrink: 0;
}

.shopping-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #E3F5FC;
}

.shopping-summary-header h3 {
    color: #4DB8E8;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-item {
    margin-bottom: 1rem;
}

.summary-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.summary-value {
    color: #2C3E50;
    font-size: 1.2rem;
    font-weight: 700;
}

.summary-value.highlight {
    color: #4DB8E8;
    font-size: 1.4rem;
}

.summary-value.warning {
    color: #F39C12;
}

.summary-value.danger {
    color: #E74C3C;
}

.progress-bar-container {
    margin: 1rem 0;
    background: #F0F0F0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4DB8E8, #3A9FD5);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar.warning {
    background: linear-gradient(90deg, #F39C12, #E67E22);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #E74C3C, #C0392B);
}

.cart-items-preview {
    max-height: 200px;
    overflow-y: auto;
    margin: 1rem 0;
    padding: 0.5rem 0;
}

.cart-item-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #F8F9FA;
    border-radius: 8px;
}

.cart-item-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

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

.cart-item-preview-name {
    font-size: 0.85rem;
    color: #2C3E50;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-preview-details {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
}

.summary-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.summary-btn {
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.summary-btn-primary {
    background: linear-gradient(135deg, #4DB8E8, #3A9FD5);
    color: white;
}

.summary-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(77, 184, 232, 0.4);
    color: white;
}

.summary-btn-secondary {
    background: #F8F9FA;
    color: #4DB8E8;
    border: 2px solid #E3F5FC;
}

.summary-btn-secondary:hover {
    background: #E3F5FC;
    color: #3A9FD5;
}

.summary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.empty-cart-summary {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

.empty-cart-summary i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #E3F5FC;
}

.category-badge.active {
    background: linear-gradient(135deg, #4DB8E8, #3A9FD5);
    color: white;
    border-color: #4DB8E8;
    box-shadow: 0 3px 10px rgba(77, 184, 232, 0.3);
}

/* Event Countdown Banner */
.event-countdown-banner {
    background: linear-gradient(135deg, #E3F5FC 0%, #F8FCFF 100%);
    border: 2px solid #4DB8E8;
    border-radius: 15px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 15px rgba(77, 184, 232, 0.15);
}

.countdown-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
}

.countdown-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4DB8E8, #3A9FD5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(77, 184, 232, 0.3);
    flex-shrink: 0;
}

.countdown-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.countdown-label {
    color: #4DB8E8;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.countdown-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    min-width: 65px;
    box-shadow: 0 2px 8px rgba(77, 184, 232, 0.1);
    border: 2px solid #E3F5FC;
}

.time-value {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2C3E50;
    line-height: 1;
}

.time-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    margin-top: 0.3rem;
}

.time-separator {
    color: #4DB8E8;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0.2rem;
}

.quantity-btn.disabled {
    cursor: not-allowed;
}

.empty-cart-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
}

.empty-cart-preview i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #E3F5FC;
}

.empty-cart-preview p {
    margin: 0;
    color: #999;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Keep products and summary side-by-side on all screens */
/* Mobile: Make summary narrower and more compact */
@media (max-width: 768px) {
    .products-container {
        gap: 0.8rem; /* Reduce gap on mobile */
    }

    .products-grid {
        grid-template-columns: 1fr;
        flex: 1; /* Take available space */
    }

    .shopping-summary {
        width: 180px; /* Even narrower on mobile to fit buttons */
        padding: 0.6rem;
        position: sticky;
        top: 250px; /* Adjust this based on your header height */
        max-height: calc(100vh - 90px); /* Viewport height minus top offset */
        overflow-y: auto; /* Allow scrolling if content is too tall */
        display: flex;
        flex-direction: column;
    }

    .shopping-summary-header {
        padding: 0.5rem;
        margin-bottom: 0.8rem;
        flex-shrink: 0; /* Don't shrink header */
    }

    .shopping-summary-header h3 {
        font-size: 0.9rem;
    }

    .shopping-summary-header h3 i {
        font-size: 0.8rem;
    }

    /* Compact mobile styles */
    .cart-items-preview {
        max-height: none; /* Remove max-height to prevent cut-off */
        font-size: 0.8rem;
        flex-shrink: 1; /* Allow preview to shrink */
        min-height: 0; /* Allow it to be small if needed */
    }

    .cart-item-preview {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
        gap: 0.4rem;
    }

    .cart-item-preview img {
        width: 30px;
        height: 30px;
    }

    .cart-item-preview-name {
        font-size: 0.7rem;
    }

    .cart-item-preview-details {
        font-size: 0.6rem;
    }

    .summary-item {
        margin-bottom: 0.4rem;
    }

    .summary-label {
        font-size: 0.7rem;
    }

    .summary-label i {
        font-size: 0.65rem;
    }

    .summary-value {
        font-size: 0.85rem;
    }

    .summary-value.highlight {
        font-size: 1rem;
    }

    .summary-actions {
        flex-direction: column;
        gap: 0.4rem;
        margin-top: 0.8rem;
        flex-shrink: 0; /* Don't shrink buttons */
    }

    .summary-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }

    .summary-btn i {
        font-size: 0.75rem;
    }

    /* Fix product card buttons being cut off */
    .product-card {
        min-width: 0; /* Allow cards to shrink */
    }

    .quantity-selector {
        padding: 0.3rem;
        width: 100%;
        justify-content: space-between;
    }

    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        flex-shrink: 0; /* Don't shrink buttons */
    }

    .quantity-input {
        width: 40px;
        font-size: 1.1rem;
    }

    .product-image-container {
        height: 150px; /* Slightly shorter images on mobile */
    }

    .product-name {
        font-size: 1rem;
        min-height: 2rem;
    }

    .product-description {
        font-size: 0.8rem;
        min-height: 2rem;
    }

    .product-price {
        font-size: 1.3rem;
    }
}

    /* Countdown adjustments */
    .countdown-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .countdown-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .countdown-timer {
        gap: 0.3rem;
    }
    
    .time-unit {
        min-width: 55px;
        padding: 0.5rem 0.6rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .time-separator {
        font-size: 1.2rem;
    }

    .empty-cart-preview {
        padding: 1rem;
    }

    .empty-cart-preview i {
        font-size: 1.5rem;
    }

    .empty-cart-preview p {
        font-size: 0.85rem;
    }
}

/* Extra small screens - stack buttons vertically */
@media (max-width: 480px) {
    .summary-actions {
        flex-direction: column;
    }

    .summary-btn {
        width: 100%;
    }
}