/* Variables globales */
:root {
    --primary: #FF6B35;
    --secondary: #2EC4B6;
    --dark: #343A40;
    --light-gray: #F8F9FA;
    --medium-gray: #E9ECEF;
    --text-color: #343A40;
    --bg-primary: #FFFFFF;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    background-color: var(--light-gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Clases comunes */
.main-container {
    margin-top: 80px;
    min-height: calc(100vh - 160px);
    flex: 1;
    padding: 2rem 1rem;
}

/* Navbar y búsqueda */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.75rem 0;
    z-index: 1030; /* Asegurar que esté por encima de otros elementos */
}

.navbar .container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary);
    margin: 0;
    padding: 0;
}

.brand-text {
    display: inline-block;
}

.brand-dot {
    color: var(--secondary);
}

.navbar-toggler {
    padding: 0.5rem;
    border: none;
    color: var(--primary);
    order: 1;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-form .input-group {
    background-color: var(--light-gray);
    border-radius: 30px;
    overflow: hidden;
}

.search-form .form-control {
    border: none;
    background: transparent;
    padding: 0.75rem 1.25rem;
}

.search-form .form-control:focus {
    box-shadow: none;
}

.search-form .btn {
    border: none;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
}

/* Responsive navbar */
@media (max-width: 991.98px) {
    .navbar {
        background-color: var(--primary);
        padding: 0;
    }

    .navbar .container {
        flex-wrap: wrap;
        padding: 0rem 1rem;
        gap: 0.5rem;
    }

    .navbar-brand,
    .brand-text,
    .brand-dot {
        display: none !important;
    }

    .navbar-toggler {
        order: 1;
        background-color: rgba(255,255,255,0.9);
        border-radius: 8px;
        color: var(--primary);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    .navbar-toggler:hover {
        background-color: white;
    }

    .search-form {
        flex: 1;
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .search-form .input-group {
        background-color: white;
        border-radius: 8px;
        overflow: hidden; /* Asegurar que los hijos respeten el border-radius */
    }

    .search-form .form-control {
        background-color: white;
        border: none;
        height: 40px;
        border-radius: 8px 0 0 8px; /* Mantener esquinas redondeadas en el input */
    }

    .search-form .btn {
        background-color: white;
        color: var(--primary);
        border: none;
        height: 40px;
        width: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0 8px 8px 0; /* Esquina redondeada del botón en posición derecha */
        transition: none; /* Evitar cambios bruscos en focus/active */
    }

    /* Quitar outline / box-shadow al presionar o enfocar para mantener el radio */
    .search-form .btn:focus,
    .search-form .btn:active {
        box-shadow: none !important;
        outline: none !important;
        background-color: white !important;
    }

    .navbar-collapse {
        order: 3;
        width: 100%;
        background-color: var(--primary);
        margin: 0.5rem -1rem -0.75rem;
        padding: 0.5rem 1rem 1rem;
    }

    .navbar-nav .nav-link {
        color: white !important;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        display: flex;
        align-items: center;
    }

    .navbar-nav .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
    }

    .navbar-nav .nav-link i {
        margin-right: 0.75rem;
        width: 20px;
        text-align: center;
    }

    .notification-bell-mobile {
        position: relative;
        order: 3;
        color: white !important;
        border: none !important;
        background: transparent !important;
        padding: 0.5rem 0.75rem !important;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 0.5rem;
        font-size: 1.3rem;
        cursor: pointer;
        text-decoration: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .notification-bell-mobile:hover {
        color: rgba(255, 255, 255, 0.9) !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px;
    }

    .notification-bell-mobile:focus {
        outline: none !important;
        box-shadow: none !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .notification-bell-mobile .notification-dot {
        position: absolute;
        top: 4px;
        right: 0px;
        width: 8px;
        height: 8px;
        background: #2EC4B6;
        border-radius: 50%;
        box-shadow: none;
        z-index: 10;
    }
}

@media (min-width: 992px) {
    .menu-text {
        margin-left: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        color: var(--dark) !important;
    }

    .navbar-nav .nav-link:hover {
        color: var(--primary) !important;
    }

    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
        display: flex;
        align-items: center;
    }

    .navbar-nav .notification-mobile-trigger .notification-dot {
        display: none !important;
    }
}

/* User Dropdown */
.dropdown {
    position: relative;
    z-index: 1040;
}

.user-dropdown-btn {
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
    cursor: pointer;
    z-index: 1000;
}

.user-dropdown-btn:hover {
    color: var(--primary);
    text-decoration: none;
    background-color: rgba(255, 107, 53, 0.1);
}

.user-dropdown-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
    outline: none;
}

.user-dropdown-btn::after {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: 0.1em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--medium-gray);
    transition: border-color 0.3s ease;
}

.user-dropdown-btn:hover .user-avatar {
    border-color: var(--primary);
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    margin-top: 0.5rem;
    min-width: 200px;
    z-index: 1055; /* Asegurar que esté por encima de otros elementos */
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    margin-right: 0.5rem;
}

.dropdown-divider {
    margin: 0.25rem 0;
    border-color: var(--medium-gray);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .user-dropdown-btn {
        display: none !important;
    }
}

/* Support Modal */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border: none;
    padding: 1.5rem 2rem;
    background-color: var(--light-gray);
    border-radius: 0 0 1rem 1rem;
}

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-label {
    font-weight: 500;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

#supportForm textarea {
    resize: vertical;
    min-height: 120px;
}

