/* Customer Reviews Popup - Pro Max UI (Premium Glass & Soft UI) */

:root {
    --review-theme: #ff6f00;
    --review-theme-dark: #e65100;
    --review-bg-soft: #f8fafc;
    --review-border: #e2e8f0;
    --review-text-main: #0f172a;
    --review-text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.6);
}

/* Floating Button - Modern Side Tab Design */
.review-toggle-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #d84315 0%, #e65100 100%);
    color: white;
    border: none;
    padding: 24px 12px;
    border-radius: 0;
    /* Squared Tab Look */
    box-shadow: -4px 0 20px rgba(216, 67, 21, 0.3),
        -2px 0 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 9990;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 160px;
    width: 46px;
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.review-toggle-btn:hover {
    padding-right: 18px;
    /* Slide effect */
    background: linear-gradient(135deg, #bf360c 0%, #d84315 100%);
    box-shadow: -6px 0 30px rgba(216, 67, 21, 0.5);
    width: 52px;
}

/* Modal Overlay with Glass Effect */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal Content - Rounded Premium Card */
.review-modal-content {
    background: #ffffff;
    width: 950px;
    max-width: 92vw;
    height: 650px;
    max-height: 85vh;
    border-radius: 0;
    /* Soft UI */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid #fff;
    animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    from {
        transform: translateY(40px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close Button - Circle Style */
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #e2e8f0;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Header - Modern & Clean */
.review-modal-header {
    padding: 30px 40px;
    background: #ffffff;
    border-bottom: 1px solid var(--review-border);
}

.review-modal-header h2 {
    margin: 0;
    color: var(--review-text-main);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #1e293b, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.review-modal-header p {
    margin: 8px 0 0;
    color: var(--review-text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Body Layout */
.review-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--review-bg-soft);
}

/* Left Column: Reviews List */
.reviews-list-container {
    flex: 1.3;
    padding: 30px;
    overflow-y: auto;
    border-right: 1px solid var(--review-border);
}

/* Dedicated Page Override: Allow dropdowns to overflow */
.review-page-section .reviews-list-container,
.review-page-section .write-review-container {
    overflow: visible !important;
    height: auto !important;
    border-right: 1px solid #f0f0f0;
    /* Restore border if needed */
}

.reviews-filter select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 0;
    border: 1px solid var(--review-border);
    background-color: #fff;
    margin-bottom: 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--review-text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: border-color 0.2s;
}

.reviews-filter select:focus {
    outline: none;
    border-color: var(--review-theme);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

/* Review Cards - Floating & Rounded */
.review-item {
    background: white;
    padding: 20px;
    border-radius: 0;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 111, 0, 0.2);
}

.review-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-user {
    font-weight: 700;
    color: var(--review-text-main);
    font-size: 15px;
}

.review-product-badge {
    font-size: 10px;
    background: #fff7ed;
    /* Light orange tint */
    color: #c2410c;
    padding: 4px 10px;
    border-radius: 0;
    /* Pill shape */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stars in Review List */
.review-stars {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
}

.review-stars i {
    font-size: 14px;
    display: inline-block;
}

/* Explicit Coloring for List Stars */
.review-stars i.fas,
.review-stars i.fa-star {
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome", sans-serif;
    font-weight: 900;
    color: #e2e8f0;
    /* Default empty */
}

.review-stars i.fas.filled,
.review-stars i.fa-star.filled {
    color: #fbbf24;
    /* Amber-400 */
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.4));
    /* Subtle glow */
}

.review-stars i.fas::before,
.review-stars i.fa-star::before {
    content: "\f005";
}

.review-text {
    font-size: 14px;
    color: #475569;
    margin: 10px 0;
    line-height: 1.6;
}

.verified-badge {
    font-size: 11px;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-weight: 600;
    background: #f0fdf4;
    padding: 4px 8px;
    border-radius: 0;
    width: fit-content;
}

/* Media Display in Reviews */
.review-media-wrapper {
    margin: 12px 0;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
}

.review-media-wrapper img,
.review-media-wrapper video {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

/* Right Column: Write Form */
.write-review-container {
    flex: 1;
    padding: 40px;
    background: white;
    overflow-y: auto;
}

.write-review-container h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--review-text-main);
    font-size: 20px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--review-border);
    border-radius: 0;
    /* Smooth rounded corners */
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--review-theme);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 111, 0, 0.1);
}

/* File Input Customization */
.file-input {
    padding: 10px;
    border: 2px dashed #cbd5e1;
    background: #f1f5f9;
    cursor: pointer;
}

.file-input:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Star Input - Interactive */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    /* Align left */
    gap: 8px;
    background: #fff;
    padding: 10px;
    border-radius: 0;
    border: 1px solid #f1f5f9;
    width: fit-content;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 32px;
    color: #cbd5e1;
    /* Base gray */
    cursor: pointer;
    margin: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.star-rating label i {
    font-size: 28px;
    transition: transform 0.2s ease;
}

/* Hover & Checked States for Input Stars */
.star-rating label:hover i,
.star-rating label:hover~label i,
.star-rating input:checked~label i {
    color: #fbbf24;
    transform: scale(1.2);
    /* Pop effect */
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: #fbbf24;
}

