/* ============================================
   CED Reviews Plugin — Front styles
   Fonts: Josefin Sans (titles) + Inter (body)
   Palette matches ced-faq / ced-smile-gallery
   ============================================ */

.ced-rv,
.ced-rv-formwrap {
    --ced-bg: #f5f7fa;
    --ced-card: #ffffff;
    --ced-text: #0f1419;
    --ced-muted: #6b7785;
    --ced-accent: #4a6478;
    --ced-accent-dark: #3a5266;
    --ced-accent-soft: #e8edf2;
    --ced-border: #e1e7ee;
    --ced-star: #f5b820;
    --ced-star-off: #d4dae0;
    --ced-req: #e0556b;
    --ced-shadow: 0 1px 3px rgba(15, 20, 25, .04), 0 4px 12px rgba(15, 20, 25, .05);
    --ced-shadow-hover: 0 6px 22px rgba(15, 20, 25, .09);

    --ced-font-title: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ced-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    font-family: var(--ced-font-body);
    color: var(--ced-text);
    box-sizing: border-box;
}

.ced-rv *,
.ced-rv *::before,
.ced-rv *::after,
.ced-rv-formwrap *,
.ced-rv-formwrap *::before,
.ced-rv-formwrap *::after {
    box-sizing: border-box;
}

/* --- Responsive hardening: nada desborda su contenedor --- */
.ced-rv,
.ced-rv-formwrap {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
}

.ced-rv img,
.ced-rv-formwrap img {
    max-width: 100%;
    height: auto;
}

.ced-rv-card-title,
.ced-rv-text,
.ced-rv-text p,
.ced-rv-author,
.ced-rv-title,
.ced-rv-subtitle,
.ced-rv-form-title,
.ced-rv-form-sub {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.ced-rv-input,
.ced-rv-textarea {
    max-width: 100%;
}

/* ============================================
   1) FORM  —  [ced_review_form]
   ============================================ */
.ced-rv-formwrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px;
}

.ced-rv-form-head {
    text-align: center;
    margin-bottom: 36px;
}

.ced-rv-form-title {
    font-family: var(--ced-font-title);
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 12px;
    color: var(--ced-text);
}

.ced-rv-form-sub {
    font-size: 17px;
    color: var(--ced-muted);
    margin: 0;
    line-height: 1.5;
}

.ced-rv-form {
    background: var(--ced-card);
    border: 1px solid var(--ced-border);
    border-radius: 20px;
    box-shadow: var(--ced-shadow);
    padding: 40px;
}

.ced-rv-field {
    margin-bottom: 26px;
}

.ced-rv-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ced-text);
    margin: 0 0 12px;
}

.ced-rv-req {
    color: var(--ced-req);
}

.ced-rv-input,
.ced-rv-textarea {
    width: 100%;
    font-family: var(--ced-font-body);
    font-size: 16px;
    color: var(--ced-text);
    background: #fff;
    border: 1px solid var(--ced-border);
    border-radius: 12px;
    padding: 15px 18px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ced-rv-textarea {
    resize: vertical;
    min-height: 180px;
    line-height: 1.6;
}

.ced-rv-input::placeholder,
.ced-rv-textarea::placeholder {
    color: #9aa6b2;
}

.ced-rv-input:focus,
.ced-rv-textarea:focus {
    outline: none;
    border-color: var(--ced-accent);
    box-shadow: 0 0 0 3px rgba(74, 100, 120, .12);
}

/* ---- Star rating input ---- */
.ced-rv-rating {
    display: inline-flex;
    gap: 6px;
}

.ced-rv-star-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none !important;
    border: 0 !important;
    padding: 2px !important;
    margin: 0 !important;
    cursor: pointer;
    line-height: 0;
    box-shadow: none !important;
}

.ced-rv-star-btn svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: var(--ced-star-off);
    stroke-width: 1.5;
    transition: fill .15s ease, stroke .15s ease, transform .15s ease;
}

.ced-rv-star-btn:hover svg {
    transform: scale(1.08);
}

.ced-rv-star-btn.is-active svg,
.ced-rv-rating.is-hovering .ced-rv-star-btn.is-hover svg {
    fill: var(--ced-star);
    stroke: var(--ced-star);
}