#supportForm .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

/* Custom Pimba scrollbar for desktop: white track, orange thumb */
@media (min-width: 769px) {
    /* Firefox */
    html {
        scrollbar-width: thin;
        scrollbar-color: var(--primary) #fff; /* thumb track */
    }

    /* WebKit browsers */
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }
    ::-webkit-scrollbar-track {
        background: #fff;
    }
    ::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 12px;
        border: 3px solid #fff; /* creates padding effect */
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #e6552a;
    }
    ::-webkit-scrollbar-corner {
        background: #fff;
    }
}

/* Loading animation */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Results */
.search-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--medium-gray);
    margin-bottom: 2rem;
}

.search-header h2 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

/* Botones */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #FF5722;
    border-color: #FF5722;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* Focus / Active states use Pimba secondary color instead of default browser blue */
.btn:focus, .btn:active, .btn:focus:active, .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(46,196,182,0.12) !important; /* soft secondary ring */
}

.btn-primary:focus, .btn-primary:active, .btn-primary:focus:active, .btn-primary:focus-visible {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #fff !important;
}

.btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary:focus-visible {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #fff !important;
}

.btn-secondary:focus, .btn-secondary:active, .btn-secondary:focus-visible {
    background-color: #25B0A3 !important;
    border-color: #25B0A3 !important;
    color: #fff !important;
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #25B0A3;
    border-color: #25B0A3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 196, 182, 0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

/* Formularios */
.form-floating {
    margin-bottom: 1.5rem;
}

.form-floating > label {
    padding-left: 1rem;
}

.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    height: auto;
    font-size: 1rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
}

/* Tarjetas de productos */
.product-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.product-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.product-card a:hover {
    text-decoration: none;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.product-card .price {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card .location {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.product-card .condition {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.product-card .card-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    background-color: #f8f9fa;
}

/* Breadcrumb */
.breadcrumb-item a {
    color: var(--dark);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Product details */
.price-badge .h3 {
    color: var(--primary) !important;
}

/* Tarjetas */
.auth-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.auth-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--medium-gray);
}

.auth-body {
    padding: 2rem;
}

/* Filtros */
.filter-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 90px;
    border: none;
}

.filter-card .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.filter-card .form-label {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.filter-card .form-select,
.filter-card .form-control {
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
}

.filter-card .input-group-text {
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
}

.sort-options .form-select {
    min-width: 200px;
    border-radius: 8px;
}

/* Mobile topbar (sort + filter) */
.mobile-topbar {
    background: #fff;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.mobile-topbar .btn-link {
    color: var(--dark);
    font-weight: 600;
}

.mobile-topbar .btn-link i { color: var(--primary); }

/* Mobile sort menu items */
.mobile-sort-menu .dropdown-item {
    border-bottom: 1px solid var(--medium-gray);
    width: 200px;
    text-align: left;
    background: transparent;
    border: none;
}

.mobile-sort-menu .dropdown-item:last-child { border-bottom: none; }

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: var(--medium-gray);
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--medium-gray);
    margin: 0 5px;
    transition: all 0.3s ease;
}

.step.active {
    background-color: var(--primary);
    transform: scale(1.2);
}

