/* ===========================
   BASE / VARIABLES / TIPOGRAFÍA
   =========================== */
:root {
    --font-display: "Croissant One", cursive;
    --font-sans: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --morado: #4b007d;
    --lila: #d493f8;
    --lila-200: #f1e6ff;
    --lila-300: #ead6ff;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    background: #fff;
}

h2,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
}

/* ===========================
   BANNER + TABS
   =========================== */
.category-banner {
    width: 100%;
    height: auto;
    border-radius: 15px;
    margin-bottom: 20px;
    object-fit: contain;
}

.category-tabs {
    display: flex;
    justify-content: start;
    margin-bottom: 20px;
    gap: 40px;
    border-bottom: 3px solid #dcd0f1;
}

.category-tab {
    font-family: var(--font-sans);
    background: none;
    border: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: #d4a1f3;
    position: relative;
    padding-bottom: 8px;
    transition: .3s;
}

.category-tab.active-tab {
    color: #4b007d;
}

.category-tab.active-tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ba54d3;
    border-radius: 10px;
}

.category-tab:hover {
    color: #a84cd4;
}

/* ===========================
   SIDEBAR / FILTROS
   =========================== */
.sidebar .bg-light {
    padding: 20px;
    border-radius: 20px;
    background: #f5eafe;
}

.sidebar h5 {
    color: #7a00b3;
    font-family: var(--font-sans);
    font-weight: 600;
}

.btn-link {
    color: #7a00b3;
    font-weight: 500;
    text-decoration: none;
    padding-left: 0;
    font-family: var(--font-sans);
}

.btn-link:hover {
    color: #b364d8;
    text-decoration: underline;
}

.category-btn {
    color: #b57cc4 !important;
    transition: color .2s;
    text-decoration: none !important;
    font-family: var(--font-sans);
}

.category-btn.active-category {
    font-weight: 600;
    text-decoration: underline;
    color: #6a1b9a !important;
}

.form-range::-webkit-slider-thumb {
    background: #7a00b3;
}

.form-range::-moz-range-thumb {
    background: #7a00b3;
}

.filtro {
    text-align: center;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: transparent;
    border: 0;
    width: 100%;
    padding: .5rem .25rem;
    font-weight: 600;
    color: #4b007d;
    font-family: var(--font-sans);
}

.filter-toggle .current {
    font-weight: 600;
    color: #9c82c4;
    margin-left: .25rem;
}

.filter-toggle .chevron {
    transition: transform .25s ease;
}

.filter-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg)
}

/* ===========================
   GRID / CARDS
   =========================== */
.card {
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .2s ease;
    border: 1px solid var(--lila-300);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(75, 0, 125, .08);
}

.card-img-top {
    aspect-ratio: 1/1;
    width: 100%;
    height: 400px;
    object-fit: cover;
    background: #f6f6f6;
}

.card-title {
    color: #7a00b3;
    font-weight: 600;
    text-align: left;
    font-family: var(--font-sans);
}

.card-body p.small {
    font-size: .8rem;
    margin-bottom: 4px;
    color: #9c82c4;
    text-align: left;
    font-family: var(--font-sans);
}

.card-body h5 {
    font-size: 1rem;
    margin-bottom: 4px;
}

/* precios a la izquierda */
.card .card-body {
    display: flex;
    flex-direction: column;
}

.card-body .fw-bold {
    color: #7a00b3;
    text-align: left;
    margin-left: 0;
}

.card-body .price-line,
.card-body .prices {
    margin-left: 0;
    display: flex;
    justify-content: flex-start;
    gap: .35rem;
    flex-wrap: wrap;
}

.card-body .price-usd,
.card-body .price-pen,
.card-body .price-free {
    white-space: nowrap;
}

.product-item {
    transition: opacity .3s, transform .3s;
    content-visibility: visible;
    contain-intrinsic-size: auto;
}

.product-item.fade-in {
    opacity: 1;
    transform: scale(1);
}

.product-item.fade-out {
    opacity: 0;
    transform: scale(.98);
    pointer-events: none;
}

/* evita trabajo fuera de pantalla */
#products-container .card {
    content-visibility: auto;
    contain-intrinsic-size: 600px 760px;
}

#products-container .no-products-message {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    text-align: center;
    font-size: 1.3rem;
    padding: 50px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border-radius: 12px;
    background: #f8f5ff;
}

/* ===========================
   BUSCADOR
   =========================== */
.products-toolbar {
    margin-top: .25rem;
    margin-bottom: .25rem;
}

.search-group .input-group-text,
.search-group .form-control,
.search-group .btn {
    border-color: #ead6ff;
}