/* ---- Dropzone ---- */
.ced-rv-dropzone {
    border: 2px dashed #b9c4cf;
    border-radius: 14px;
    padding: 46px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.ced-rv-dropzone:hover,
.ced-rv-dropzone.is-drag {
    border-color: var(--ced-accent);
    background: var(--ced-accent-soft);
}

.ced-rv-dropzone-text {
    margin: 0;
    color: var(--ced-muted);
    font-size: 16px;
}

.ced-rv-browse {
    color: var(--ced-accent);
    font-weight: 600;
}

.ced-rv-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.ced-rv-preview {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ced-border);
}

.ced-rv-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ced-rv-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 20, 25, .7);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Legal + submit ---- */
.ced-rv-legal {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--ced-text);
    text-align: center;
    margin: 30px 0 24px;
}

.ced-rv-submit-wrap {
    text-align: center;
}

.ced-rv-submit {
    -webkit-appearance: none;
    appearance: none;
    font-family: var(--ced-font-body);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--ced-accent);
    border: 0;
    border-radius: 999px;
    padding: 16px 44px;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
    box-shadow: 0 4px 14px rgba(74, 100, 120, .25);
}

.ced-rv-submit:hover {
    background: var(--ced-accent-dark);
    transform: translateY(-1px);
}

.ced-rv-submit:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}

.ced-rv-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ced-rv-message {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.ced-rv-message.is-success {
    background: #e7f5ec;
    color: #1d6b3a;
    border: 1px solid #b9e2c8;
}

.ced-rv-message.is-error {
    background: #fdeaed;
    color: #a02338;
    border: 1px solid #f3c4cc;
}

/* ============================================
   2) DISPLAY  —  [ced_reviews]
   ============================================ */
.ced-rv {
    background: var(--ced-bg);
    padding: 64px 24px;
}

.ced-rv-inner {
    max-width: 1180px;
    margin: 0 auto;
}

.ced-rv-head {
    text-align: center;
    margin-bottom: 44px;
}

.ced-rv-title {
    font-family: var(--ced-font-title);
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 12px;
    color: var(--ced-text);
}

.ced-rv-subtitle {
    font-size: 17px;
    color: var(--ced-muted);
    margin: 0;
    line-height: 1.5;
}

.ced-rv-empty {
    text-align: center;
    color: var(--ced-muted);
    font-size: 16px;
}

/* ---- Grid / list container ---- */
.ced-rv--grid .ced-rv-list {
    display: grid;
    grid-template-columns: repeat(var(--ced-rv-cols, 3), 1fr);
    gap: 28px;
}

.ced-rv--list .ced-rv-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
}

/* ---- Card ---- */
.ced-rv-card {
    background: var(--ced-card);
    border: 1px solid var(--ced-border);
    border-radius: 18px;
    box-shadow: var(--ced-shadow);
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .3s ease, transform .3s ease;
    opacity: 0;
    transform: translateY(14px);
    animation: cedRvIn .55s ease forwards;
}

.ced-rv-card:nth-child(1) { animation-delay: .04s; }
.ced-rv-card:nth-child(2) { animation-delay: .10s; }
.ced-rv-card:nth-child(3) { animation-delay: .16s; }
.ced-rv-card:nth-child(4) { animation-delay: .22s; }
.ced-rv-card:nth-child(5) { animation-delay: .28s; }
.ced-rv-card:nth-child(6) { animation-delay: .34s; }
.ced-rv-card:nth-child(7) { animation-delay: .40s; }
.ced-rv-card:nth-child(8) { animation-delay: .46s; }
.ced-rv-card:nth-child(9) { animation-delay: .52s; }

@keyframes cedRvIn {
    to { opacity: 1; transform: translateY(0); }
}

.ced-rv-card:hover {
    box-shadow: var(--ced-shadow-hover);
    transform: translateY(-3px);
}

.ced-rv-card-title {
    font-family: var(--ced-font-body);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 14px;
    color: var(--ced-accent);
}

/* ---- Stars (output) ---- */
.ced-rv-stars {
    display: inline-flex;
    gap: 3px;
    margin-bottom: 12px;
}