/* Notificaciones */
.notification {
    position: fixed;
    /* Use top to avoid conflicting with inline styles that set `top` too. */
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 250px;
    max-width: 420px; /* avoid too wide notifications */
    height: auto; /* let content size the alert */
    max-height: calc(100vh - 40px); /* ensure the toast never fills the viewport */
    overflow: auto; /* allow scrolling if content is large */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    background-color: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    margin-top: auto;
}

.footer h5 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: none;
}

/* Footer email (not part of .footer-links) */
.footer .footer-email {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
/* Add anchor-specific rule to strongly prevent default blue underline across pages */
footer.footer a.footer-email,
footer.footer a.footer-email:visited {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none !important;
}

footer.footer a.footer-email:hover,
footer.footer a.footer-email:focus {
    color: white !important;
    text-decoration: none !important;
}
.footer .footer-email:hover,
.footer .footer-email:focus,
.footer .footer-email:visited {
    color: white;
    text-decoration: none;
}
.footer .footer-email:focus {
    outline: 2px dashed rgba(255,255,255,0.12);
    outline-offset: 2px;
}

.social-icons {
    margin-top: 1rem;
}

.social-icons a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: white;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Paginación */
.pagination .page-link {
    color: var(--primary);
    border-color: var(--medium-gray);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination .page-link:hover {
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
    color: var(--primary);
}

/* Responsive */
@media (max-width: 991.98px) {
    .search-form {
        width: 100%;
        margin: 1rem 0;
    }
    
    .filter-card {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .main-container {
        padding-top: 0.5rem;
    }

    .product-card .card-img-top {
        height: 160px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none; /* allow the toast to expand to available width on small screens */
    }
    
    .auth-body {
        padding: 1.5rem;
    }

    .sort-options .form-select {
        min-width: 160px;
    }
}

/* Responsive filters */
@media (max-width: 991.98px) {
    .filters-sidebar {
        display: none;
    }
    
    .filters-sidebar.show {
        margin-top: -4rem;
        display: block;
    }
    
    #toggle-filters {
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    
    #toggle-filters:hover {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Badge de urgencia para productos */
.urgency-badge {
    z-index: 10;
    animation: pulse-urgency 2s infinite;
}

.urgency-cloud {
    background: linear-gradient(135deg, #FF6B35, #FF8A5C);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid white;
    position: relative;
    max-width: 200px;
    min-width: 120px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    text-align: center;
    justify-content: center;
}

.urgency-cloud::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #FF6B35;
}

.urgency-cloud i {
    font-size: 0.8rem;
    animation: blink 1.5s infinite;
    flex-shrink: 0;
}

.urgency-text {
    flex: 1;
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
}

@keyframes pulse-urgency {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.7;
    }
}

/* Responsive para badge de urgencia */
@media (max-width: 576px) {
    .urgency-cloud {
        font-size: 0.7rem;
        padding: 4px 8px;
        max-width: 160px;
        min-width: 100px;
    }
    
    .urgency-cloud::before {
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-left-width: 6px;
        border-right-width: 6px;
        border-top-width: 6px;
    }
}

/* ========================================
   MODALES Y FILTROS MEJORADOS
   ======================================== */

/* Modal de ordenamiento mejorado */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), #FF8A5C);
    color: white;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-header .modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    background-color: white;
    border-radius: 0 0 20px 20px;
}

/* Botones de opciones de ordenamiento */
.sort-option {
    border: 2px solid var(--medium-gray);
    background-color: white;
    color: var(--text-color);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sort-option:hover {
    border-color: var(--primary);
    background-color: rgba(255, 107, 53, 0.05);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.15);
}

.sort-option:active {
    transform: translateY(0);
}

.sort-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.sort-option:hover::before {
    left: 100%;
}

/* Estilos para modal de filtros móvil */
#filtersModal .modal-body {
    padding: 2rem;
    background-color: white;
    border-radius: 0 0 20px 20px;
    overflow-y: auto;
}

#filtersModal .form-label {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

#filtersModal .form-select,
#filtersModal .form-control {
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    background-color: white;
    transition: all 0.3s ease;
    font-size: 1rem;
}

#filtersModal .form-select:focus,
#filtersModal .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
    background-color: rgba(255, 107, 53, 0.02);
}

#filtersModal .input-group-text {
    background-color: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    border-radius: 12px 0 0 12px;
    font-weight: 600;
    padding: 0.875rem 1rem;
}

#filtersModal .input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

