/* =============================================================================
   ACME Review Popup — Frontend Styles
   Google Business Profile–inspired review modal
   ============================================================================= */

/* --- Write a Review CTA Button --- */
.acme-write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    font-family: inherit;
    font-size: var(--fs-button, 1rem);
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(26, 115, 232, 0.35);
    transition: all 0.25s ease;
    text-decoration: none;
}
.acme-write-review-btn:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0f3d80 100%);
    box-shadow: 0 4px 18px rgba(26, 115, 232, 0.5);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.acme-write-review-btn .acme-star-icon {
    font-size: var(--fs-lead, 1.125rem);
    color: #FFC107;
    line-height: 1;
}

/* --- Overlay Backdrop --- */
.acme-review-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.acme-review-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* --- Modal Card --- */
.acme-review-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.acme-review-overlay.is-open .acme-review-modal {
    transform: translateY(0) scale(1);
}

/* --- Modal Header --- */
.acme-review-modal__header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.acme-review-modal__title {
    font-size: var(--fs-subsection-title, 1.375rem);
    font-weight: 700;
    color: #202124;
    margin: 0;
    line-height: 1.3;
}
.acme-review-modal__subtitle {
    font-size: var(--fs-meta, 0.875rem);
    color: #5f6368;
    margin: 4px 0 0;
}
.acme-review-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f4;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--fs-lead, 1.125rem);
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.acme-review-modal__close:hover {
    background: #e8eaed;
    color: #202124;
}

/* --- Modal Body --- */
.acme-review-modal__body {
    padding: 24px 32px 32px;
}

/* --- Form Fields --- */
.acme-review-field {
    margin-bottom: 20px;
}
.acme-review-field label {
    display: block;
    font-size: var(--fs-form-label, 0.875rem);
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.acme-review-field input[type="text"],
.acme-review-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #dadce0;
    border-radius: 10px;
    font-size: var(--fs-form-input, 0.875rem);
    color: #202124;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}
.acme-review-field input[type="text"]:focus,
.acme-review-field textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    background: #fff;
}
.acme-review-field input[type="text"]::placeholder,
.acme-review-field textarea::placeholder {
    color: #bdc1c6;
}

/* --- Star Rating Widget --- */
.acme-star-picker-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.acme-star-picker {
    display: flex;
    gap: 6px;
    direction: ltr;
}
.acme-star-picker .acme-star {
    font-size: var(--fs-hero-title, 2.5rem);
    color: #dadce0;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}
.acme-star-picker .acme-star:hover,
.acme-star-picker .acme-star.is-hover,
.acme-star-picker .acme-star.is-active {
    color: #FFC107;
    transform: scale(1.15);
}
.acme-star-label {
    font-size: var(--fs-meta, 0.875rem);
    color: #5f6368;
    min-height: 18px;
    transition: color 0.2s ease;
}
.acme-star-label.has-rating {
    color: #1a73e8;
    font-weight: 600;
}

/* --- Submit Button --- */
.acme-review-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    font-size: var(--fs-button, 1rem);
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    margin-top: 8px;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(26, 115, 232, 0.3);
}
.acme-review-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1557b0 0%, #0f3d80 100%);
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.45);
    transform: translateY(-1px);
}
.acme-review-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* --- Error Message --- */
.acme-review-error {
    display: none;
    background: #fce8e6;
    border: 1px solid #f5c6cb;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: var(--fs-meta, 0.875rem);
    margin-bottom: 16px;
}
.acme-review-error.is-visible {
    display: block;
    animation: acme-shake 0.4s ease;
}

/* --- Success / Thank You State --- */
.acme-review-success {
    display: none;
    text-align: center;
    padding: 32px 24px;
}
.acme-review-success.is-visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: acme-fade-in 0.5s ease;
}
.acme-review-success__icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #34a853, #1e7e34);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: acme-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
.acme-review-success__checkmark {
    font-size: var(--fs-4xl, 2.25rem);
    color: #fff;
    line-height: 1;
}
.acme-review-success__title {
    font-size: var(--fs-subsection-title, 1.375rem);
    font-weight: 700;
    color: #202124;
    margin: 0;
}
.acme-review-success__message {
    font-size: var(--fs-body-sm, 0.875rem);
    color: #5f6368;
    margin: 0;
    line-height: 1.6;
    max-width: 320px;
}
.acme-review-success__close-btn {
    margin-top: 8px;
    padding: 10px 28px;
    background: #f1f3f4;
    color: #3c4043;
    border: none;
    border-radius: 8px;
    font-size: var(--fs-button, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}
.acme-review-success__close-btn:hover {
    background: #e8eaed;
}

/* --- Reviews Display Section (Frontend) --- */
.acme-reviews-section {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}
.acme-reviews-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.acme-reviews-section__title {
    font-size: var(--fs-subsection-title, 1.375rem);
    font-weight: 700;
    color: #202124;
    margin: 0;
}
.acme-reviews-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}
.acme-reviews-avg-score {
    font-size: var(--fs-hero-title, 2.5rem);
    font-weight: 700;
    color: #202124;
    line-height: 1;
}
.acme-reviews-avg-stars {
    color: #FFC107;
    font-size: var(--fs-xl, 1.25rem);
    line-height: 1.2;
}
.acme-reviews-avg-count {
    font-size: var(--fs-meta, 0.875rem);
    color: #5f6368;
}

/* --- Individual Review Cards --- */
.acme-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.acme-review-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.acme-review-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.acme-review-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.acme-review-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8 0%, #8e24aa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-card-title, 1.125rem);
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.acme-review-card__name {
    font-size: var(--fs-body-sm, 0.875rem);
    font-weight: 600;
    color: #202124;
    margin: 0 0 2px;
}
.acme-review-card__date {
    font-size: var(--fs-xs, 0.75rem);
    color: #9aa0a6;
}
.acme-review-card__stars {
    color: #FFC107;
    font-size: var(--fs-body, 1rem);
    margin-bottom: 10px;
    letter-spacing: 1px;
}
.acme-review-card__stars .empty {
    color: #dadce0;
}
.acme-review-card__content {
    font-size: var(--fs-body-sm, 0.875rem);
    color: #3c4043;
    line-height: 1.65;
    margin: 0;
}

/* --- Animations --- */
@keyframes acme-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes acme-pop-in {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes acme-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .acme-review-modal__header,
    .acme-review-modal__body { padding-left: 20px; padding-right: 20px; }
    .acme-star-picker .acme-star { font-size: var(--fs-4xl, 2.25rem); }
    .acme-reviews-grid { grid-template-columns: 1fr; }
}
