/* Hide number input spinners (arrows) for better ui */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* Color Variables */
:root {
    --teal-color: #2FA3A1;
    --teal-hover: #258a88;
}

input:focus {
  outline: none;
}


/* Teal Button Styling */
.btn-teal {
    background-color: var(--teal-color);
    color: white;
    border: none;
}

.btn-teal:hover {
    background-color: var(--teal-hover);
    color: white;
}

#searchInput {
    border: 2px solid var(--teal-color);
    transition: border-color 0.3s;
}

.search-container {
    width: 400px;
}

/* Product Card Styling */
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.product-card.selected {
    border: 2px solid var(--teal-color);
    box-shadow: 0 0 0 2px rgba(47, 163, 161, 0.2);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 15px;
    background: white;
}

.product-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.product-stock {
    font-size: 12px;
    margin-bottom: 10px;
}

.stock-available {
    color: #28a745;
}

.stock-out {
    color: #dc3545;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--teal-color);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-input button {
    background: var(--teal-color);
    color: white;
    border: none;
    flex: 1;
    height: 35px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: bold;
}

.quantity-input button:hover {
    background: var(--teal-hover);
}

.quantity-input input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    height: 30px;
}

.add-to-cart-btn {
    padding: 5px 15px;
    font-size: 13px;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh; /* ← CRITICAL: Full viewport height */
    background-color: white;
    border-left: 1px solid #dee2e6;
    overflow-y: auto; /* ← CRITICAL: Allow scrolling */
    z-index: 1040;
    transition: transform 0.3s ease;
}

.cart-sidebar.open {
    right: 0;
    transform: translateX(0);
    background-color: #ffffff;
}

.cart-content {
    background-color: #ffffff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-footer {
    position: sticky;
}

/* Cart Item Card */
.cart-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 5px;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--teal-color);
}

.cart-item-quantity {
    font-size: 12px;
    color: #666;
}

/* Cart Overlay (Mobile) */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1035;
}

.cart-overlay.show {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .cart-footer{
        bottom: 10vh;
    }
    .cart-sidebar {
        width: 85%;
        max-width: 400px;
        right: -100%;
    }
    .search-container {
        order: 3; /* Move to bottom */
        flex: 1 1 100%;
        margin: 0.75rem 0 0 0 !important;
        max-width: 100%;
    }
    .clear-cart{
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }
    .trash-icon{
        font-size: 20px;
    }
    .search-container .input-group {
        width: 100%;
    }
    .cart-sidebar.open {
        right: 0;
    }
    
    /* Hide cart on desktop breakpoint */
    /* .cart-overlay {
        display: none;
    }
    
    .cart-overlay.show {
        display: block;
    } */
    
    /* Products take full width */
    #productsSection {
        width: 100%;
    }
    .navbar .container-fluid {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    
    /* Make brand text smaller on mobile */
    .brand-text {
        font-size: 14px !important;
    }
    
    .brand-text .mb-1 {
        font-size: 16px !important;
        line-height: 1.2;
    }
    
    .brand-text small {
        font-size: 12px !important;
    }
    /* Cart button */
    #cartToggleBtn {
        padding: 0.5rem 0.75rem;
        font-size: 1.1rem;
    }
    
    /* Language selector */
    .form-select {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
}

@media (max-width: 768px) {
    /* Smaller search bar on tablets */
    .search-container,
    .ms-auto[style*="width"] {
        width: 200px !important;
    }
    
    /* Stack navigation items */
    .navbar-brand {
        font-size: 14px;
    }
    
    .logo-circle {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    /* Product cards 2 per row on mobile */
    .row-cols-1 {
        --bs-gutter-x: 0.5rem;
    }
    
    /* Smaller product images */
    .product-image {
        height: 150px;
    }
}

@media (max-width: 576px) {
    /* Hide language selector on small phones */
    .form-select {
        display: none;
    }
    
    /* Search bar even smaller */
    .search-container,
    .ms-auto[style*="width"] {
        width: 150px !important;
    }
    
    /* Smaller fonts */
    .product-title {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    /* Full width cart on very small screens */
    .cart-sidebar {
        max-width: 100%;
    }
}
@media (min-width: 992px) {
    .cart-sidebar {
        position: sticky;
        right: 0 !important;
        top: 70px;
        height: calc(100vh - 70px);
        transition: none;
    }
    
    .cart-overlay {
        display: none !important;
    }
    
    /* Hide mobile cart toggle on desktop */
    #cartToggleBtn {
        display: none;
    }
}
/* Scrollbar Styling */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--teal-color);
    border-radius: 3px;
}

/* Product Modal Styles */
.modal-content {
    border-radius: 10px;
}

#modalProductImage {
    max-height: 400px;
    object-fit: contain;
}

#modalProductDetails td {
    padding: 8px;
    font-size: 0.9rem;
}

#modalProductDetails td:first-child {
    font-weight: 600;
    background-color: #f8f9fa;
    width: 40%;
}
/* Sales Agent Link Hover Effect */
.brand-text:hover {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.brand-text:hover .bi-info-circle {
    color: #2FA3A1 !important;
}