#filtersModal .btn-primary {
    background: linear-gradient(135deg, var(--primary), #FF8A5C);
    border: none;
    border-radius: 15px;
    padding: 1.125rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    margin-top: 1.5rem;
}

#filtersModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

#filtersModal .btn-primary:active {
    transform: translateY(0);
}

#filtersModal .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#filtersModal .btn-primary:hover::before {
    left: 100%;
}

/* Mobile top bar mejorada */
.mobile-topbar {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.mobile-topbar .btn {
    background: none;
    border: none;
    color: var(--dark) !important;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-topbar .btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.mobile-topbar .btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Filtros sidebar - diseño original */

/* Botón de cerrar filtros móvil - diseño original */
#close-filters-mobile {
    color: var(--primary);
}

/* Select de ordenamiento desktop */
.sort-options .form-select {
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background-color: white;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 180px;
}

.sort-options .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

.sort-options .form-select:hover {
    border-color: var(--primary);
    background-color: rgba(255, 107, 53, 0.02);
}

/* Animaciones para sidebar móvil - versión simplificada */
@media (max-width: 991.98px) {
    .filters-sidebar {
        display: none !important; /* Ocultar completamente en móvil */
    }
    
    .filters-sidebar.show {
        display: none !important; /* Asegurar que no se muestre nunca en móvil */
    }
    
    #toggle-filters {
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    
    #toggle-filters:hover {
        opacity: 1;
        transform: scale(1.1);
    }
}

@media (min-width: 992px) {
    /* En desktop, ocultar el modal de filtros */
    #filtersModal {
        display: none !important;
    }
    
    .filters-sidebar {
        display: block;
    }

    /* Toggle desktop: ocultar sidebar cuando tiene clase .collapsed */
    .filters-sidebar.collapsed {
        display: none !important;
    }

    /* Estado visual del botón cuando el sidebar está abierto */
    #toggle-filters[aria-expanded="true"] {
        background: linear-gradient(135deg, #FF6B35 0%, #ff8c5a 100%);
        color: white;
        border-radius: 8px;
        padding: 0.35rem 0.65rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mejoras para modal fullscreen en móvil */
@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down .modal-content {
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-fullscreen-sm-down .modal-header {
        border-radius: 0;
        padding: 2rem 1.5rem 1.5rem;
        flex-shrink: 0;
    }
    
    .modal-fullscreen-sm-down .modal-body {
        border-radius: 0;
        flex: 1;
        overflow-y: auto;
        padding: 1.5rem;
        min-height: 0; /* Importante para evitar overflow */
    }
    
    .modal-fullscreen-sm-down .sort-option {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Estilos específicos para modal de filtros en móvil */
    #filtersModal.modal-fullscreen-sm-down .modal-content {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    #filtersModal.modal-fullscreen-sm-down .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1.5rem;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    #filtersModal.modal-fullscreen-sm-down .vstack {
        flex: 1;
        min-height: 0;
    }
    
    #filtersModal .form-select,
    #filtersModal .form-control {
        padding: 0.65rem;
        font-size: 1rem;
    }
    
    #filtersModal .form-label {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    #filtersModal .btn-primary {
        padding: 1.25rem 2rem;
        font-size: 1.2rem;
        margin-top: 2rem;
        flex-shrink: 0; /* Evitar que el botón se comprima */
    }
}

/* Estilos adicionales para evitar espacios en blanco */
#filtersModal {
    --bs-modal-padding: 0;
}

#filtersModal .modal-dialog {
    margin: 0;
    height: 100vh;
    max-height: 100vh;
}

#filtersModal .modal-content {
    border: none;
    border-radius: 20px 20px 0 0;
}

/* Para pantallas medianas también */
@media (min-width: 576px) and (max-width: 991.98px) {
    #filtersModal .modal-content {
        border-radius: 20px;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    #filtersModal .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
    }
}

/* Contador de resultados mejorado */
.results-count h4 {
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.results-count small {
    color: var(--primary);
    font-weight: 600;
}

#total-results {
    color: var(--secondary);
    font-weight: 700;
}

/* Estado activo para opciones de ordenamiento */
.sort-option.active {
    background: linear-gradient(135deg, var(--primary), #FF8A5C);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.sort-option.active i {
    color: white;
}

.sort-option.active .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Indicador de filtros activos */
.filters-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.4);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(46, 196, 182, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0);
    }
}

