/**
 * CBF Product Sections — Styles
 * Brand: #97aa82 / #FFFFFF / #f8f8f8 / #000000
 */

/* ══════════════════════════════════════════════
   BASE / RESET
   ══════════════════════════════════════════════ */

.cbf-product-sections {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.cbf-product-sections *,
.cbf-product-sections *::before,
.cbf-product-sections *::after {
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════
   ICONS (WordPress Dashicons + Text Arrows)
   ══════════════════════════════════════════════ */

/* Section title icons */
.cbf-section-icon {
    color: #97aa82;
    font-size: 22px;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Write review button icon */
.cbf-btn-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Carousel text arrows */
.cbf-carousel-arrow {
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 2px;
}

/* Toggle chevron (dashicons arrow) */
.cbf-toggle-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    display: inline-block;
    vertical-align: middle;
}

.cbf-read-more-btn[aria-expanded="true"] .cbf-toggle-icon {
    transform: rotate(180deg);
}

/* Verified badge icon */
.cbf-verified-icon {
    color: #97aa82;
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Upload area icon */
.cbf-upload-icon {
    color: #97aa82;
    font-size: 36px;
    width: 36px;
    height: 36px;
}

/* Star ratings (review display) */
.cbf-star {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.cbf-star-full {
    color: #f0a500;
}

.cbf-star-half-icon {
    color: #f0a500;
}

.cbf-star-empty {
    color: #d4d4d4;
}

/* Star rating input (form) */
.cbf-star-input-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #d4d4d4;
    transition: color 0.15s ease;
}

.cbf-star-btn.active .cbf-star-input-icon,
.cbf-star-btn.hover .cbf-star-input-icon {
    color: #f0a500;
}

/* ══════════════════════════════════════════════
   SECTION BASE
   ══════════════════════════════════════════════ */

.cbf-section {
    margin-bottom: 0;
}

.cbf-section-inner {
    background: #ffffff;
    border: 1px solid #e8ede3;
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.cbf-section-inner:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cbf-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding: 0;
    letter-spacing: -0.3px;
}

/* ══════════════════════════════════════════════
   DESCRIPTION SECTION
   ══════════════════════════════════════════════ */

.cbf-desc-content {
    color: #444;
    font-size: 15.5px;
    line-height: 1.75;
}

.cbf-desc-content p {
    margin: 0 0 12px 0;
}

.cbf-desc-content p:last-child {
    margin-bottom: 0;
}

.cbf-desc-formatted {
    color: #444;
    font-size: 15.5px;
    line-height: 1.75;
}

.cbf-desc-formatted p {
    margin: 0 0 14px 0;
}

.cbf-desc-formatted h2,
.cbf-desc-formatted h3,
.cbf-desc-formatted h4 {
    color: #1a1a1a;
    margin: 20px 0 10px 0;
}

.cbf-desc-formatted ul,
.cbf-desc-formatted ol {
    margin: 10px 0 14px 20px;
    padding: 0;
}

.cbf-desc-formatted li {
    margin-bottom: 6px;
}

/* Full description — animated */
.cbf-desc-full {
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.4s ease;
}

.cbf-desc-full.cbf-expanding {
    opacity: 1;
}

.cbf-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 0;
    background: none;
    border: none;
    color: #97aa82;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, gap 0.2s ease;
}

.cbf-read-more-btn:hover {
    color: #7d9466;
    gap: 9px;
}

/* ══════════════════════════════════════════════
   REVIEWS SECTION
   ══════════════════════════════════════════════ */

.cbf-reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.cbf-reviews-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbf-rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cbf-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.cbf-rating-text {
    font-size: 14.5px;
    color: #666;
    font-weight: 500;
}

.cbf-review-count {
    color: #999;
    font-weight: 400;
}

/* ══════════════════════════════════════════════
   CAROUSEL
   ══════════════════════════════════════════════ */

.cbf-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cbf-carousel-viewport {
    overflow: hidden;
    flex: 1;
    border-radius: 12px;
}

.cbf-carousel-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
    gap: 16px;
    will-change: transform;
}

.cbf-review-card {
    flex: 0 0 calc(25% - 12px);
    min-width: 0;
}

.cbf-review-card-inner {
    background: #f8f8f8;
    border: 1px solid #eeeeee;
    border-radius: 14px;
    padding: 22px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cbf-review-card-inner:hover {
    border-color: #d4dfc9;
    box-shadow: 0 4px 16px rgba(151, 170, 130, 0.1);
}

/* Stars in cards */
.cbf-review-stars {
    display: flex;
    align-items: center;
    gap: 1px;
}

/* Meta */
.cbf-review-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.cbf-review-author {
    font-weight: 600;
    color: #1a1a1a;
}

.cbf-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #97aa82;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.cbf-review-date {
    color: #999;
    font-size: 12.5px;
}

/* Review text */
.cbf-review-text-wrap {
    flex: 1;
}

.cbf-review-text {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

.cbf-review-read-more {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    color: #97aa82;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cbf-review-read-more:hover {
    color: #7d9466;
    text-decoration: underline;
}

/* Review images */
.cbf-review-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.cbf-review-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cbf-review-img:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Carousel arrows */
.cbf-carousel-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #d4dfc9;
    background: #fff;
    color: #97aa82;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.cbf-carousel-arrow:hover {
    background: #97aa82;
    color: #fff;
    border-color: #97aa82;
}

.cbf-carousel-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f5f5f5;
}

