/**
 * Shopify-Style Reviews CSS
 * Windrel Theme
 */

/* ===========================
   Inline Rating (Title Area)
   =========================== */
.shopify-product-header {
    margin-bottom: 16px;
}

.shopify-inline-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.shopify-stars-inline {
    display: flex;
    gap: 2px;
}

.shopify-stars-inline .shopify-star {
    width: 16px;
    height: 16px;
}

.shopify-stars-inline .shopify-star.filled {
    color: #fbbf24;
}

.shopify-stars-inline .shopify-star.empty {
    color: #d1d5db;
}

.shopify-rating-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.shopify-reviews-count {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shopify-reviews-count:hover {
    color: #111827;
    text-decoration: underline;
}

/* ===========================
   Reviews Section
   =========================== */
.shopify-reviews-section {
    background: #fafafa;
    padding: 60px 0;
    margin: 60px 0;
}

.shopify-reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.shopify-reviews-header {
    text-align: center;
    margin-bottom: 40px;
}

.shopify-reviews-title {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 32px;
}

/* Reviews Summary */
.shopify-reviews-summary {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 60px;
    padding: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .shopify-reviews-summary {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }
}

.shopify-reviews-summary-left {
    text-align: center;
}

.shopify-reviews-big-rating {
    font-size: 56px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 8px;
}

.shopify-reviews-stars-large {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.shopify-star-lg {
    width: 24px;
    height: 24px;
}

.shopify-star-lg.filled {
    color: #fbbf24;
}

.shopify-star-lg.empty {
    color: #d1d5db;
}

.shopify-reviews-based-on {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Rating Bars */
.shopify-reviews-summary-right {
    flex: 1;
    max-width: 300px;
}

.shopify-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shopify-rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopify-rating-bar-label {
    font-size: 13px;
    color: #6b7280;
    width: 50px;
    flex-shrink: 0;
}

.shopify-rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.shopify-rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.shopify-rating-bar-count {
    font-size: 13px;
    color: #6b7280;
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

/* ===========================
   Reviews List
   =========================== */
.shopify-reviews-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .shopify-reviews-list {
        grid-template-columns: 1fr;
    }
}

/* Review Card */
.shopify-review-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shopify-review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shopify-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.shopify-review-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopify-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.shopify-review-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shopify-review-author {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.shopify-review-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #059669;
}

.shopify-review-verified svg {
    width: 14px;
    height: 14px;
}

.shopify-review-date {
    font-size: 13px;
    color: #9ca3af;
}

.shopify-review-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.shopify-review-title {
    margin-left: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.shopify-star-sm {
    width: 16px;
    height: 16px;
}

.shopify-star-sm.filled {
    color: #fbbf24;
}

.shopify-star-sm.empty {
    color: #d1d5db;
}

.shopify-review-content {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.shopify-review-content p {
    margin: 0;
}

/* No Reviews State */
.shopify-no-reviews {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 32px;
}

.shopify-no-reviews-icon {
    margin-bottom: 16px;
}

.shopify-no-reviews-icon svg {
    width: 64px;
    height: 64px;
    color: #d1d5db;
}

.shopify-no-reviews-text {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.shopify-no-reviews-subtext {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ===========================
   Reviews Actions
   =========================== */
.shopify-reviews-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.shopify-btn-show-all-reviews {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shopify-btn-show-all-reviews:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.shopify-btn-show-all-reviews svg {
    width: 16px;
    height: 16px;
}

.shopify-btn-write-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: white;
    color: #111827;
    border: 2px solid #111827;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shopify-btn-write-review:hover {
    background: #f9fafb;
    transform: translateY(-1px);
}

.shopify-btn-write-review svg {
    width: 16px;
    height: 16px;
}

/* ===========================
   Reviews Modal
   =========================== */
.shopify-reviews-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shopify-reviews-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.shopify-reviews-modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.shopify-reviews-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.shopify-reviews-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.shopify-reviews-modal-count {
    font-weight: 400;
    color: #6b7280;
}

.shopify-reviews-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.shopify-reviews-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.shopify-reviews-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Modal Summary */
.shopify-reviews-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 540px) {
    .shopify-reviews-modal-summary {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

.shopify-modal-rating-overview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopify-modal-big-rating {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.shopify-modal-stars {
    display: flex;
    gap: 2px;
}

.shopify-star-md {
    width: 20px;
    height: 20px;
}

.shopify-star-md.filled {
    color: #fbbf24;
}

.shopify-star-md.empty {
    color: #d1d5db;
}

.shopify-modal-review-count {
    font-size: 14px;
    color: #6b7280;
}

/* Filter Dropdown */
.shopify-modal-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shopify-modal-filter label {
    font-size: 14px;
    color: #6b7280;
}

.shopify-reviews-filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.shopify-reviews-filter-select:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Modal Body */
.shopify-reviews-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.shopify-reviews-modal-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Modal Review Card */
.shopify-modal-review-card {
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.shopify-modal-review-card.hidden {
    display: none;
}

.shopify-modal-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.shopify-modal-review-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopify-modal-review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.shopify-modal-review-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shopify-modal-review-author {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.shopify-modal-review-date {
    font-size: 12px;
    color: #9ca3af;
}

.shopify-modal-review-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #059669;
    background: #d1fae5;
    padding: 4px 8px;
    border-radius: 4px;
}

.shopify-modal-review-verified svg {
    width: 14px;
    height: 14px;
}

.shopify-modal-review-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
}

.shopify-modal-review-content {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.shopify-modal-review-content p {
    margin: 0;
}

/* ===========================
   Write Review Modal
   =========================== */
.shopify-write-review-container {
    max-width: 560px;
}

.shopify-review-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shopify-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shopify-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .shopify-form-row {
        grid-template-columns: 1fr;
    }
}

.shopify-form-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.shopify-form-label .required {
    color: #dc2626;
}

.shopify-form-input,
.shopify-form-textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.shopify-form-input:focus,
.shopify-form-textarea:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.shopify-form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Star Rating Input */
.shopify-star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.shopify-star-rating-input input {
    display: none;
}

.shopify-star-rating-input label {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.shopify-star-rating-input label svg {
    width: 32px;
    height: 32px;
    color: #d1d5db;
    transition: color 0.2s ease;
}

.shopify-star-rating-input label:hover svg,
.shopify-star-rating-input label:hover ~ label svg,
.shopify-star-rating-input input:checked ~ label svg {
    color: #fbbf24;
}

.shopify-star-rating-input label:hover {
    transform: scale(1.1);
}

/* Form Actions */
.shopify-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}

.shopify-btn-cancel {
    padding: 12px 24px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shopify-btn-cancel:hover {
    background: #f9fafb;
    color: #111827;
}

.shopify-btn-submit-review {
    padding: 12px 24px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shopify-btn-submit-review:hover {
    background: #1f2937;
}

.shopify-btn-submit-review:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===========================
   Mobile Responsive
   =========================== */
@media (max-width: 768px) {
    .shopify-reviews-section {
        padding: 40px 0;
        margin: 40px 0;
    }
    
    .shopify-reviews-title {
        font-size: 24px;
    }
    
    .shopify-reviews-big-rating {
        font-size: 48px;
    }
    
    .shopify-reviews-modal-container {
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        max-width: 100%;
    }
    
    .shopify-reviews-modal {
        align-items: flex-end;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .shopify-reviews-summary {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
        align-items: center;
        text-align: center;
    }
    
    .shopify-reviews-summary-left {
        width: 100%;
    }
    
    .shopify-reviews-summary-right {
        width: 100%;
        max-width: 100%;
    }
    
    .shopify-rating-bars {
        width: 100%;
    }
    
    .shopify-rating-bar-row {
        gap: 8px;
    }
    
    .shopify-rating-bar-label {
        width: 45px;
        font-size: 12px;
    }
    
    .shopify-rating-bar-count {
        width: 20px;
        font-size: 12px;
    }
}

/* Hide default WooCommerce rating */
.woocommerce-product-rating {
    display: none !important;
}
