/* ===================================
   Frozen Fruits - Clean & Solid Design
   =================================== */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --light-bg: #f8f9fa;
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Header Styling */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Product Card States */
.product-card.out-of-stock {
    opacity: 0.65;
    background-color: #f8f9fa;
}

.product-card.out-of-stock .product-image {
    filter: grayscale(70%);
    opacity: 0.7;
    position: relative;
}

.product-card.out-of-stock .product-image::before {
    content: 'אזל מהמלאי';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(108, 117, 125, 0.95);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.product-card.out-of-stock .product-title,
.product-card.out-of-stock .product-price {
    color: #6c757d;
}

.product-card.out-of-stock .out-of-stock {
    display: none;
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-card.in-cart {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.25);
    background: linear-gradient(to bottom, rgba(13, 110, 253, 0.03), white);
}

.product-card.in-cart:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.35);
}

.product-card.in-cart .product-price {
    color: var(--success-color);
}

.product-card.in-cart .product-image::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--success-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: checkmarkBounce 0.5s ease;
}

@keyframes checkmarkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.product-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.product-image i {
    z-index: 1;
}

.product-body {
    padding: 1rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-stock {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.in-stock {
    background-color: #d1e7dd;
    color: #0f5132;
}

.out-of-stock {
    background-color: #f8d7da;
    color: #842029;
}

/* Product Card Quantity Controls */
.quantity-control-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.quantity-control-card.flex-grow-1 {
    flex: 1;
}

.quantity-control-card .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.quantity-control-card .btn:hover {
    transform: scale(1.15);
}

.quantity-value-card {
    min-width: 45px;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.product-actions .btn-outline-danger {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.product-actions .btn-outline-danger:hover {
    transform: scale(1.15);
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Cart Badge */
#cartCount {
    position: absolute;
    top: -8px;
    left: -8px;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#cartBtn {
    position: relative;
}

/* Cart Info Inline */
.cart-total-inline {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    background: rgba(13, 110, 253, 0.08);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

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

.free-shipping-inline {
    padding: 0.35rem 0.75rem;
    background: var(--success-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    animation: pulse 1.5s ease infinite, slideInRight 0.3s ease;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

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

.free-shipping-inline i {
    font-size: 0.8rem;
}

/* Responsive Cart Info */
@media (max-width: 768px) {
    .cart-total-inline {
        font-size: 0.95rem;
        padding: 0.3rem 0.6rem;
    }
    
    .free-shipping-inline {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

.scale-animation {
    animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    margin-left: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.cart-total {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.cart-total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

/* Form Styling */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Toast Notifications */
.toast {
    min-width: 300px;
}

.toast.toast-success {
    background-color: var(--success-color);
    color: white;
}

.toast.toast-warning {
    background-color: #ffc107;
    color: #000;
}

.toast.toast-error {
    background-color: #dc3545;
    color: white;
}

.toast.toast-info {
    background-color: var(--primary-color);
    color: white;
}

#toastIcon {
    font-size: 1.2rem;
}

/* Cart Improvements */
.cart-item {
    transition: background-color 0.2s;
    animation: slideIn 0.3s ease;
}

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

.cart-item:hover {
    background-color: #f8f9fa;
}

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

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.quantity-control .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.quantity-control .btn:hover {
    transform: scale(1.1);
}

.quantity-value {
    min-width: 35px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
}

.cart-delete-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cart-delete-btn:hover {
    transform: scale(1.15);
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.cart-total {
    background-color: var(--light-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.cart-total-amount {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-item-count {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}
