/* =============================================================================
   UltraDev_CustomerReview — customerreview.css
   Cobre store.phtml (.cr-wrapper) e product.phtml (#ultradev-customerreview)
   ============================================================================= */

/* ---- Animação SVG ---- */
@keyframes cr-fill {
    from { stroke-dashoffset: 251.327; }
    to   { stroke-dashoffset: var(--cr-offset); }
}
.cr-progress {
    animation: cr-fill 1.2s ease-out forwards;
    stroke-dasharray: 251.327, 251.327;
}

/* ---- Wrapper ---- */
.cr-wrapper {
    background: #fff;
    padding: 24px 0;
}
.cr-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.cr-layout {
    display: flex !important;
    gap: 40px;
    align-items: flex-start;
}

/* ---- Sidebar ---- */
.cr-sidebar {
    flex: 0 0 220px !important;
}
.cr-svg--large {
    width: 160px !important;
    height: 160px !important;
    max-width: 160px !important;
    max-height: 160px !important;
    min-width: 160px !important;
    min-height: 160px !important;
    display: block !important;
    margin: 0 auto 8px !important;
    flex-shrink: 0 !important;
}
.cr-global-box {
    text-align: center;
    margin-bottom: 24px;
}
.cr-total-label {
    font-size: 13px;
    color: #555;
    margin: 0;
}
.cr-total-label strong {
    color: #222;
}

/* ---- Distribuição estrelas ---- */
.cr-distribution {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}
.cr-dist-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 6px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: background 0.15s !important;
}
.cr-dist-row:hover {
    background: #fafafa !important;
    text-decoration: none !important;
}
.cr-dist-row--active {
    background: #fff8e1 !important;
}
.cr-dist-stars {
    flex: 0 0 76px !important;
    font-size: 11px !important;
    color: #ffca00 !important;
    white-space: nowrap !important;
}
.cr-dist-stars .fa-star-o {
    color: #ddd !important;
}
.cr-dist-bar {
    flex: 1 !important;
    height: 7px !important;
    background: #efefef !important;
    border-radius: 99px !important;
    overflow: hidden !important;
}
.cr-dist-bar__fill {
    display: block !important;
    height: 100% !important;
    background: #ffca00 !important;
    border-radius: 99px !important;
}
.cr-dist-pct {
    flex: 0 0 36px !important;
    text-align: right !important;
    font-size: 11px !important;
    color: #888 !important;
}
.cr-clear-filter {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: #c00;
    text-decoration: none;
}
.cr-clear-filter:hover {
    text-decoration: underline;
    color: #900;
}

/* ---- Main ---- */
.cr-main {
    flex: 1 !important;
    min-width: 0 !important;
}
.cr-page-title {
    font-size: 19px !important;
    font-weight: 400 !important;
    color: #333 !important;
    border-bottom: 2px solid #f0f0f0 !important;
    padding-bottom: 14px !important;
    margin: 0 0 20px !important;
    line-height: 1.4 !important;
}
.cr-page-title strong {
    font-weight: 700 !important;
}
.cr-page-title--product {
    font-size: 20px !important;
    font-weight: 500 !important;
    color: #222 !important;
}

/* ---- Lista / Cards ---- */
.cr-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.cr-item {
    display: flex !important;
    gap: 20px !important;
    align-items: flex-start !important;
    background: #fafafa !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 20px 24px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    transition: box-shadow 0.2s !important;
    box-sizing: border-box !important;
}
.cr-item:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.10) !important;
}

/* ---- Autor ---- */
.cr-author {
    flex: 0 0 110px !important;
    text-align: center !important;
}
.cr-author__icon {
    font-size: 44px !important;
    color: #bbb !important;
    line-height: 1 !important;
    margin-bottom: 8px !important;
}
.cr-author__name {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #111 !important;
    word-break: break-word !important;
    margin-bottom: 4px !important;
}
.cr-author__location {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 6px !important;
    font-style: italic !important;
}
.cr-author__stars {
    font-size: 14px !important;
    color: #ffca00 !important;
    letter-spacing: 1px !important;
}
.cr-author__stars .fa-star-o {
    color: #bbb !important;
}

/* ---- Conteúdo ---- */
.cr-content {
    flex: 1 !important;
    min-width: 0 !important;
}
.cr-date {
    display: block !important;
    font-size: 13px !important;
    color: #777 !important;
    margin-bottom: 12px !important;
}
.cr-content__label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #888 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin: 0 0 4px !important;
}
.cr-content__text {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #2c2c2c !important;
    margin: 0 0 14px !important;
    word-break: break-word !important;
}

