/* =============================================
   CusRev Reviews Carousel – carousel.css v2.2
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

.crc-wrapper *,
.crc-wrapper *::before,
.crc-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.crc-wrapper {
    --crc-accent:      #c0392b;
    --crc-accent-dark: #96281b;
    --crc-accent-soft: #fdf0ef;
    --crc-dark:        #222222;
    --crc-mid:         #666666;
    --crc-light:       #f4f4f4;
    --crc-border:      #e2e2e2;
    --crc-white:       #ffffff;
    --crc-star-on:     #c0392b;
    --crc-star-off:    #d0d0d0;
    --crc-verified:    #2e7d52;
    --crc-radius:      10px;
    --crc-shadow:      0 4px 18px rgba(0,0,0,.11), 0 1.5px 5px rgba(0,0,0,.06);
    --crc-transition:  0.42s cubic-bezier(.4,0,.2,1);

    background: transparent;
    padding: 40px 12px;
    position: relative;
}

/* ---------- Heading ---------- */
.crc-heading {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: var(--crc-dark);
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -.025em;
    line-height: 1.2;
}
.crc-heading::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: var(--crc-accent);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ==============================================
   ESTADÍSTICAS – tarjeta centrada
   ============================================== */
.crc-stats {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    background: var(--crc-white);
    border: 1px solid var(--crc-border);
    border-radius: 14px;
    box-shadow: var(--crc-shadow);
    padding: 16px 28px;
    margin: 0 auto 28px;
    max-width: fit-content;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    float: none;
}

.crc-stats__score {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-right: 24px;
    border-right: 1px solid var(--crc-border);
}

.crc-stats__avg {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--crc-accent);
    line-height: 1;
    letter-spacing: -.04em;
}

.crc-stats__right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crc-stats__stars { display: flex; gap: 2px; }
.crc-stats__stars .crc-star { font-size: .88rem; }

.crc-stats__total {
    font-size: .7rem;
    font-weight: 400;
    color: var(--crc-mid);
}

/* Barras */
.crc-stats__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.crc-stats__bar-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.crc-stats__bar-label {
    font-size: .62rem;
    font-weight: 500;
    color: var(--crc-mid);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.crc-stats__bar-track {
    flex: 1;
    height: 5px;
    background: var(--crc-light);
    border-radius: 3px;
    overflow: hidden;
}

.crc-stats__bar-fill {
    height: 100%;
    background: var(--crc-accent);
    border-radius: 3px;
    transition: width .7s ease;
}

.crc-stats__bar-pct {
    font-size: .59rem;
    font-weight: 400;
    color: var(--crc-mid);
    width: 26px;
    flex-shrink: 0;
}

/* ==============================================
   CARRUSEL
   ============================================== */
.crc-stage {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crc-track-wrapper {
    overflow: hidden;
    flex: 1;
}

.crc-track {
    display: flex;
    gap: 12px;
    transition: transform var(--crc-transition);
    will-change: transform;
    padding: 6px 2px 12px;
}

/* ---------- Card ---------- */
.crc-card {
    background: var(--crc-white);
    border: 1px solid var(--crc-border);
    border-radius: var(--crc-radius);
    padding: 12px 13px;
    box-shadow: var(--crc-shadow);
    flex: 0 0 calc(20% - 10px);
    min-width: 160px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 7px;
    transition: transform .22s ease, box-shadow .22s ease;
    position: relative;
    overflow: hidden;
}

.crc-card::before {
    content: '\201C';
    font-size: 42px;
    font-weight: 700;
    color: var(--crc-accent-soft);
    position: absolute;
    top: -2px;
    right: 8px;
    line-height: 1;
    pointer-events: none;
}

.crc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,.15), 0 3px 8px rgba(0,0,0,.08);
}

.crc-card__header { display: flex; align-items: center; gap: 7px; }

.crc-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--crc-border);
    flex-shrink: 0;
}

.crc-card__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.crc-card__author {
    font-weight: 600;
    font-size: .74rem;
    color: var(--crc-dark);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crc-card__verified { font-size: .6rem; font-weight: 500; color: var(--crc-verified); }
.crc-card__date     { font-size: .6rem; font-weight: 400; color: var(--crc-mid); opacity: .7; }

.crc-card__stars { display: flex; gap: 1px; }
.crc-star        { font-size: .75rem; line-height: 1; }
.crc-star--filled { color: var(--crc-star-on); }
.crc-star--empty  { color: var(--crc-star-off); }

.crc-card__content {
    font-size: .73rem;
    font-weight: 400;
    color: var(--crc-mid);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crc-card__product {
    display: flex;
    align-items: center;
    gap: 7px;
    border-top: 1px solid var(--crc-border);
    padding-top: 8px;
    margin-top: auto;
}

.crc-card__product-link {
    flex-shrink: 0;
    display: block;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--crc-border);
    transition: opacity .2s;
}
.crc-card__product-link:hover { opacity: .75; }

.crc-card__product-img { width: 38px; height: 38px; object-fit: cover; display: block; }

.crc-card__product-name {
    font-size: .65rem;
    font-weight: 500;
    color: var(--crc-accent);
    text-decoration: none;
    line-height: 1.3;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: none;
    cursor: default;
}
.crc-card__product-name:hover { color: var(--crc-accent); text-decoration: none; }

/* ---------- Nav buttons ---------- */
.crc-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--crc-border);
    background: var(--crc-white);
    color: var(--crc-dark);
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: background .2s, border-color .2s, color .2s, transform .18s;
    z-index: 2;
}
.crc-btn:hover { background: var(--crc-accent); border-color: var(--crc-accent); color: var(--crc-white); transform: scale(1.08); }
.crc-btn:focus-visible { outline: 2px solid var(--crc-accent); outline-offset: 2px; }
.crc-btn:disabled { opacity: .3; pointer-events: none; }