.ced-rv-star {
    width: 20px;
    height: 20px;
    fill: var(--ced-star-off);
}

.ced-rv-star.is-on {
    fill: var(--ced-star);
}

.ced-rv-date {
    font-size: 14px;
    color: var(--ced-muted);
    margin-bottom: 16px;
}

.ced-rv-text {
    font-size: 15.5px;
    line-height: 1.65;
    color: #3a4651;
    flex: 1;
}

.ced-rv-text p {
    margin: 0 0 12px;
}

.ced-rv-text p:last-child {
    margin-bottom: 0;
}

.ced-rv-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ced-rv-photo {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ced-border);
    cursor: zoom-in;
}

.ced-rv-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.ced-rv-photo:hover img {
    transform: scale(1.08);
}

.ced-rv-author {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--ced-border);
    font-size: 15px;
    font-weight: 600;
    color: var(--ced-accent);
}

/* ---- Summary bar ---- */
.ced-rv-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    background: var(--ced-card);
    border: 1px solid var(--ced-border);
    border-radius: 18px;
    box-shadow: var(--ced-shadow);
    padding: 28px 34px;
    margin-bottom: 40px;
}

.ced-rv-summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ced-rv-summary-num {
    font-family: var(--ced-font-title);
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    color: var(--ced-text);
}

.ced-rv-summary-count {
    font-size: 14px;
    color: var(--ced-muted);
}

.ced-rv-summary-bars {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ced-rv-summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--ced-muted);
}

.ced-rv-summary-label {
    width: 30px;
    flex-shrink: 0;
}

.ced-rv-summary-track {
    flex: 1;
    height: 8px;
    background: var(--ced-accent-soft);
    border-radius: 999px;
    overflow: hidden;
}

.ced-rv-summary-fill {
    display: block;
    height: 100%;
    background: var(--ced-star);
    border-radius: 999px;
}

.ced-rv-summary-pct {
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

/* ---- Carousel of patient photos ([ced_review_photos]) ---- */
.ced-rv-carousel {
    position: relative;
}

.ced-rv-carousel-track {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 22px 4px 14px;
    scrollbar-width: none;
}

.ced-rv-carousel-track::-webkit-scrollbar {
    display: none;
}

.ced-rv-cphoto {
    flex: 0 0 auto;
    width: 270px;
    margin: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ced-rv-cphoto-name {
    position: relative;
    z-index: 2;
    margin-bottom: -16px;
    max-width: 88%;
    background: var(--ced-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: 7px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(74, 100, 120, .32);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.ced-rv-cphoto-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--ced-border);
    box-shadow: var(--ced-shadow);
    background: var(--ced-card);
    cursor: zoom-in;
}

.ced-rv-cphoto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.ced-rv-cphoto-img:hover img {
    transform: scale(1.06);
}

.ced-rv-carousel-nav {
    position: absolute;
    top: calc(50% + 6px);
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--ced-border);
    background: #fff;
    color: var(--ced-accent);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ced-shadow);
    transition: background .18s ease, color .18s ease, opacity .18s ease;
}

.ced-rv-carousel-nav:hover {
    background: var(--ced-accent);
    color: #fff;
}

.ced-rv-carousel-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.ced-rv-carousel-prev { left: -12px; }
.ced-rv-carousel-next { right: -12px; }

/* ---- Lightbox ---- */
.ced-rv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 20, 25, .88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.ced-rv-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.ced-rv-lightbox-close {
    position: absolute;
    top: 24px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 980px) {
    .ced-rv--grid .ced-rv-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ced-rv {
        padding: 48px 16px;
    }
    .ced-rv--grid .ced-rv-list {
        grid-template-columns: 1fr;
    }
    .ced-rv-form {
        padding: 26px 20px;
    }
    .ced-rv-formwrap {
        padding: 40px 16px;
    }
    .ced-rv-star-btn svg {
        width: 34px;
        height: 34px;
    }
    .ced-rv-summary {
        gap: 22px;
        padding: 22px;
    }
    .ced-rv-cphoto {
        width: 220px;
    }
    .ced-rv-carousel-prev { left: 2px; }
    .ced-rv-carousel-next { right: 2px; }
}
