/* ==========================================================================
   PISTON TRIBE: REVIEWS ARCHIVE STYLES (FINAL FIX + SHARP STARS)
   ========================================================================== */

/* 1. LAYOUT & CONTAINER */
.page-template-reviews-archive .site-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-top: 40px;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .page-template-reviews-archive .secondary-menu-toggle { display: none !important; }
}

/* 2. GLOBAL PAGE BUTTONS */
.review-button, 
.product-title-and-image a.button,
button[type="submit"],
.page-template-reviews-archive button, 
.page-template-reviews-archive input[type="submit"] {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block;
}

.review-button:hover,
.product-title-and-image a.button:hover {
    background-color: #333 !important;
    border-color: #333 !important;
    color: #fff !important;
}

/* Search Box */
.review-search input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 0;
}
.review-search input:focus { outline: none; border-color: #000; }

/* 3. PAGINATION */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 40px; padding-bottom: 40px; }
.pagination a, .pagination span { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; text-decoration: none; color: #333; border: 1px solid #ddd; background: #fff; font-weight: 600; }
.pagination .current { background: #000; color: #fff; border-color: #000; }


/* ==========================================================================
   4. RESPONSIVE COLUMNS (MOBILE LAYOUT)
   ========================================================================== */
@media screen and (max-width: 768px) {
    .page-template-reviews-archive .site-content,
    .single-product .site-content { 
        padding: 10px !important;
    }

    .product-and-bar-chart { display: flex !important; flex-direction: column !important; }
    .product-title-and-image { display: contents !important; }

    /* Order: Chart -> Details -> Button */
    .rating-and-bar-chart { order: 1 !important; width: 100% !important; padding: 0 !important; margin-bottom: 20px; }
    .product-review-header, .product-title-and-image > div:first-child { order: 2 !important; width: 100%; text-align: center; margin-bottom: 15px; }
    .product-title-and-image .review-button, .product-title-and-image a.button { order: 3 !important; width: 100% !important; display: block; margin: 0 0 25px 0; }

    /* Filters 50/50 */
    .review-filters { display: flex !important; flex-wrap: nowrap !important; justify-content: space-between !important; gap: 10px !important; width: 100% !important; margin-bottom: 20px; }
    .review-filters select, select[name="star_filter"] { width: calc(50% - 5px) !important; flex: 0 0 calc(50% - 5px) !important; height: 45px !important; display: inline-block !important; }
}


/* ==========================================================================
   5. PT MEDIA HUB STYLES (PROTECTED)
   ========================================================================== */
.pt-media-hub { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.pt-media-hub.open { opacity: 1; pointer-events: auto; }
.pt-hub-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); backdrop-filter: blur(8px); }

/* CONTROLS (DESKTOP) */
.pt-media-hub .pt-hub-close { 
    position: fixed; top: 30px; right: 80px; 
    background: rgba(0, 0, 0, 0.5) !important; 
    border: 2px solid rgba(255,255,255,0.2) !important; 
    border-radius: 50% !important; 
    color: #fff !important; 
    width: 60px !important; height: 60px !important; 
    padding: 0 !important;
    cursor: pointer; z-index: 10000000; 
    display: flex; align-items: center; justify-content: center; 
    transition: all 0.2s ease; 
}
.pt-media-hub .pt-hub-close:hover { background: #fff !important; color: #000 !important; transform: scale(1.1); }
.pt-media-hub .pt-hub-close svg { width: 32px; height: 32px; }

/* ARROWS (DESKTOP) */
.pt-media-hub .pt-hub-nav { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: rgba(255,255,255,0.1) !important; 
    border: none !important; 
    border-radius: 50% !important; 
    width: 50px !important; height: 50px !important; 
    color: #fff !important; padding: 0 !important;
    cursor: pointer; z-index: 100; 
    display: flex; align-items: center; justify-content: center; 
    transition: all 0.2s ease; 
}
.pt-media-hub .pt-hub-nav:hover { background: #fff !important; color: #000 !important; }
.pt-media-hub .pt-hub-nav.prev { left: 80px; }
.pt-media-hub .pt-hub-nav.next { right: 80px; }
.pt-media-hub .pt-hub-nav svg { width: 24px; height: 24px; }

/* HUB CONTENT & THUMBS */
.pt-hub-content-wrapper { position: relative; width: 95%; height: 90%; max-width: 1400px; display: flex; flex-direction: row; z-index: 10; background: #000; box-shadow: 0 50px 100px rgba(0,0,0,0.6); overflow: hidden; border-radius: 6px; }
.pt-hub-media-stage { flex: 1; background: #000; display: flex; flex-direction: column; position: relative; height: 100%; overflow: hidden; cursor: grab; user-select: none; }
.pt-hub-media-stage:active { cursor: grabbing; }
#pt-hub-current-media { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding-bottom: 10px; }
#pt-hub-current-media img, #pt-hub-current-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.pt-hub-counter { position: absolute; top: 20px; left: 20px; color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 600; z-index: 20; background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 4px; }
.pt-hub-thumbnails { position: relative; width: 100%; height: 90px; flex: 0 0 90px; background: #0a0a0a; z-index: 20; display: flex; align-items: center; justify-content: center; border-top: 1px solid #333; }
.pt-hub-thumbnails-track { display: flex; gap: 10px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; max-width: 100%; height: 100%; align-items: center; }
.pt-hub-thumbnails-track::-webkit-scrollbar { display: none; } 
.pt-hub-thumb { width: 60px; height: 60px; border-radius: 4px; overflow: hidden; opacity: 0.5; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; flex-shrink: 0; }
.pt-hub-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pt-hub-thumb.active { opacity: 1; border-color: #fff; transform: scale(1.1); }
.pt-hub-details { width: 380px; background: #fff; display: flex; flex-direction: column; padding: 40px; overflow-y: auto; }
.pt-hub-user-meta { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.pt-hub-avatar { width: 48px; height: 48px; background: #000; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.pt-hub-user-info h4 { margin: 0; font-size: 16px; font-weight: 800; color: #000; }
.pt-hub-rating { color: #ffa200; font-size: 13px; margin-top: 4px; }
#pt-hub-date { display: block; font-size: 11px; color: #999; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.pt-hub-review-text h5 { margin: 0 0 10px 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.pt-hub-review-text p { font-size: 15px; line-height: 1.6; color: #444; }
.pt-hub-sidebar-gallery { margin-top: auto; padding-top: 20px; border-top: 1px solid #eee; display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; width: 100%; }
.pt-sidebar-thumb { aspect-ratio: 1 / 1; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: 0.7; background: #f0f0f0; }
.pt-sidebar-thumb.active { opacity: 1; border-color: #000; }
.pt-hub-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: ptSpin 1s linear infinite; z-index: 5; display: none; }
@keyframes ptSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* MOBILE MEDIA HUB */
@media (max-width: 900px) {
    .pt-hub-content-wrapper { flex-direction: column; width: 100%; height: 100%; border-radius: 0; background: #fff; overflow: hidden; }
    .pt-hub-media-stage { flex: 1; width: 100%; height: auto; min-height: 0; background: #000; padding-bottom: 0; display: flex; flex-direction: column; }
    #pt-hub-current-media { flex: 1; min-height: 0; padding-bottom: 0; }
    #pt-hub-current-media img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
    .pt-hub-details { width: 100%; flex: 0 0 auto; max-height: 45vh; padding: 20px; overflow-y: auto; background: #fff; border-top: 1px solid #eee; }
    .pt-hub-sidebar-gallery { display: grid !important; margin-top: 15px; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
    .pt-hub-nav { display: none !important; }

    .pt-media-hub .pt-hub-close {
        top: 15px !important; right: 15px !important; width: 44px !important; height: 44px !important;
        background-color: #ffffff !important; border: 1px solid #ccc !important; border-radius: 50% !important;
        color: #000 !important; z-index: 2147483647 !important; display: flex !important; align-items: center !important; justify-content: center !important;
        -webkit-appearance: none !important; appearance: none !important; box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important; padding: 0 !important; margin: 0 !important;
    }
    .pt-media-hub .pt-hub-close svg { width: 20px !important; height: 20px !important; display: block !important; }

    .pt-hub-thumbnails { display: flex !important; height: 90px !important; flex: 0 0 90px !important; background: #111; padding: 0 !important; z-index: 20; overflow: hidden; }
    .pt-hub-thumbnails-track { display: flex !important; gap: 8px !important; padding: 0 15px !important; width: 100%; overflow-x: scroll !important; -webkit-overflow-scrolling: touch; align-items: center; scrollbar-width: none; }
    .pt-hub-thumbnails-track::-webkit-scrollbar { display: none; }
    .pt-hub-thumb { width: 60px !important; height: 60px !important; flex: 0 0 60px !important; border-radius: 4px; }
}

/* ==========================================================================
   SHARP STAR RATING STYLES (Global)
   ========================================================================== */
.pt-sharp-star-row {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.pt-sharp-star {
    /* Base Size */
    width: 18px; 
    height: 18px;
    background-color: #e0e0e0; /* Grey for empty stars */
    
    /* 🏆 The Magic Shape */
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    flex-shrink: 0;
}

.pt-sharp-star.full {
    background-color: #FFA200; /* Piston Gold */
}

/* Gradient for half-stars */
.pt-sharp-star.half {
    background: linear-gradient(90deg, #FFA200 50%, #e0e0e0 50%);
}