/* ---- Círculo da nota ---- */
.cr-score-box {
    flex: 0 0 115px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.cr-svg--small {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    min-width: 110px !important;
    min-height: 110px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* ---- Vazio ---- */
.cr-empty {
    font-size: 14px;
    color: #888;
    padding: 20px 0;
}
.cr-empty a {
    color: #b73741 !important;
    text-decoration: none !important;
}

/* ---- Paginação ---- */
.cr-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 28px 0 8px !important;
}
.cr-page-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    color: #444 !important;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s !important;
    cursor: pointer !important;
    background: #fff !important;
}
.cr-page-btn:hover {
    background: #f5f5f5 !important;
    border-color: #bbb !important;
    text-decoration: none !important;
    color: #222 !important;
}
.cr-page-btn--active {
    background: #ffca00 !important;
    border-color: #ffca00 !important;
    color: #222 !important;
    font-weight: 700 !important;
    cursor: default !important;
    pointer-events: none !important;
}
.cr-page-ellipsis {
    font-size: 14px !important;
    color: #bbb !important;
    line-height: 36px !important;
    padding: 0 2px !important;
}

/* ---- Botão Avaliar ---- */
.cr-btn-avaliar {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-align: center;
}
.cr-btn-avaliar:hover {
    background: #2c85c8;
    color: #fff;
    border-color: #2c85c8;
}

/* ---- Rating oculto ---- */
.cr-rating-hidden {
    display: none !important;
}

/* ---- Responsivo ---- */
@media (max-width: 767px) {
    .cr-layout {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .cr-sidebar {
        flex: none !important;
        width: 100% !important;
    }
    .cr-global-box {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        text-align: left !important;
        margin-bottom: 16px !important;
    }
    .cr-svg--large {
        width: 100px !important;
        height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
        min-width: 100px !important;
        min-height: 100px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .cr-item {
        flex-wrap: wrap !important;
    }
    .cr-score-box {
        flex: 0 0 90px !important;
        order: -1 !important;
    }
    .cr-svg--small {
        width: 85px !important;
        height: 85px !important;
        max-width: 85px !important;
        max-height: 85px !important;
        min-width: 85px !important;
        min-height: 85px !important;
    }
    .cr-author {
        flex: 1 !important;
        text-align: left !important;
    }
    .cr-author__icon {
        display: none !important;
    }
    .cr-content {
        flex: 0 0 100% !important;
    }
}

/* =============================================================================
   MODAL — desacoplado (movido para o body no product.phtml)
   ============================================================================= */
.cr-modal-overlay--detached {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(60, 60, 60, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.cr-modal-overlay--detached.cr-modal--open {
    display: flex;
}
@keyframes crSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.cr-modal-overlay--detached .cr-modal-box {
    background: #fff;
    border-radius: 5px;
    padding: 36px 32px 28px;
    margin: auto;
    max-width: 520px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    animation: crSlideUp 0.25s ease;
}
.cr-modal-overlay--detached .cr-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}
.cr-modal-overlay--detached .cr-modal-close:hover { color: #333; }
.cr-modal-overlay--detached .cr-modal-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: #111;
    margin-bottom: 4px;
}
.cr-modal-overlay--detached .cr-modal-product {
    font-size: 13px;
    color: #777;
    text-align: center;
    margin-bottom: 20px;
}
.cr-modal-overlay--detached .cr-modal-stars-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: -15px;
    margin-bottom: 10px;
}
.cr-modal-overlay--detached .cr-modal-rating-row {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 2px;
}
.cr-modal-overlay--detached .cr-star-input { display: none; }
.cr-modal-overlay--detached .cr-modal-rating-row label {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.15s;
}
.cr-modal-overlay--detached .cr-modal-rating-row label:hover,
.cr-modal-overlay--detached .cr-modal-rating-row label:hover ~ label,
.cr-modal-overlay--detached .cr-star-input:checked ~ label {
    color: #ffca00;
}
.cr-modal-overlay--detached .cr-modal-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.cr-modal-overlay--detached .cr-modal-field {
    flex: 1;
    margin-bottom: 18px;
}
.cr-modal-overlay--detached .cr-modal-field--full {
    flex: 0 0 100%;
    width: 100%;
}
.cr-modal-overlay--detached .cr-modal-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-top:-8px;
    margin-bottom: 5px;
}
.cr-modal-overlay--detached .cr-modal-field input,
.cr-modal-overlay--detached .cr-modal-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    color: #222;
    font-family: inherit;
    transition: border-color 0.2s;
    resize: vertical;
    box-sizing: border-box;
}
.cr-modal-overlay--detached .cr-modal-field input:focus,
.cr-modal-overlay--detached .cr-modal-field textarea:focus {
    outline: none;
    border-color: #2c85c8;
}
.cr-modal-overlay--detached .cr-modal-field textarea { min-height: 90px; }
.cr-modal-overlay--detached .cr-modal-submit {
    display: block;
    width: 100%;
    padding: 13px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #fff;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cr-modal-overlay--detached .cr-modal-submit:hover {
    background: #2c85c8;
    color: #fff;
    border-color: #2c85c8;
}
@media (max-width: 600px) {
    .cr-modal-overlay--detached .cr-modal-box {
        padding: 28px 18px 22px;
        border-radius: 12px;
    }
    .cr-modal-overlay--detached .cr-modal-row {
        flex-direction: column;
        gap: 0;
    }
}