/* ==========================================================================
   OTW Testimonials - Frontend Styles
   ========================================================================== */

/* Grid Layout
   ========================================================================== */
.otw-testimonials-wrapper {
    --otw-cols: 3;
    --otw-cols-tablet: 2;
    --otw-cols-mobile: 1;
    --otw-gap: 24px;
    padding-bottom: 30px;
}

.otw-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(var(--otw-cols), 1fr);
    gap: var(--otw-gap);
}

@media (max-width: 1024px) {
    .otw-testimonials-grid {
        grid-template-columns: repeat(var(--otw-cols-tablet), 1fr);
    }
}

@media (max-width: 767px) {
    .otw-testimonials-grid {
        grid-template-columns: repeat(var(--otw-cols-mobile), 1fr);
    }
}

/* Carousel Layout
   ========================================================================== */
.otw-testimonials-carousel .swiper-slide {
    height: auto;
}

.otw-testimonials-carousel .otw-testimonial-card {
    height: 100%;
}

.otw-testimonials-carousel .swiper-button-next,
.otw-testimonials-carousel .swiper-button-prev {
    color: #333;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


.otw-testimonials-carousel .swiper-button-next::after,
.otw-testimonials-carousel .swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
}

.otw-testimonials-carousel .swiper-pagination-bullet-active {
    background: #333;
}

@media (min-width: 1024px) {
    .otw-testimonials-carousel .swiper-button-next {
        right: -50px;
    }
    
    .otw-testimonials-carousel .swiper-button-prev {
        left: -50px;
    }
}

/* Card Base Styles
   ========================================================================== */
.otw-testimonial-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.otw-testimonial-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.otw-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.otw-card__author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.otw-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.otw-card__avatar--small {
    width: 32px;
    height: 32px;
}

.otw-card__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: #4285f4;
}

.otw-card__avatar--fb {
    background: #1877f2;
}

.otw-card__author-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.otw-card__author-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.3;
}

.otw-card__position {
    font-size: 12px;
    color: #6c6c6c;
    line-height: 1.3;
}

.otw-card__date {
    font-size: 12px;
    color: #8c8c8c;
    line-height: 1.3;
}

.otw-card__platform-icon {
    flex-shrink: 0;
    line-height: 1;
}

.otw-card__platform-icon svg {
    display: block;
}

/* Rating Stars
   ========================================================================== */
.otw-card__rating {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
}

.otw-star {
    display: inline-block;
}

.otw-star--filled path {
    fill: #fbbc05;
}

.otw-star--empty path {
    fill: #dadce0;
}

/* Title & Content
   ========================================================================== */
.otw-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.4;
}

.otw-card__content {
    font-size: 14px;
    line-height: 1.6;
    color: #4a4a4a;
    flex-grow: 1;
}

.otw-testimonial-card .otw-card__content p,
.otw-modal__content p {
    margin: 0 0 10px !important;
}

.otw-testimonial-card .otw-card__content p:last-child,
.otw-modal__content p:last-child {
    margin-bottom: 0 !important;
}

.otw-card__footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.otw-card__recommendation {
    font-size: 12px;
    color: #1877f2;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Blank / Other Card
   ========================================================================== */
.otw-card--blank {
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.otw-card__avatar--blank {
    background: #9e9e9e;
}

.otw-card__quote-icon {
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.5;
}

/* Google Card
   ========================================================================== */
.otw-card--google {
    border: 1px solid #e8eaed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.otw-card--google .otw-star--filled path {
    fill: #fbbc05;
}

/* Facebook Card
   ========================================================================== */
.otw-card--facebook {
    border: 1px solid #e4e6eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-top: 3px solid #1877f2;
}

.otw-card--facebook .otw-star--filled path {
    fill: #1877f2;
}

.otw-card--facebook .otw-star--empty path {
    fill: #bec3c9;
}

/* Trustpilot Card
   ========================================================================== */
.otw-card--trustpilot {
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.otw-card--trustpilot .otw-card__rating {
    gap: 4px;
}

.otw-tp-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.otw-tp-star--filled {
    background: #00b67a;
}

.otw-tp-star--filled svg path {
    fill: #fff;
}

.otw-tp-star--empty {
    background: #dcdce6;
}

.otw-tp-star--empty svg path {
    fill: #fff;
}

.otw-tp-star svg {
    width: 16px;
    height: 16px;
}

/* Instagram Card
   ========================================================================== */
.otw-card--instagram {
    position: relative;
    border: 1px solid #e1e1e1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.otw-card--instagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-radius: 12px 12px 0 0;
}

.otw-card--instagram .otw-star--filled path {
    fill: #dc2743;
}

.otw-card--instagram .otw-star--empty path {
    fill: #dadce0;
}

.otw-card__avatar--instagram {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Read-more truncation
   ========================================================================== */
.otw-content-body--clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.otw-testimonials-wrapper .otw-read-more-btn {
    display: inline-block;
    margin-top: 10px;
    background: none!important;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a73e8!important;
    cursor: pointer;
    transition: opacity 0.15s;
    line-height: 1.4;
}

.otw-testimonials-wrapper .otw-read-more-btn:hover,
.otw-testimonials-wrapper .otw-read-more-btn:focus {
    opacity: 0.7;
    color: #1a73e8!important;
    background: none!important;
    
}

/* Modal
   ========================================================================== */
body.otw-modal-open {
    overflow: hidden;
}

.otw-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.otw-modal--open {
    display: flex;
}

.otw-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    animation: otwFadeIn 0.22s ease forwards;
}

.otw-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    animation: otwModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 1;
}

.otw-modal .otw-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f0f1!important;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.otw-modal .otw-modal__close:hover,
.otw-modal .otw-modal__close:focus {
    background: #ddd!important;
    color: #111;
}

.otw-modal__author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.otw-modal__author .otw-card__author-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.otw-modal__content {
    margin-top: 14px;
    flex-grow: unset !important;
}

.otw-modal__body .otw-card__rating {
    margin-bottom: 14px;
}

/* Gallery
   ========================================================================== */
.otw-card__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.otw-gallery__item {
    flex: 0 0 calc(33.33% - 4px);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    display: block;
    cursor: pointer;
}

.otw-testimonial-card .otw-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.otw-gallery__item:hover img {
    transform: scale(1.05);
}

.otw-card__gallery--single .otw-gallery__item {
    flex: 0 0 calc(33.33% - 4px);
    aspect-ratio: 1;
}

/* Load More
   ========================================================================== */
.otw-testimonials-wrapper .otw-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.otw-testimonials-wrapper .otw-load-more-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    line-height: 1.4;
}

.otw-testimonials-wrapper .otw-load-more-btn:hover,
.otw-testimonials-wrapper .otw-load-more-btn:focus {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: #aaa;
    outline: none;
}

.otw-testimonials-wrapper .otw-load-more-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

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

@keyframes otwModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
