/* Modern Product Catalog Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 10px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Custom Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

/* Product Card Styles */
.product-card {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.product-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.badge-sale {
    background-color: var(--danger-color);
}

.badge-stock {
    background-color: var(--success-color);
}

.badge-out-of-stock {
    background-color: var(--secondary-color);
}

.product-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100% - 250px);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: -webkit-box;
    --webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    --webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.price-container {
    margin-bottom: 1rem;
}

.price-regular {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-sale {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger-color);
}

.price-original {
    font-size: 1rem;
    text-decoration: line-through;
    color: var(--secondary-color);
    margin-left: 0.5rem;
}

.price-savings {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

/* Price Range Filter Styles */
.price-range-container {
    position: relative;
    height: 20px;
}

.price-range-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.price-range-container input[type="range"]::-webkit-slider-track {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
}

.price-range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.price-range-container input[type="range"]::-moz-range-track {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    border: none;
}

.price-range-container input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    pointer-events: all;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Button Styles */
.btn-order {
    background: linear-gradient(45deg, #25D366, #128C7E);
    border: none;
    color: white;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
}

.btn-order:hover {
    background: linear-gradient(45deg, #128C7E, #25D366);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
    color: white;
}

.btn-order:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.btn-whatsapp {
    background: linear-gradient(45deg, #25D366, #128C7E);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: linear-gradient(45deg, #128C7E, #25D366);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    color: white;
}

/* Quantity Input Styles */
.quantity-input {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-input .form-control {
    border-left: none;
    border-right: none;
    font-weight: 600;
}

.quantity-input .btn {
    border-radius: 0;
    width: 40px;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

#modal-product-image {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Pagination Styles */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Spinner */
.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .product-image-container {
        height: 200px;
    }

    .product-body {
        padding: 1rem;
        height: calc(100% - 200px);
    }

    .modal-dialog {
        margin: 1rem;
    }

    .price-range-container {
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    .product-image-container {
        height: 180px;
    }

    .product-body {
        height: calc(100% - 180px);
    }

    .btn-order {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.floating-cart-btn {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
}

.floating-cart-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

.floating-cart-btn i {
    color: white;
    font-size: 1.5rem;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    border: 2px solid white;
    min-width: 25px;
}

.cart-badge:empty {
    display: none;
}

/* Animation for cart updates */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(-50%);
    }

    40% {
        transform: translateY(-50%) translateY(-10px);
    }

    60% {
        transform: translateY(-50%) translateY(-5px);
    }
}

.floating-cart-btn.animate {
    animation: bounce 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-cart-btn {
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .floating-cart-btn i {
        font-size: 1.3rem;
    }

    .cart-badge {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
}