.cbf-carousel-arrow:disabled:hover {
    background: #f5f5f5;
    color: #97aa82;
    border-color: #d4dfc9;
}

/* Dots */
.cbf-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.cbf-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4dfc9;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cbf-carousel-dot.active {
    background: #97aa82;
    width: 24px;
    border-radius: 4px;
}

/* No reviews */
.cbf-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* ══════════════════════════════════════════════
   WRITE A REVIEW
   ══════════════════════════════════════════════ */

.cbf-write-review-wrapper {
    margin-top: 28px;
    text-align: center;
}

.cbf-write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    background: #97aa82;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(151, 170, 130, 0.25);
}

.cbf-write-review-btn:hover {
    background: #889b73;
    box-shadow: 0 4px 16px rgba(151, 170, 130, 0.35);
    transform: translateY(-1px);
}

.cbf-review-login-msg {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-top: 10px;
}

.cbf-review-login-msg a {
    color: #97aa82;
    font-weight: 600;
    text-decoration: none;
}

.cbf-review-login-msg a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════
   REVIEW FORM
   ══════════════════════════════════════════════ */

.cbf-review-form-container {
    max-width: 640px;
    margin: 20px auto 0;
    text-align: left;
    animation: cbfSlideDown 0.35s ease forwards;
}

@keyframes cbfSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cbf-review-form {
    background: #f8f8f8;
    border: 1px solid #e8ede3;
    border-radius: 14px;
    padding: 28px 28px 24px;
}

.cbf-form-group {
    margin-bottom: 18px;
}

.cbf-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 7px;
}

.cbf-required {
    color: #d14;
}

.cbf-optional {
    color: #999;
    font-weight: 400;
    font-size: 12.5px;
}

.cbf-review-form input[type="text"],
.cbf-review-form input[type="email"],
.cbf-review-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14.5px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.cbf-review-form input[type="text"]:focus,
.cbf-review-form input[type="email"]:focus,
.cbf-review-form textarea:focus {
    border-color: #97aa82;
    box-shadow: 0 0 0 3px rgba(151, 170, 130, 0.15);
}

.cbf-review-form textarea {
    resize: vertical;
    min-height: 100px;
}

.cbf-form-row {
    display: flex;
    gap: 16px;
}

.cbf-form-half {
    flex: 1;
}

/* Star input */
.cbf-star-input {
    display: flex;
    gap: 4px;
}

.cbf-star-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.cbf-star-btn:hover {
    transform: scale(1.2);
}

/* Upload area */
.cbf-upload-area {
    border: 2px dashed #d4dfc9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.cbf-upload-area:hover,
.cbf-upload-area.dragover {
    border-color: #97aa82;
    background: rgba(151, 170, 130, 0.04);
}

.cbf-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 14px;
}

.cbf-upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.cbf-upload-previews:empty {
    margin-top: 0;
}

.cbf-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.cbf-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbf-preview-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Form actions */
.cbf-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.cbf-cancel-btn {
    padding: 11px 24px;
    background: #fff;
    color: #666;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cbf-cancel-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.cbf-submit-btn {
    padding: 11px 28px;
    background: #97aa82;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(151, 170, 130, 0.2);
}

.cbf-submit-btn:hover {
    background: #889b73;
}

.cbf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form message */
.cbf-form-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.cbf-form-message.success {
    background: #f0f5ec;
    color: #5a7a42;
    border: 1px solid #d4dfc9;
}

.cbf-form-message.error {
    background: #fef2f2;
    color: #c53030;
    border: 1px solid #fcd5d5;
}

/* ══════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════ */

.cbf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: pointer;
    animation: cbfFadeIn 0.2s ease;
}

@keyframes cbfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cbf-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    cursor: default;
}

.cbf-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cbf-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

/* Tablet — 3 cards */
@media (max-width: 1024px) {
    .cbf-review-card {
        flex: 0 0 calc(33.333% - 11px);
    }

    .cbf-section-inner {
        padding: 28px 28px;
    }
}

/* Small Tablet — 2 cards */
@media (max-width: 768px) {
    .cbf-review-card {
        flex: 0 0 calc(50% - 8px);
    }

    .cbf-carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .cbf-section-inner {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .cbf-section-title {
        font-size: 19px;
    }

    .cbf-reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cbf-form-row {
        flex-direction: column;
        gap: 0;
    }

    .cbf-review-form {
        padding: 22px 18px 18px;
    }
}

/* Mobile — 1 card */
@media (max-width: 520px) {
    .cbf-product-sections {
        padding: 0 12px;
    }

    .cbf-review-card {
        flex: 0 0 100%;
    }

    .cbf-carousel-arrow {
        display: none;
    }

    .cbf-carousel-viewport {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cbf-carousel-viewport::-webkit-scrollbar {
        display: none;
    }

    .cbf-review-card {
        scroll-snap-align: center;
    }

    .cbf-carousel-track {
        transition: none;
    }

    .cbf-section-inner {
        padding: 20px 16px;
    }

    .cbf-form-actions {
        flex-direction: column;
    }

    .cbf-form-actions button {
        width: 100%;
    }
}
