/**
 * Custom Review System - Mobile First Approach
 * Base: 320px+ (Mobile)
 * Star selection colors fixed
 */

/* ============================================
   MOBILE BASE STYLES (320px+)
   ============================================ */

/* Main Comments Container - Mobile */
#comments {
    display: flex !important;
    width: 100% !important;
    flex-direction: column !important;
    align-items: start;
    gap: 20px !important;
    justify-content: start;
}

/* Tabs Navigation - Mobile */
.woocommerce-tabs ul.tabs {
    padding: 0;
    margin: 0 0 20px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.woocommerce-tabs ul.tabs li {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.woocommerce-tabs ul.tabs li a {
    padding: 10px 12px;
    display: block;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.woocommerce-tabs ul.tabs li.active a {
    color: #C17A3C;
    border-bottom-color: #C17A3C;
}

.woocommerce-tabs ul.tabs li a:hover {
    color: #C17A3C;
}

/* Rating Summary Box - Mobile */
.woocommerce-Reviews-summary {
    background: #F9F5F0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
}

.woocommerce-Reviews-summary .average-rating {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    line-height: 1;
}

.woocommerce-Reviews-summary .star-rating {
    font-size: 14px;
    margin: 0 auto 12px;
}

.woocommerce-Reviews-summary .total-reviews {
    color: #666;
    font-size: 13px;
    margin-bottom: 18px;
}

.woocommerce-Reviews-summary .write-review-btn {
    background: #b87939;
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-block;
}

.woocommerce-Reviews-summary .write-review-btn:hover {
    background: #8f5d27;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 122, 60, 0.3);
}

/* Reviews List Container - Mobile */
.woocommerce-Reviews-list-container {
    width: 100%;
}

/* Individual Review Cards - Mobile */
.woocommerce-Reviews-list .review {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.woocommerce-Reviews-list .review:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* Pending Review Notice - Mobile */
.review-pending {
    border: 2px solid #FFA500 !important;
    background: #FFF9E6;
}

.pending-notice {
    background: #FFA500;
    color: #fff;
    padding: 10px 15px;
    margin: -15px -15px 15px -15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.pending-notice .pending-icon {
    font-size: 16px;
}

.pending-notice strong {
    font-weight: 600;
}

/* Reviewer Info - Mobile */
.review-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reviewer-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #C17A3C;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.reviewer-info {
    flex: 1;
    min-width: 0;
}

.reviewer-name {
    font-weight: 700;
    color: #333;
    font-size: 14px;
    margin: 0 0 4px;
}

.review-date {
    color: #999;
    font-size: 12px;
}

.review-rating {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
}

.review-rating .star-rating {
    font-size: 14px;
}

/* Review Text - Mobile */
.review-text {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.review-text p {
    margin: 0;
}

/* Verified Badge - Mobile */
.verified-badge {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Star Rating System - FIXED COLORS */
.star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 5.4em;
    font-family: star;
    font-weight: 400;
}

.star-rating:before {
    content: "★★★★★";
    color: #ddd;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.star-rating span:before {
    content: "★★★★★";
    top: 0;
    position: absolute;
    left: 0;
    color: #FFB800;
}

/* Popup Modal - Mobile */
.review-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    padding: 15px;
}

.review-popup-overlay.active {
    display: flex;
}

.review-popup-content {
    background: #fff;
    border-radius: 10px;
    padding: 25px 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.review-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.review-popup-close:hover {
    transform: rotate(360deg);
}

.review-popup-content h3 {
    color: #333;
    font-size: 22px;
    margin: 0 0 20px;
    font-weight: 700;
    padding-right: 30px;
}

/* Review Form - Mobile with FIXED STAR COLORS */
.popup-review-form .comment-form-rating {
    margin-bottom: 20px;
}

.popup-review-form .comment-form-rating label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

/* FIXED: Star Selection Colors */
.popup-review-form .stars {
    display: flex;
    gap: 6px;
    align-items: center;
}

.popup-review-form .stars a {
    font-size: 28px;
    color: #ddd !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.popup-review-form .stars a:hover {
    color: #FFB800 !important;
    transform: scale(1.1);
}

.popup-review-form .stars a.active {
    color: #FFB800 !important;
    transform: scale(1.05);
}



/* Form Fields - Mobile */
.popup-review-form .comment-form-comment,
.popup-review-form .comment-form-author,
.popup-review-form .comment-form-email {
    margin-bottom: 15px;
}

.popup-review-form label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.popup-review-form label .required {
    color: #ff0000;
}

.popup-review-form input[type="text"],
.popup-review-form input[type="email"],
.popup-review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.popup-review-form input[type="text"]:focus,
.popup-review-form input[type="email"]:focus,
.popup-review-form textarea:focus {
    border-color: #C17A3C;
    outline: none;
    box-shadow: 0 0 0 3px rgba(193, 122, 60, 0.1);
}

.popup-review-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* Form Buttons - Mobile */
.popup-review-form .form-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.popup-review-form .cancel-btn,
.popup-review-form .form-submit input[type="submit"] {
    width: 100%;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-size: 13px;
}

.popup-review-form .cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.popup-review-form .cancel-btn:hover {
    background: #e5e5e5;
}

.popup-review-form .form-submit {
    width: 100%;
    margin: 0;
}

.popup-review-form .form-submit input[type="submit"] {
    background: #C17A3C;
    color: #fff;
    width: 100%;
}

.popup-review-form .form-submit input[type="submit"]:hover {
    background: #A66932;
    transform: translateY(-2px);
}

/* ============================================
   SMALL MOBILE (380px+)
   ============================================ */
@media (min-width: 380px) {
    .review-popup-content h3 {
        font-size: 24px;
    }

    .popup-review-form .stars a {
        font-size: 30px;
    }
}

/* ============================================
   LARGE MOBILE (480px+)
   ============================================ */
@media (min-width: 480px) {
    #comments {
        gap: 22px !important;
    }

    .woocommerce-tabs ul.tabs {
        margin: 0 0 22px;
        gap: 10px;
    }

    .woocommerce-tabs ul.tabs li a {
        padding: 11px 14px;
        font-size: 13px;
    }

    .woocommerce-Reviews-summary {
        padding: 22px;
        margin-bottom: 22px;
    }

    .woocommerce-Reviews-summary .average-rating {
        font-size: 38px;
    }

    .woocommerce-Reviews-summary .write-review-btn {
        padding: 11px 32px;
        font-size: 14px;
    }

    .woocommerce-Reviews-list .review {
        padding: 18px;
        margin-bottom: 18px;
    }

    .reviewer-avatar {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .reviewer-name {
        font-size: 15px;
    }

    .review-text {
        font-size: 14px;
        line-height: 1.7;
    }

    .review-popup-content {
        padding: 30px 25px;
    }

    .popup-review-form .stars a {
        font-size: 32px;
        gap: 8px;
    }
}

/* ============================================
   TABLET - Small (640px+)
   ============================================ */
@media (min-width: 640px) {
    .woocommerce-Reviews-summary {
        padding: 25px;
    }

    .woocommerce-Reviews-summary .average-rating {
        font-size: 42px;
    }

    .woocommerce-Reviews-list .review {
        padding: 20px;
    }

    .review-rating {
        margin-left: auto;
        margin-top: 0;
        width: auto;
    }

    .popup-review-form .form-buttons {
        flex-direction: row;
    }

    .popup-review-form .cancel-btn,
    .popup-review-form .form-submit input[type="submit"] {
        flex: 1;
    }
}

/* ============================================
   TABLET - Medium (768px+)
   ============================================ */
@media (min-width: 768px) {
    #comments {
        flex-direction: row !important;
        gap: 25px !important;
    }

    .woocommerce-tabs ul.tabs {
        margin: 0 0 25px;
    }

    .woocommerce-tabs ul.tabs li a {
        padding: 12px 16px;
        font-size: 14px;
        border-bottom: 3px solid transparent;
        letter-spacing: 0.5px;
    }

    .woocommerce-Reviews-summary {
        width: 280px;
        padding: 25px;
        border-radius: 10px;
        margin-bottom: 0;
    }

    .woocommerce-Reviews-summary .average-rating {
        font-size: 44px;
        margin: 0 0 10px;
    }

    .woocommerce-Reviews-summary .star-rating {
        font-size: 16px;
        margin: 0 auto 15px;
    }

    .woocommerce-Reviews-summary .total-reviews {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .woocommerce-Reviews-summary .write-review-btn {
        padding: 12px 35px;
    }

    .woocommerce-Reviews-list-container {
        width: calc(100% - 305px);
        flex: 1;
    }

    .woocommerce-Reviews-list .review {
        padding: 22px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    .woocommerce-Reviews-list .review:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transform: translateY(-2px);
    }

    .pending-notice {
        padding: 12px 18px;
        margin: -22px -22px 20px -22px;
        font-size: 14px;
    }

    .pending-notice .pending-icon {
        font-size: 18px;
    }

    .review-header {
        flex-wrap: nowrap;
    }

    .reviewer-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-right: 15px;
    }

    .reviewer-name {
        font-size: 16px;
        margin: 0 0 5px;
    }

    .review-date {
        font-size: 13px;
    }

    .review-rating .star-rating {
        font-size: 16px;
    }

    .review-text {
        font-size: 15px;
        line-height: 1.8;
    }

    .verified-badge {
        padding: 3px 10px;
        font-size: 11px;
        margin-left: 10px;
    }

    .review-popup-content {
        padding: 35px 30px;
        max-width: 550px;
        border-radius: 12px;
    }

    .review-popup-close {
        top: 20px;
        right: 20px;
        font-size: 28px;
        width: 30px;
        height: 30px;
    }

    .review-popup-content h3 {
        font-size: 26px;
        margin: 0 0 25px;
    }

    .popup-review-form .comment-form-rating {
        margin-bottom: 22px;
    }

    .popup-review-form .comment-form-rating label {
        margin-bottom: 10px;
        font-size: 15px;
    }

    .popup-review-form .stars a {
        font-size: 32px;
    }

    .popup-review-form .comment-form-comment,
    .popup-review-form .comment-form-author,
    .popup-review-form .comment-form-email {
        margin-bottom: 18px;
    }

    .popup-review-form label {
        margin-bottom: 8px;
        font-size: 15px;
    }

    .popup-review-form input[type="text"],
    .popup-review-form input[type="email"],
    .popup-review-form textarea {
        padding: 14px;
        font-size: 15px;
        border-radius: 8px;
    }

    .popup-review-form textarea {
        min-height: 140px;
    }

    .popup-review-form .form-buttons {
        gap: 15px;
        margin-top: 22px;
    }

    .popup-review-form .cancel-btn,
    .popup-review-form .form-submit input[type="submit"] {
        padding: 13px 28px;
        font-size: 14px;
        border-radius: 8px;
    }
}

/* ============================================
   DESKTOP - Medium (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    #comments {
        gap: 30px !important;
    }

    .woocommerce-tabs ul.tabs {
        margin: 0 0 30px;
    }

    .woocommerce-tabs ul.tabs li {
        margin: 0 20px 0 0;
    }

    .woocommerce-tabs ul.tabs li a {
        padding: 15px 20px;
    }

    .woocommerce-Reviews-summary {
        width: 300px;
        padding: 30px;
        margin-bottom: 0;
    }

    .woocommerce-Reviews-summary .average-rating {
        font-size: 48px;
    }

    .woocommerce-Reviews-summary .total-reviews {
        margin-bottom: 25px;
    }

    .woocommerce-Reviews-summary .write-review-btn {
        padding: 12px 40px;
        border-radius: 6px;
    }

    .woocommerce-Reviews-list-container {
        width: calc(100% - 330px);
    }

    .woocommerce-Reviews-list .review {
        padding: 25px;
    }

    .pending-notice {
        padding: 12px 20px;
        margin: -25px -25px 20px -25px;
        font-size: 15px;
    }

    .pending-notice .pending-icon {
        font-size: 20px;
    }

    .review-popup-content {
        padding: 40px;
        max-width: 600px;
    }

    .review-popup-content h3 {
        font-size: 28px;
        margin: 0 0 30px;
    }

    .popup-review-form .comment-form-rating {
        margin-bottom: 25px;
    }

    .popup-review-form input[type="text"],
    .popup-review-form input[type="email"],
    .popup-review-form textarea {
        padding: 15px;
    }

    .popup-review-form textarea {
        min-height: 150px;
    }

    .popup-review-form .form-buttons {
        margin-top: 25px;
    }

    .popup-review-form .cancel-btn,
    .popup-review-form .form-submit input[type="submit"] {
        padding: 14px 30px;
    }
}

/* ============================================
   DESKTOP - Large (1200px+)
   ============================================ */
@media (min-width: 1200px) {
    .woocommerce-Reviews-list-container {
        width: 700px;
    }
}