/* ============================================ */
/* TECHSTORE - CUSTOM CSS                      */
/* Complemento a Bootstrap 5                   */
/* Sin emojis, sin caracteres especiales      */
/* ============================================ */

/* ============================================ */
/* VARIABLES CSS                               */
/* ============================================ */
:root {
    --ts-primary: #0d6efd;
    --ts-primary-dark: #0b5ed7;
    --ts-secondary: #6c757d;
    --ts-success: #198754;
    --ts-danger: #dc3545;
    --ts-warning: #ffc107;
    --ts-light: #f8f9fa;
    --ts-dark: #212529;
    --ts-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --ts-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ============================================ */
/* GENERAL                                     */
/* ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ts-dark);
}

a {
    text-decoration: none;
}

/* ============================================ */
/* UTILITIES                                   */
/* ============================================ */
.min-vh-50 {
    min-height: 50vh;
}

.cursor-pointer {
    cursor: pointer;
}

/* ============================================ */
/* HOVER EFFECTS                               */
/* ============================================ */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ts-shadow-lg) !important;
}

/* ============================================ */
/* PRODUCT CARDS                               */
/* ============================================ */
.product-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ts-shadow-lg) !important;
}

.product-card-image {
    height: 240px;
    object-fit: cover;
    background-color: var(--ts-light);
}

.card-img-top {
    background-color: var(--ts-light);
}

/* ============================================ */
/* CART ITEMS                                  */
/* ============================================ */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

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

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    background-color: var(--ts-light);
}

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

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

.cart-item-price {
    color: var(--ts-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ============================================ */
/* SEARCH SUGGESTIONS                          */
/* ============================================ */
#searchSuggestions {
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
}

#searchSuggestions .list-group-item:hover {
    background-color: var(--ts-light);
}

#searchSuggestions .list-group-item.active {
    background-color: var(--ts-light);
    color: inherit;
    border-color: transparent;
}

#searchSuggestions mark {
    background-color: #fff3cd;
    padding: 0;
}

/* ============================================ */
/* NAVBAR                                      */
/* ============================================ */
.navbar {
    transition: box-shadow 0.2s ease;
}

.navbar.scrolled {
    box-shadow: var(--ts-shadow-lg);
}

/* ============================================ */
/* BADGES                                      */
/* ============================================ */
#cartCount {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* ============================================ */
/* BUTTONS                                     */
/* ============================================ */
.btn {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
}

/* ============================================ */
/* FORMS                                       */
/* ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--ts-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* ============================================ */
/* PAGINATION                                  */
/* ============================================ */
.pagination .page-link {
    color: var(--ts-primary);
}

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

/* ============================================ */
/* TOAST                                       */
/* ============================================ */
.toast {
    min-width: 300px;
}

/* ============================================ */
/* ANIMATIONS                                  */
/* ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================ */
/* LOADING STATES                              */
/* ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================ */
/* FILTERS SIDEBAR                             */
/* ============================================ */
.form-check-input:checked {
    background-color: var(--ts-primary);
    border-color: var(--ts-primary);
}

/* ============================================ */
/* FOOTER                                      */
/* ============================================ */
footer a:hover {
    color: white !important;
}

/* ============================================ */
/* RESPONSIVE                                  */
/* ============================================ */
@media (max-width: 991.98px) {
    .product-card-image {
        height: 200px;
    }
    
    #searchSuggestions {
        max-height: 300px;
    }
}

@media (max-width: 767.98px) {
    .product-card-image {
        height: 180px;
    }
    
    .cart-item {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
        height: 150px;
    }
    
    /* Ocultar sidebar en movil */
    .col-lg-3.mb-4 {
        display: none;
    }
    
    .col-lg-9 {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .product-card-image {
        height: 160px;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* ============================================ */
/* PRINT STYLES                                */
/* ============================================ */
@media print {
    .navbar,
    footer,
    .btn,
    .toast,
    #searchModal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
}