/* Consistent Font Awesome Rules */
.star-rating label i.fas,
.star-rating label i.fa-star {
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", "FontAwesome", sans-serif;
    font-weight: 900;
}

.star-rating label i.fas::before,
.star-rating label i.fa-star::before {
    content: "\f005";
}

/* Submit Button - Premium Gradient */
.btn-submit-review {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--review-theme) 0%, var(--review-theme-dark) 100%);
    color: white;
    border: none;
    border-radius: 0;
    /* Pill shape */
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 10px 20px -5px rgba(230, 81, 0, 0.4);
}

.btn-submit-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(230, 81, 0, 0.5);
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%);
}

.btn-submit-review:active {
    transform: translateY(1px);
}

/* Scrollbar Customization */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 0;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .review-modal-content {
        flex-direction: column;
        height: 90vh;
        width: 95vw;
        border-radius: 0;
    }

    .review-modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .reviews-list-container {
        flex: none;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--review-border);
        padding: 20px;
    }

    .write-review-container {
        flex: none;
        height: auto;
        min-height: 50%;
        padding: 20px;
    }

    .review-modal-header {
        padding: 20px;
    }

    .review-modal-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .review-toggle-btn {
        height: 120px;
        width: 36px;
        padding: 10px;
        font-size: 10px;
        border-radius: 0;
    }

    .review-toggle-btn:hover {
        width: 42px;
    }

    .review-modal-content {
        height: 95vh;
        width: 100vw;
        border-radius: 0;
        bottom: 0;
        top: auto;
        margin-bottom: 0;
    }

    .close-modal {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
    }
}

/* Rich Dropdown Items */
.rich-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.rich-dropdown-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0;
    /* Squared images */
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.rich-dropdown-item span {
    font-weight: 600;
    color: var(--review-text-main);
}

.rich-dropdown-item:hover {
    background-color: #f8fafc;
}

/* Icon Box for 'All Products' or placeholders */
.rich-icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: var(--review-text-muted);
}

/* Ensure img also uses this box model effectively manually via JS or CSS override if needed */

/* Vertical Stack Polish */
.dropdown-menu li {
    border-bottom: 1px solid #f1f5f9;
    /* Stack separation */
}

.dropdown-menu li:last-child {
    border-bottom: none;
}


/* Active State & Hover Improvements */
.rich-dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    border-left: 3px solid transparent;
    /* Prepare for hover accent */
}

.rich-dropdown-item:hover {
    background-color: #f8fafc;
    border-left-color: var(--review-theme);
    /* Hover accent */
}

.rich-dropdown-item.active {
    background-color: #f0fdf4 !important;
    /* Soft green/theme bg */
    border-left-color: var(--review-theme);
    color: var(--review-text-main) !important;
    /* Keep text dark for readability */
}

.rich-dropdown-item.active::after {
    content: "\f00c";
    /* FontAwesome Check */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: auto;
    /* Push to right */
    color: var(--review-theme);
}


.dropdown-toggle::after {
    display: none !important;
    /* HIde default arrow since we use FA icon */
}

/* Fix Dropdown Toggle Layout - Prevent shifting */
.dropdown-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 54px !important;
    /* Fixed height matches input fields */
    white-space: nowrap;
    overflow: hidden;
}

.dropdown-toggle img {
    border-radius: 0 !important;
    flex-shrink: 0;
}

.dropdown-toggle span {
    text-overflow: ellipsis;
    overflow: hidden;
    margin-right: auto;
}

/* Ensure squared corners for dropdown menu */
.dropdown-menu {
    border-radius: 0;
    border: 1px solid var(--review-border);
    padding: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1050 !important;
    /* Ensure it stays on top */
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--review-theme);
    color: white;
}

.dropdown-item.active img,
.dropdown-item:active img {
    border-color: transparent;
    background: white;
}

.dropdown-item.active span,
.dropdown-item:active span {
    color: white;
}

.product-selector-grid input[type="radio"] {
    display: none;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #f1f5f9;
    border-radius: 0;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.product-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.product-card span {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* Hover State */
.product-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.product-card:hover img {
    transform: scale(1.1);
}

/* Selected State */
.product-selector-grid input:checked+.product-card {
    border-color: #ff6f00;
    background: #fff7ed;
    /* Light orange tint */
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.15);
}

.product-selector-grid input:checked+.product-card span {
    color: #ff6f00;
    font-weight: 700;
}

/* Checkmark badge for selected */
.product-selector-grid input:checked+.product-card::after {
    content: '\2713';
    /* Checkmark */
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6f00;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive adjustment */
@media (max-width: 480px) {
    .product-selector-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-card {
        padding: 10px;
    }

    .product-card img {
        width: 45px;
        height: 45px;
    }

    .product-card span {
        font-size: 11px;
    }
}

/* Global Squared Overrides for this page */
.btn,
.form-control,
.dropdown-toggle,
.dropdown-menu {
    border-radius: 0 !important;
}

/* =========================================
   Enhanced Star Rating (CSS Only)
   ========================================= */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 24px;
    color: #cbd5e1;
    /* Default Gray */
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.3;
    /* Semi-transculent default */
}

/* Hover & Checked States 
   (Leverages row-reverse: hovering a star lights up all 'subsequent' stars which are visually to the left)
*/
.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: #ffc107;
    /* Gold */
    opacity: 1;
    /* Fully visible */
}