/* DeWonder Google Reviews — frontend styles (mobile-first) */

.dgr-container {
    --dgr-text: #1f2937;
    --dgr-muted: #6b7280;
    --dgr-border: #e5e7eb;
    --dgr-card-bg: #ffffff;
    --dgr-star: #fbbc04;
    --dgr-star-empty: #e0e0e0;
    --dgr-link: #1a73e8;
    --dgr-radius: 12px;
    --dgr-gap: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dgr-text);
    line-height: 1.5;
    box-sizing: border-box;
    max-width: 100%;
}
.dgr-container *,
.dgr-container *::before,
.dgr-container *::after {
    box-sizing: border-box;
}

/* Header */
.dgr-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--dgr-border);
    border-radius: var(--dgr-radius);
    margin-bottom: var(--dgr-gap);
}
.dgr-header-left,
.dgr-header-center,
.dgr-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dgr-header-center {
    flex-direction: column;
    gap: 0.25rem;
}
.dgr-header-label {
    font-weight: 600;
    font-size: 1.25rem;
}
.dgr-header-rating {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
}
.dgr-header-count {
    color: var(--dgr-muted);
    font-size: 1.125rem;
}
.dgr-write-review {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1.25rem;
    background: var(--dgr-link);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    min-height: 44px;
}
.dgr-write-review:hover {
    background: #1765cc;
    color: #fff !important;
}

@media (min-width: 640px) {
    .dgr-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 1.25rem 1.5rem;
    }
    .dgr-header-center {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Stars */
.dgr-stars {
    display: inline-flex;
    gap: 2px;
    vertical-align: middle;
    line-height: 0;
}
.dgr-star {
    position: relative;
    display: inline-block;
    width: var(--dgr-star-size, 16px);
    height: var(--dgr-star-size, 16px);
}
.dgr-star-bg,
.dgr-star-fill svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.dgr-star-bg path {
    fill: var(--dgr-star-empty);
}
.dgr-star-fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: block;
}
.dgr-star-fill svg path {
    fill: var(--dgr-star);
}

/* Cards layout */
.dgr-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--dgr-gap);
}
.dgr-style-list .dgr-cards {
    grid-template-columns: 1fr;
}
@media (min-width: 641px) {
    .dgr-style-grid .dgr-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1025px) {
    .dgr-style-grid .dgr-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card */
.dgr-card {
    background: var(--dgr-card-bg);
    border: 1px solid var(--dgr-border);
    border-radius: var(--dgr-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.dgr-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.dgr-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dgr-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.dgr-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1;
    text-transform: uppercase;
}
.dgr-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dgr-author {
    font-weight: 600;
    font-size: 1.1875rem;
    color: var(--dgr-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.dgr-author:hover {
    text-decoration: underline;
}
.dgr-date {
    font-size: 1rem;
    color: var(--dgr-muted);
}
.dgr-card-g {
    display: inline-flex;
    align-items: center;
    opacity: 0.85;
    flex-shrink: 0;
}
.dgr-card-g .dgr-g-logo {
    width: 18px;
    height: 18px;
}
.dgr-card-stars {
    display: flex;
    align-items: center;
}
.dgr-text {
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--dgr-text);
    border: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.dgr-text::before,
.dgr-text::after {
    content: none;
}
.dgr-text-collapsed .dgr-text-short {
    display: inline;
}
.dgr-text-expanded {
    white-space: pre-wrap;
}
.dgr-readmore {
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--dgr-link);
    font-size: 1.125rem;
    font-weight: 500;
    padding: 0.25rem 0;
    cursor: pointer;
    min-height: 36px;
}
.dgr-readmore:hover,
.dgr-readmore:focus {
    text-decoration: underline;
    outline: none;
}

/* Carousel */
.dgr-carousel-wrapper {
    position: relative;
}
.dgr-style-carousel .dgr-cards {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: var(--dgr-gap);
    padding-bottom: 0.5rem;
}
.dgr-style-carousel .dgr-card {
    flex: 0 0 min(320px, 85%);
    scroll-snap-align: start;
}
.dgr-style-carousel .dgr-cards::-webkit-scrollbar {
    height: 6px;
}
.dgr-style-carousel .dgr-cards::-webkit-scrollbar-thumb {
    background: var(--dgr-border);
    border-radius: 3px;
}
.dgr-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--dgr-border);
    background: #fff;
    color: var(--dgr-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: none;
}
.dgr-carousel-arrow:hover {
    background: #f3f4f6;
}
.dgr-carousel-prev { left: -22px; }
.dgr-carousel-next { right: -22px; }
@media (min-width: 768px) {
    .dgr-carousel-arrow { display: inline-flex; align-items: center; justify-content: center; }
}

/* Footer */
.dgr-footer {
    margin-top: var(--dgr-gap);
    text-align: center;
}
.dgr-powered-by {
    font-size: 0.875rem;
    color: var(--dgr-muted);
    letter-spacing: 0.02em;
}

/* Utilities */
.dgr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
