/* Clean Modern IGEFA Product Catalog */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    /* Clean Light Color Palette with Brand Colors */
    --primary: #B1D600;
    --primary-hover: #9BC100;
    --secondary: #64748b;
    --success: #B1D600;
    --warning: #d97706;
    
    /* Light Theme Colors */
    --bg: #ffffff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Simple Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    
    /* Simple Border Radius */
    --radius: 8px;
    --radius-lg: 12px;
    
    /* Simple Transitions */
    --transition: 0.15s ease;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-top: 0;
    min-height: 100vh;
}

/* Header Logo */
.header-logo {
    height: 60px;
    width: auto;
    display: block;
}


/* Clean Search Bar */
.form-control {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(177, 214, 0, 0.1);
    color: var(--text);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Simple Buttons */
.btn {
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-outline-primary {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-primary.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-outline-secondary {
    background: var(--bg-light);
    color: var(--secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-success:hover {
    background: var(--primary-hover);
}

/* Clean Product Cards */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-image-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}

.product-image {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.no-image {
    color: var(--text-muted);
    font-size: 3rem;
    opacity: 0.4;
}

.product-info {
    padding: 1rem;
}

.product-code {
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-name {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.product-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    display: inline-block;
}




/* List View */
.list-view .product-card {
    display: flex;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.list-view .product-image-container {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    margin-right: 1.5rem;
    border: none;
    border-right: 1px solid var(--border-light);
}

.list-view .product-info {
    flex-grow: 1;
    padding: 0;
}

.list-view .product-name,
.list-view .product-description {
    height: auto;
}


/* Search Highlight */
.highlight {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0 0.25rem;
    border-radius: 3px;
    font-weight: 500;
}



/* Modal */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text);
}

.modal-title {
    font-weight: 600;
}

/* Simple Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Spinner */
#loadingSpinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.25em;
    border-color: var(--primary);
    border-right-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-logo {
        height: 45px;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    
    .list-view .product-card {
        flex-direction: column;
    }
    
    .list-view .product-image-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
}

@media (max-width: 576px) {
    .product-info {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Alert */
.alert {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.alert-info {
    background-color: #f7fee7;
    border-color: #B1D600;
    color: #365314;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* Override Bootstrap default focus colors */
*:focus,
*:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

.btn:focus,
.btn:focus-visible,
.form-control:focus,
.form-control:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Override Bootstrap outline button focus states */
.btn-outline-primary:focus,
.btn-outline-secondary:focus {
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Custom danger button for remove from cart */
.btn-outline-danger {
    background: var(--bg-light);
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-outline-danger:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}


/* Override Bootstrap's default active/pressed button states */
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary:focus:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary:focus:active {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: white !important;
}

/* Ensure no blue anywhere */
.btn:active,
.btn:focus,
.btn.active,
.btn.focus,
.btn:hover {
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Override specific button hover states */
.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

.btn-outline-secondary:hover {
    background: var(--secondary) !important;
    color: white !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25) !important;
}

/* Remove any Bootstrap default focus/hover shadows */
.btn:not(:disabled):not(.disabled):active:focus,
.btn:not(:disabled):not(.disabled).active:focus,
.show > .btn.dropdown-toggle:focus,
.btn:focus,
.btn.focus,
.btn:not([disabled]):not(.disabled):active:focus,
.btn:not([disabled]):not(.disabled).active:focus {
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Comprehensive button hover state overrides to eliminate ALL blue colors */
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.focus {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary.focus {
    background: var(--secondary) !important;
    color: white !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25) !important;
}

/* Force override any Bootstrap default button states */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary.focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Override any potential Bootstrap button-group states */
.btn-group .btn:hover,
.btn-group .btn:focus,
.btn-group .btn:active,
.btn-group .btn.active {
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}


/* Override any lingering Bootstrap focus-visible states */
.btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Force override Bootstrap's default outline on focus */
*:focus,
*:focus-visible,
.form-control:focus,
.btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Shopping Cart Styles */
.product-actions {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.quantity-controls {
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.quantity-controls input[type="number"] {
    min-width: 60px;
    max-width: 60px;
    text-align: center;
    height: 32px;
}

.quantity-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.quantity-controls input[type="number"]::-webkit-outer-spin-button,
.quantity-controls input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-controls input[type="number"] {
    -moz-appearance: textfield;
}

/* Cart Badge */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Cart Modal */
.cart-item {
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-image i {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.cart-item-info h6 {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.cart-item-controls {
    min-width: 200px;
    text-align: right;
}

.cart-item-controls .quantity-controls {
    justify-content: flex-end;
}

/* Modal Enhancements */
.modal-xl {
    max-width: 1200px;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.modal-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* Empty Cart State */
.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Responsive Cart Modal */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item-image {
        margin-bottom: 1rem;
    }
    
    .cart-item-controls {
        width: 100%;
        text-align: left;
    }
    
    .cart-item-controls .quantity-controls {
        justify-content: flex-start;
        margin-bottom: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-footer > div {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* Enhanced Button Styles for Cart */
.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: white !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(177, 214, 0, 0.25) !important;
}

/* Cart Counter Animation */
#cartCounter {
    transition: all 0.3s ease;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(-50%, -50%);
    }
    50% {
        transform: scale(1.2) translate(-50%, -50%);
    }
    100% {
        transform: scale(1) translate(-50%, -50%);
    }
}

/* Product Price Styles */
.product-price {
    font-size: 1.1rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.product-price strong {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.2rem;
}

/* Small Product Price Styles */
.product-price-small {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.product-price-small.text-muted {
    color: var(--text-muted) !important;
    font-style: italic;
}

.product-total {
    margin: 0.5rem 0;
    padding: 0.25rem;
    text-align: center;
    background: var(--bg-light);
    border-radius: var(--radius);
}

/* Cart Total Badge */
#cartTotalValue {
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary) !important;
}

/* Price on Request styling */
.product-price.text-muted {
    background: var(--bg-light);
    color: var(--text-muted) !important;
    font-style: italic;
}

/* Cart item price styling */
.cart-item .text-primary {
    color: var(--primary) !important;
    font-weight: 500;
}