.search-group .form-control {
    box-shadow: none;
}

/* oculta X nativa */
#searchBox::-webkit-search-cancel-button,
#searchBox::-webkit-search-decoration,
#searchBox::-webkit-search-results-button,
#searchBox::-webkit-search-results-decoration {
    display: none;
}

#searchBox::-ms-clear,
#searchBox::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 6px 0 14px;
}

.search-hint {
    color: #8b78b3;
    font-weight: 600;
    font-family: var(--font-sans);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--lila-300);
    border-radius: 14px;
    padding: .6rem .8rem;
    box-shadow: 0 6px 18px rgba(75, 0, 125, .06);
    transition: border-color .2s, box-shadow .2s, transform .05s;
}

.search-bar:focus-within {
    border-color: #ba54d3;
    box-shadow: 0 8px 22px rgba(75, 0, 125, .10), 0 0 0 4px rgba(212, 147, 248, .20);
}

.search-icon {
    color: #b57cc4;
    font-size: 1rem;
    line-height: 1;
}

.search-input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--morado);
    font-family: var(--font-sans);
    font-weight: 300;
}

.search-input::placeholder {
    color: #b57cc4;
    font-weight: 600;
}

.clear-btn {
    border: 0;
    background: #f3e6ff;
    color: #7b41e6;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: filter .15s ease, transform .05s;
}

.clear-btn:hover {
    filter: brightness(.95)
}

.clear-btn:active {
    transform: translateY(1px)
}

/* ===========================
   CONTENEDOR FILTROS+GRID
   =========================== */
section.text-center+.container.mb-5 {
    background: #f1e6ff;
    border: 1px solid #ead6ff;
    border-radius: 22px;
    padding: 16px 16px 8px;
    overflow: hidden;
}

section.text-center+.container.mb-5>.row {
    margin-left: 0;
    margin-right: 0;
}

section.text-center+.container.mb-5 [class^="col-"],
section.text-center+.container.mb-5 [class*=" col-"] {
    padding-left: 12px;
    padding-right: 12px;
}

/* ===========================
   PAGINACIÓN
   =========================== */
.pagination {
    gap: 10px;
}

.pagination .page-link {
    border: 0;
    background: #ede1ff;
    color: rgba(75, 0, 125, .85);
    font-weight: 600;
    border-radius: 999px;
    padding: .4rem .7rem;
    box-shadow: none;
    font-family: var(--font-sans);
}

.pagination .ellipsis .page-link {
    background: transparent;
    cursor: default;
}

.page-item.active .page-link {
    background: #7b41e6;
    color: #fff;
}

/* ===========================
   CTA CONTACTO
   =========================== */
.contact-cta {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.contact-cta-link {
    display: block;
    text-decoration: none;
    color: #b57cc4 !important;
    font-family: var(--font-sans);
}

.contact-cta p {
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.btn-cta {
    display: inline-block;
    margin-top: 8px;
    padding: .45rem .9rem;
    border-radius: 999px;
    background: #d493f8;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    font-family: var(--font-sans);
}

.contact-cta:hover .btn-cta {
    filter: brightness(1.05)
}

/* ===========================
   BOTONES FLOTANTES
   =========================== */
.floating-buttons {
    position: fixed;
    bottom: 50px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.floating-btn {
    background: #6f2c91;
    border-radius: 50%;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}

.floating-btn img {
    width: 30px;
    height: 30px;
}

.floating-btn:hover {
    background: #a364d8
}

/* ===========================
   ANIMACIONES
   =========================== */
@keyframes shimmer {
    from {
        background-position: 200% 0
    }

    to {
        background-position: -200% 0
    }
}

/* =====================================
   RESPONSIVE
   ===================================== */

/* ≤575.98px */
@media (max-width:575.98px) {
    .search-bar {
        padding: .55rem .7rem;
        border-radius: 12px;
    }

    .clear-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
}

/* ≤900px */
@media (max-width:900px) {
    #products-container>* {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ≤991.98px */
@media (max-width:991.98px) {
    .product-item {
        margin-left: 0;
    }

    .card-img-top {
        height: 300px;
    }

    .category-banner {
        height: 250px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    section.text-center+.container.mb-5 {
        padding: 5px 15px 5px;
    }

    .floating-buttons {
        right: 10px !important;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
    }
}

/* ≥992px */
@media (min-width:992px) {
    #navbarResponsive {
        display: none !important;
    }

    #products-container>* {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }

    .filter-toggle {
        display: none !important;
    }

    #catCollapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }
}