/* Transiciones suaves para elementos de formulario - removido */

/* Mejorar la accesibilidad del modal */
.modal-backdrop {
    backdrop-filter: blur(5px);
}

.modal.fade .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Loading state para filtros */
.filters-loading {
    position: relative;
    overflow: hidden;
}

.filters-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* PWA Install Modal */
.pwa-modal {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 9999;
    max-width: 320px;
    width: calc(100% - 40px);
    display: none;
    animation: slideUp 0.3s ease-out;
}

.pwa-modal.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.pwa-modal-header {
    position: relative;
    margin-bottom: 0;
}

.pwa-modal-close {
    position: absolute;
    top: -6px;
    right: -6px;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    z-index: 20;
}

.pwa-modal-close:hover {
    color: #333;
}

.pwa-modal-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-modal-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-color: #f0f0f0;
    flex-shrink: 0;
    overflow: hidden;
}

.pwa-modal-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-modal-text {
    flex: 1;
}

.pwa-modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--dark);
    margin: 0 0 4px 0;
}

.pwa-modal-subtitle {
    font-size: 10px;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.pwa-install-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pwa-install-btn:hover {
    background-color: #e55a2b;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .pwa-modal {
        bottom: 30px;
        right: 30px;
        left: auto;
        transform: none;
        max-width: 350px;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}
/* Username validation feedback */.username-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
}

.username-feedback .text-success {
    color: #28a745 !important;
}

.username-feedback .text-danger {
    color: #dc3545 !important;
}

.username-feedback .text-muted {
    color: #6c757d !important;
}

.username-feedback i {
    margin-right: 0.25rem;
}

/* Form validation states */.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Notification center */
.notification-wrapper {
    position: relative;
    margin-left: 0.5rem;
}

.notification-button {
    position: relative;
    border: none;
    background: transparent;
    color: #2b2b2b;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.notification-button:hover,
.notification-button:focus {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    outline: none;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #ff6b35;
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 0.75rem;
    line-height: 1.4;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.35);
}

.notification-dot {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: #2EC4B6;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.15);
}

.notification-panel {
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: none;
    z-index: 1090;
}

.notification-panel.show {
    display: block;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f1f1;
    background: #fff;
}

.notification-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
}

.notification-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
}

.notification-list {
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
}

.notification-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background: #f8f9fb;
}

.notification-item.is-read {
    opacity: 0.78;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f5f7fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff6b35;
    flex-shrink: 0;
    font-size: 1rem;
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.notification-message {
    font-weight: 700;
    font-size: 0.98rem;
    margin: 0;
    color: #212529;
    flex: 1;
}

.notification-description {
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #6c757d;
}

.notification-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef3ff;
    color: #3559c7;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.notification-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.notification-item-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0;
    border-radius: 50%;
    background: #2EC4B6;
    vertical-align: middle;
    box-shadow: none;
    flex-shrink: 0;
}

.notification-message-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-empty {
    text-align: center;
    padding: 28px 16px;
    color: #6c757d;
}

.notification-empty i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.notification-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1f1f1;
    background: #fff;
    text-align: right;
}

.notification-backdrop {
    display: none;
}

.notification-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1080;
}

@media (max-width: 991.98px) {
    .notification-panel {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding-top: 72px;
    }

    .notification-panel-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    }

    .notification-list {
        max-height: calc(100vh - 150px);
        padding-top: 8px;
    }

    .navbar-nav .notification-mobile-trigger {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .notification-dot,
    .notification-badge {
        position: absolute !important;
        top: -2px;
    }

    .navbar-nav .notification-mobile-trigger .notification-dot {
        position: absolute !important;
        width: 8px;
        height: 8px;
        min-width: 8px;
        min-height: 8px;
        margin: 0 !important;
        padding: 0 !important;
        top: 4px !important;
        right: 12px !important;
        background: #2EC4B6;
        border-radius: 50%;
        box-shadow: none;
        display: block !important;
        z-index: 10;
    }
    }

    .navbar-nav .notification-mobile-trigger .notification-dot.d-none {
        display: none !important;
    }

    .navbar-nav .notification-mobile-trigger .notification-badge {
        display: none !important;
    }
}

/* Desktop: la posición la calcula JS junto al botón de la campana */
@media (min-width: 992px) {
    .notification-panel.show {
        position: fixed;
    }

    .notification-backdrop {
        display: none !important;
    }
}

