/* =========================================
   REVIEWS PAGE (reviews.html)
   page-header/breadcrumbs/page-title are intentionally redefined here
   rather than shared, matching the existing per-page convention (see
   css/account.css, css/product.css, css/blog-page.css, css/about.css,
   css/delivery.css). main.section-padding (not plain .section-padding)
   is deliberate — see the identical note in those files: it out-specifies
   css/responsive.css's mobile ".section-padding { padding-top: 50px }" so
   this page stays tight under the header on mobile too.
   ========================================= */
main.section-padding { padding-top: 10px; padding-bottom: 60px; }

.page-header { padding: 10px 0 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 40px; }
.breadcrumbs {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: #888;
    margin-bottom: 15px; flex-wrap: wrap;
}
.breadcrumbs a { color: #888; transition: 0.3s; }
.breadcrumbs a:hover { color: var(--accent-gold); }
.breadcrumbs i { font-size: 9px; color: #555; }
.breadcrumbs span { color: #ccc; }
.page-title { font-size: clamp(22px, 1.2vw + 17.7px, 32px); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #fff; }
.page-subtitle { color: #999; font-size: 15px; margin-top: 15px; max-width: 600px; line-height: 1.5; }

/* ---- Summary bar: avg rating + the write-a-review form beside it ---- */
/* Plain, no card/background behind it (removed on purpose) - metric on
   the left, form on the right, moved together as one row. */
.reviews-summary {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; margin-bottom: 40px;
}
.rs-left { display: flex; align-items: center; flex-shrink: 0; }
.rs-rating-box { display: flex; flex-direction: column; }
.rs-rating-label { color: #888; font-size: 13px; margin-bottom: 10px; }
.rs-rating-value-row { display: flex; align-items: center; gap: 20px; }
.rs-rating { font-size: 64px; font-weight: 200; color: #fff; line-height: 1; }
.rs-details { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.rs-stars { color: var(--accent-gold); font-size: 20px; letter-spacing: 2px; }
.rs-text { color: #888; font-size: 11px; text-transform: lowercase; letter-spacing: 1px; }

.btn-primary {
    background: var(--accent-gold); color: #000; padding: 16px 40px; font-weight: 500; text-transform: uppercase;
    letter-spacing: 1px; font-size: 13px; border-radius: 4px; transition: 0.3s; cursor: pointer;
    display: inline-block; border: none; outline: none;
}
.btn-primary:hover { background: #fff; }

.rf-group { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
.rf-label { color: #888; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; font-weight: 500; }
.rf-input, .rf-textarea {
    width: 100%; background: #1a1a1a; border: 1px solid #2a2a2a; padding: 15px 20px; color: #fff;
    border-radius: 4px; outline: none; font-size: 15px; font-family: inherit; transition: 0.3s;
}
.rf-textarea { resize: vertical; min-height: 120px; }
.rf-input:focus, .rf-textarea:focus { border-color: var(--accent-gold); background: #000; }
.rf-input--locked { color: var(--accent-gold); border-color: rgba(194,160,93,0.35); cursor: default; }
.rf-input.rf-input--invalid, .rf-textarea.rf-input--invalid { border-color: #d9534f !important; background: rgba(217,83,79,0.08); }
.rf-input.rf-input--invalid:focus, .rf-textarea.rf-input--invalid:focus { border-color: #d9534f; }

/* #formStars isn't an input — no red box/tint for the missing-rating
   case, just a quick one-at-a-time pop through the stars (see
   bounceRatingStars() in product.js). */
@keyframes rf-star-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.4); }
    65% { transform: scale(0.92); }
    100% { transform: scale(1); }
}
.rf-star-pop { display: inline-block; animation: rf-star-pop 0.32s ease; }

@keyframes rf-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}
.rf-shake { animation: rf-shake 0.5s; }
.rf-hint { font-size: 12px; color: #777; margin-top: 8px; line-height: 1.4; }
.rf-rating-select { display: flex; gap: 12px; cursor: pointer; }
.rf-rating-select i { font-size: 24px; color: #333; transition: 0.2s; }
.rf-rating-select i.active, .rf-rating-select i:hover, .rf-rating-select i:hover ~ i { color: var(--accent-gold); }
.rf-submit-wrap { margin-top: 10px; text-align: center; }
.rf-submit-wrap .btn-primary { width: 100%; padding: 16px; font-size: 14px; }

/* ---- Toolbar: results count + sort + grid/list toggle ---- */
.catalog-topbar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
    background: #0a0a0a; border: 1px solid #222; border-radius: 8px; padding: 15px 25px; flex-wrap: wrap; gap: 20px;
}
.catalog-results-count { color: #888; font-size: 13px; }
.catalog-results-count span { color: #fff; font-weight: 500; }
.catalog-controls { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sort-group { display: flex; align-items: center; gap: 15px; }
.sort-label { color: #888; font-size: 13px; }
.sort-buttons { display: flex; border: 1px solid #333; border-radius: 6px; overflow: hidden; background: #0a0a0a; }
.sort-btn { background: transparent; border: none; border-right: 1px solid #333; color: #999; padding: 8px 15px; font-size: 13px; cursor: pointer; transition: 0.3s; }
.sort-btn:last-child { border-right: none; }
.sort-btn:hover, .sort-btn.active { color: var(--accent-gold); background: #151515; }
.view-toggles { display: flex; gap: 5px; background: #111; padding: 4px; border-radius: 6px; border: 1px solid #222; }
.view-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #666; background: transparent; border: none; border-radius: 4px; transition: 0.3s; font-size: 14px; cursor: pointer; }
.view-btn.active, .view-btn:hover { background: #2a2a2a; color: var(--accent-gold); }
.mobile-sort-btn { display: none; background: transparent; border: none; color: var(--accent-gold); font-size: 14px; font-weight: 500; cursor: pointer; align-items: center; gap: 8px; outline: none; }

/* ---- Reviews grid / list ---- */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; transition: opacity 0.3s ease; }
.reviews-grid.fading { opacity: 0; }

.review-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 30px; transition: 0.3s; display: flex; flex-direction: column; }
.review-card:hover { border-color: #333; transform: translateY(-5px); }
.rc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.rc-user { display: flex; align-items: center; gap: 15px; }
.rc-avatar { width: 45px; height: 45px; background: #1a1a1a; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; color: var(--accent-gold); border: 1px solid #333; overflow: hidden; flex-shrink: 0; }
.rc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.rc-user-info { display: flex; flex-direction: column; }
.rc-name { color: #fff; font-weight: 500; font-size: 15px; }
.rc-date { color: #666; font-size: 12px; margin-top: 2px; }
.rc-stars { color: var(--accent-gold); font-size: 12px; }
.rc-body { display: flex; flex-direction: column; flex-grow: 1; }
.rc-text { color: #aaa; font-size: 15px; line-height: 1.7; flex-grow: 1; }
.rc-text.collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.read-more-btn { background: transparent; border: none; color: var(--accent-gold); font-size: 12px; font-weight: 500; cursor: pointer; padding: 5px 0 0 0; text-align: left; transition: 0.3s; display: inline-block; margin-top: 5px; }
.read-more-btn:hover { color: #fff; }
.rc-product { margin-top: 20px; padding-top: 15px; border-top: 1px solid #222; font-size: 12px; color: #666; display: flex; align-items: center; gap: 8px; }
.rc-product i { color: var(--accent-green); }

.reviews-grid.list-view { grid-template-columns: 1fr; gap: 0; }
.reviews-grid.list-view .review-card { flex-direction: column; position: relative; padding: 30px 0 30px 75px; gap: 10px; background: transparent; border: none; border-bottom: 1px solid #222; border-radius: 0; }
.reviews-grid.list-view .review-card:last-child { border-bottom: none; }
.reviews-grid.list-view .review-card:hover { transform: none; border-color: #222; }
.reviews-grid.list-view .rc-header { flex-direction: row; justify-content: flex-start; align-items: center; margin-bottom: 5px; gap: 15px; width: 100%; }
.reviews-grid.list-view .rc-user { gap: 0; }
.reviews-grid.list-view .rc-avatar { position: absolute; left: 0; top: 30px; width: 50px; height: 50px; }
.reviews-grid.list-view .rc-user-info { flex-direction: row; align-items: baseline; gap: 12px; }
.reviews-grid.list-view .rc-name { font-size: 16px; }
.reviews-grid.list-view .rc-date { font-size: 13px; margin-top: 0; }
.reviews-grid.list-view .rc-stars { margin-left: 5px; }
.reviews-grid.list-view .rc-body { flex-grow: 1; }
.reviews-grid.list-view .rc-product { border-top: none; padding-top: 10px; margin-top: 10px; }

/* ---- Pagination ---- */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 40px; margin-bottom: 20px; }

/* Inline "write a review" section - reuses js/pages/product.js's own
   .pr-review-form component (see css/product.css) instead of the old
   modal popup or a toggle button. Sits right in .reviews-summary,
   beside the rating metric - no card/background of its own. */
.pr-reviews-write-section { flex: 1; min-width: 0; max-width: 640px; }
.pr-reviews-write-section .pr-review-form { margin-bottom: 0; }
.pagination {
    display: flex; align-items: center; gap: 4px;
    background: #101010; border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 6px; overflow: visible;
}
.page-btn {
    background: transparent; border: none; border-radius: 8px; color: #888;
    width: 38px; height: 38px; padding: 0; font-size: 14px; font-family: inherit;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
    position: relative;
}
.page-btn:has(.page-text) { width: auto; padding: 0 14px; }
.page-btn:hover:not(.disabled):not(.dots):not(.active) { color: #fff; background: rgba(255,255,255,0.05); }
.page-btn.active { color: var(--accent-gold); font-weight: 500; background: transparent; }
.page-btn.active::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 16px; height: 2px; background: var(--accent-gold); border-radius: 2px;
}
.page-btn.disabled { color: #3a3a3a; cursor: not-allowed; }
.page-btn.dots { cursor: default; pointer-events: none; color: #555; width: auto; padding: 0 4px; }

/* ---- Mobile sort bottom sheet ---- */
.mobile-sort-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0, 0.8); backdrop-filter: blur(5px);
    z-index: 7000; display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s ease;
}
.mobile-sort-overlay.active { opacity: 1; pointer-events: all; }
.mobile-sort-sheet {
    width: 100%; background: #151515; border-radius: 16px 16px 0 0; transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding-bottom: 20px; border-top: 1px solid #333;
}
.mobile-sort-overlay.active .mobile-sort-sheet { transform: translateY(0); }
.ms-header { text-align: center; color: #fff; font-size: 16px; font-weight: 500; padding: 20px; border-bottom: 1px solid #222; }
.ms-option { width: 100%; text-align: left; background: transparent; border: none; padding: 20px 25px; color: #fff; font-size: 15px; border-bottom: 1px solid #222; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; }
.ms-option:active { background: #222; }
.ms-option.active { color: var(--accent-gold); }
.ms-option.active::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }

@media (max-width: 1024px) {
    .reviews-grid { grid-template-columns: repeat(2, 1fr); }
    .reviews-grid.list-view .review-card { padding: 25px 0 25px 65px; }
    .reviews-grid.list-view .rc-avatar { left: 0; top: 25px; width: 45px; height: 45px; }
}

@media (max-width: 600px) {

    .reviews-summary { flex-direction: column; align-items: stretch; gap: 25px; }
    .rs-left { flex-direction: column; align-items: flex-start; gap: 25px; width: 100%; }
    .pr-reviews-write-section { max-width: none; }

    .reviews-grid { grid-template-columns: 1fr; gap: 0; }
    .review-card { background: transparent; border: none; border-bottom: 1px solid #222; border-radius: 0; padding: 25px 0; }
    .review-card:last-child { border-bottom: none; }
    .review-card:hover { transform: none; border-color: #222; }

    .reviews-grid.list-view .review-card { padding: 25px 0 25px 60px; }
    .reviews-grid.list-view .rc-avatar { left: 0; top: 25px; width: 45px; height: 45px; }
    .reviews-grid.list-view .rc-header { flex-wrap: wrap; gap: 8px; }

    .catalog-topbar { flex-direction: row; align-items: center; justify-content: space-between; }
    .catalog-controls { display: none !important; }
    .mobile-sort-btn { display: flex; }

    .pagination { flex-wrap: nowrap; justify-content: center; padding: 6px; gap: 2px; }
    .page-btn { width: 34px; height: 34px; font-size: 13px; margin-bottom: 0; }
    .page-btn:has(.page-text) { padding: 0 12px; }
    .page-text { display: none; }
}