/* ---------- Dots ---------- */
.crc-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    margin-bottom: 0;
}

.crc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--crc-border);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background .22s, transform .22s;
}
.crc-dot--active { background: var(--crc-accent); transform: scale(1.4); }

/* ==============================================
   BUSCADOR – 50% de ancho, centrado, sin lupa
   ============================================== */
.crc-search {
    margin-top: 22px;
    position: relative;
    width: 50%;
    min-width: 200px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.crc-search__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* Lupa oculta */
.crc-search__icon {
    display: none;
}

.crc-search__input {
    width: 100%;
    padding: 9px 34px 9px 16px;
    border: 1.5px solid var(--crc-border);
    border-radius: 24px;
    font-size: .78rem;
    font-weight: 400;
    color: var(--crc-dark);
    background: var(--crc-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    white-space: nowrap;
}
.crc-search__input:focus {
    border-color: var(--crc-accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.crc-search__input::placeholder { color: #aaa; font-weight: 400; }

.crc-search__clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--crc-mid);
    font-size: .75rem;
    padding: 2px 4px;
    line-height: 1;
    transition: color .2s;
}
.crc-search__clear:hover { color: var(--crc-accent); }

/* Dropdown */
.crc-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--crc-white);
    border: 1.5px solid var(--crc-border);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    list-style: none;
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.crc-search__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .15s;
}
.crc-search__item:hover { background: var(--crc-accent-soft); }

.crc-search__item-img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--crc-border);
    flex-shrink: 0;
}

.crc-search__item-name { flex: 1; font-size: .78rem; font-weight: 500; color: var(--crc-dark); line-height: 1.3; }
.crc-search__item-count { font-size: .65rem; font-weight: 400; color: var(--crc-mid); white-space: nowrap; }
.crc-search__no-result { padding: 10px 14px; font-size: .76rem; color: var(--crc-mid); font-style: italic; }

/* Badge filtro activo */
.crc-search__active {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--crc-accent-soft);
    border: 1px solid rgba(192,57,43,.2);
    border-radius: 20px;
    padding: 5px 10px 5px 14px;
    width: fit-content;
    margin: 8px auto 0;
}

.crc-search__active-name { font-size: .74rem; font-weight: 500; color: var(--crc-accent); }

.crc-search__remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--crc-accent);
    font-size: .7rem;
    padding: 0 2px;
    line-height: 1;
    transition: opacity .2s;
}
.crc-search__remove:hover { opacity: .6; }

/* ==============================================
   CARGAR MÁS
   ============================================== */
.crc-loadmore-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.crc-loadmore__counter { font-size: .74rem; font-weight: 400; color: var(--crc-mid); }

.crc-loadmore-btn {
    padding: 9px 26px;
    background: var(--crc-white);
    border: 2px solid var(--crc-accent);
    border-radius: 8px;
    color: var(--crc-accent);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, transform .18s;
}
.crc-loadmore-btn:hover { background: var(--crc-accent); color: var(--crc-white); transform: translateY(-1px); }
.crc-loadmore-btn:disabled { opacity: .5; pointer-events: none; }

/* ==============================================
   ESTADOS
   ============================================== */
.crc-loading {
    padding: 32px;
    text-align: center;
    color: var(--crc-mid);
    font-size: .8rem;
    font-style: italic;
    width: 100%;
}

.crc-no-reviews {
    text-align: center;
    color: var(--crc-mid);
    font-size: .82rem;
    font-style: italic;
    padding: 32px;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 680px) {
    .crc-stats {
        flex-direction: column;
        gap: 16px;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
    }
    .crc-stats__score { border-right: none; padding-right: 0; border-bottom: 1px solid var(--crc-border); padding-bottom: 14px; width: 100%; justify-content: center; }
    .crc-stats__bars { min-width: 160px; width: 100%; }
    .crc-search { min-width: 0; width: 100%; max-width: 100%; }
}
@media (max-width: 1100px) { .crc-card { flex: 0 0 calc(25% - 9px); } }
@media (max-width: 820px)  { .crc-card { flex: 0 0 calc(33.333% - 8px); } }
@media (max-width: 560px)  {
    .crc-card { flex: 0 0 calc(50% - 6px); }
    .crc-btn  { width: 28px; height: 28px; font-size: .82rem; }
    .crc-wrapper { padding: 28px 6px; }
}
@media (max-width: 380px) { .crc-card { flex: 0 0 calc(100% - 4px); } }
