/* ── TrangHay Theme – Extras CSS ── */

/* ── Back To Top ── */
.tht-back-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(255, 45, 120, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: all .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tht-back-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.tht-back-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 45, 120, 0.45);
}

/* ── Lightbox ── */
.tht-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tht-lb-bg {
  position: absolute;
  inset: 0;
  background: rgba(26, 0, 16, 0.94);
  backdrop-filter: blur(8px);
}

.tht-lb-wrap {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 90vh;
}

.tht-lb-wrap img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.tht-lb-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  background: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  transition: all .2s;
}

.tht-lb-close:hover {
  background: var(--p1);
  color: #fff;
}

/* ── Plugin card overrides to match theme ── */

/* Card */
.the-card {
  background: var(--card);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  box-shadow: var(--sh);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  overflow: hidden;
}

.the-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-hover);
  border-color: var(--p2);
}

.the-card-a { display: flex; flex-direction: column; height: 100%; color: var(--text); }

.the-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--dark2);
  flex-shrink: 0;
}

.the-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.the-card:hover .the-card-media img { transform: scale(1.05); }

.the-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.the-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--p1);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
  display: block;
}

.the-card-title {
  font-family: var(--ff-h);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.the-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.the-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.the-card-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--p1);
  white-space: nowrap;
}

.the-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Date bubble */
.the-date-bubble {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(26, 0, 16, .82);
  backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 9px;
  padding: 5px 10px;
  text-align: center;
  line-height: 1.15;
}

.the-day {
  display: block;
  font-size: 20px;
  font-weight: 900;
  font-family: var(--ff-h);
}

.the-mon {
  display: block;
  font-size: 11px;
  opacity: .75;
}

/* Free tag */
.the-free-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #16a34a;
  color: #fff;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* Avatar */
.the-avatar {
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--ff-h);
  flex-shrink: 0;
}

/* Price */
.the-price { font-weight: 700; color: var(--p1); font-size: 14px; }
.the-free { color: #16a34a; }
.the-contact { color: var(--muted); }

/* Badge */
.the-badge { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.the-badge-hot  { background: #ff2d78; color: #fff; }
.the-badge-new  { background: #16a34a; color: #fff; }
.the-badge-sell { background: #f97316; color: #fff; }
.the-badge-free { background: #22c55e; color: #fff; }
.the-badge-warn { background: #eab308; color: #1a0010; }
.the-badge-soon { background: #3b82f6; color: #fff; }

/* Grid */
.the-grid { display: grid; gap: 18px; }
.the-grid-4 { grid-template-columns: repeat(4, 1fr); }
.the-grid-3 { grid-template-columns: repeat(3, 1fr); }
.the-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Hero & section overrides */
.the-hero {
  position: relative;
  padding: 56px 20px 48px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 0;
}

.the-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--dark), var(--dark2));
}

.the-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 45, 120, .28), transparent 70%);
}

.the-hero-content { position: relative; z-index: 1; padding: 0 20px; }

.the-hero-h1 {
  color: #fff;
  font-size: clamp(26px, 4.5vw, 46px);
  margin-bottom: 10px;
  font-family: var(--ff-h);
}

.the-hero-h1 span { color: var(--p1); }
.the-hero-sub { color: rgba(255,255,255,.75); margin-bottom: 22px; font-size: 15px; }

.the-hero-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.28);
  max-width: 700px;
  margin: 0 auto;
}

.the-hero-bar > span { padding: 0 14px; font-size: 20px; flex-shrink: 0; }

.the-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--ff-b);
  font-size: 15px;
  padding: 14px 8px;
  background: transparent;
  min-width: 0;
}

.the-hs-select {
  border: none;
  border-left: 1px solid var(--border);
  outline: none;
  padding: 0 12px;
  font-family: var(--ff-b);
  font-size: 13px;
  background: transparent;
  cursor: pointer;
  height: 50px;
  min-width: 130px;
}

.the-hero-bar button {
  background: var(--grad);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--ff-h);
  cursor: pointer;
  transition: opacity .2s;
  white-space: nowrap;
}

.the-hero-bar button:hover { opacity: .9; }

.the-hero-post-btn {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 14px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 2px;
}

.the-hero-post-btn:hover { color: #fbbf24; border-color: #fbbf24; }

/* Category grid */
.the-cats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.the-cat-item {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--sh);
  transition: all .22s;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.the-cat-item:hover { border-color: var(--p1); transform: translateY(-3px); box-shadow: var(--sh-hover); }
.the-cat-ico { font-size: 28px; }
.the-cat-nm { font-size: 12.5px; font-weight: 700; color: var(--text); }
.the-cat-cnt { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 7px; border-radius: 10px; }

/* Submit banner */
.the-submit-banner {
  background: var(--grad-dark);
  border-radius: var(--r);
  padding: 26px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
}

.the-submit-banner::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  right: -40px;
  top: -40px;
}

.the-submit-banner > span { font-size: 44px; position: relative; z-index: 1; }

.the-submit-banner div { flex: 1; min-width: 180px; position: relative; z-index: 1; }
.the-submit-banner h3 { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.the-submit-banner p { font-size: 13px; color: rgba(255,255,255,.72); }

.the-sb-btn {
  background: #fff;
  color: var(--p1);
  padding: 11px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  font-family: var(--ff-h);
  transition: all .2s;
}

.the-sb-btn:hover { background: #fff0f6; }

/* Section headers */
.the-sec-hdr, .the-section-hdr, .the-home-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.the-sec-hdr h2, .the-section-hdr h2, .the-home-hdr h2 {
  font-family: var(--ff-h);
  font-size: 19px;
  font-weight: 800;
}

.the-sec-hdr a, .the-section-hdr a, .the-home-hdr a {
  color: var(--p1);
  font-weight: 700;
  font-size: 13px;
}

/* Home sections */
.the-home-sec { margin-bottom: 38px; }

/* Archive layout */
.the-archive-head { margin-bottom: 20px; }
.the-archive-head h1 { font-size: clamp(20px, 3vw, 30px); font-weight: 900; font-family: var(--ff-h); }
.the-archive-head p { font-size: 14px; color: var(--muted); margin-top: 5px; }

.the-search-bar-wrap { margin-bottom: 20px; }

.the-search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 540px;
  box-shadow: var(--sh);
}

.the-search-bar > span { padding: 0 12px; font-size: 18px; flex-shrink: 0; }
.the-search-bar .the-search-input { padding: 11px 8px; }

.the-archive-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.the-archive-main { min-width: 0; }

.the-archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.the-count { font-size: 13px; font-weight: 600; color: var(--muted); }

.the-filter-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: var(--ff-b);
  font-size: 13px;
  outline: none;
  background: #fff;
  cursor: pointer;
}

/* Filter sidebar */
.the-filter-sidebar {
  background: var(--card);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 18px;
  box-shadow: var(--sh);
  position: sticky;
  top: 80px;
}

.the-filter-group { margin-bottom: 18px; }
.the-filter-group:last-child { margin-bottom: 0; }
.the-filter-group h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }

.the-filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: color .2s;
}

.the-filter-check:hover { color: var(--p1); }
.the-filter-check input { accent-color: var(--p1); width: 15px; height: 15px; cursor: pointer; }

.the-filter-btn-apply {
  width: 100%;
  background: var(--grad);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-family: var(--ff-h);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 6px;
}

.the-filter-btn-apply:hover { opacity: .9; }

/* ── Responsive grid overrides ── */
@media (max-width: 1100px) {
  .the-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .the-cats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .the-archive-layout { grid-template-columns: 1fr; }
  .the-filter-sidebar { position: static; }
}

@media (max-width: 768px) {
  .the-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .the-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .the-cats-grid { grid-template-columns: repeat(3, 1fr); }
  .the-hero-bar { flex-wrap: wrap; }
  .the-hs-select { border-left: none; border-top: 1px solid var(--border); width: 100%; height: 44px; }
}

@media (max-width: 480px) {
  .the-grid-4, .the-grid-3 { grid-template-columns: 1fr; }
  .the-cats-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ══════════════════════════════════════
   REVIEW SYSTEM
══════════════════════════════════════ */

/* Hero rating badge */
.the-hero-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 5px 14px;
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255,255,255,.9);
    font-weight: 600;
}

.the-hero-rating .tht-star-on { color: #fbbf24; font-size: 14px; }
.the-hero-rating .tht-star-off { color: rgba(255,255,255,.3); font-size: 14px; }
.the-hero-rating .tht-star-half { color: #fbbf24; font-size: 14px; }
.the-hero-rating-sep { opacity: .4; }

/* Reviews section wrapper */
.tht-reviews-section h2 {
    margin-bottom: 18px;
}

/* Rating summary */
.tht-review-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff0f6, #fff8fb);
    border-radius: 12px;
    border: 1.5px solid var(--border);
    margin-bottom: 24px;
}

.tht-review-big-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tht-big-num {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--ff-h);
    color: var(--p1);
    line-height: 1;
}

.tht-summary-stars {
    display: flex;
    gap: 2px;
}

.tht-summary-stars .tht-star-on  { color: #fbbf24; font-size: 20px; }
.tht-summary-stars .tht-star-half { color: #fbbf24; font-size: 20px; }
.tht-summary-stars .tht-star-off  { color: #e5e7eb; font-size: 20px; }

.tht-summary-count {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* Rating summary inline for sidebar */
.tht-rating-summary {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
    text-align: center;
}

.tht-rating-big { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tht-rating-num { font-size: 28px; font-weight: 700; color: var(--p1); font-family: var(--ff-h); }
.tht-rating-stars { display: flex; gap: 2px; }
.tht-rating-stars .tht-star-on  { color: #fbbf24; font-size: 16px; }
.tht-rating-stars .tht-star-half { color: #fbbf24; font-size: 16px; }
.tht-rating-stars .tht-star-off  { color: #e5e7eb; font-size: 16px; }
.tht-rating-total { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ── Review form ── */
.tht-review-form-wrap {
    background: linear-gradient(135deg, #fff8fb, #fff0f6);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 28px;
}

.tht-review-form-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.tht-review-anon-note {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Star picker */
.tht-star-picker {
    margin-bottom: 18px;
}

.tht-star-pick-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.tht-star-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tht-pick-star {
    background: none;
    border: none;
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    padding: 2px;
    transition: color .15s, transform .15s;
    line-height: 1;
}

.tht-pick-star:hover,
.tht-pick-star.active {
    color: #fbbf24;
    transform: scale(1.15);
}

.tht-pick-star.hover-active {
    color: #fcd34d;
}

.tht-star-hint {
    font-size: 12px;
    color: var(--muted);
    margin-left: 8px;
    font-style: italic;
    transition: opacity .2s;
}

/* Form fields */
.tht-review-field {
    margin-bottom: 16px;
}

.tht-review-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.tht-optional {
    font-weight: 400;
    color: var(--muted);
    font-style: italic;
}

.tht-required {
    color: var(--p1);
}

.tht-review-field input[type="text"],
.tht-review-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: var(--ff-b);
    font-size: 14px;
    outline: none;
    color: var(--text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    resize: vertical;
}

.tht-review-field input:focus,
.tht-review-field textarea:focus {
    border-color: var(--p1);
    box-shadow: 0 0 0 3px rgba(255, 45, 120, .08);
}

.tht-field-hint {
    font-size: 11px;
    color: var(--muted);
    display: block;
    margin-top: 4px;
    font-style: italic;
}

/* Submit button */
.tht-review-submit {
    background: var(--grad);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-family: var(--ff-h);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.tht-review-submit:hover { opacity: .9; transform: translateY(-1px); }
.tht-review-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Result message */
.tht-review-result {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
}

.tht-review-result.success { color: #16a34a; }
.tht-review-result.error   { color: #dc2626; }

/* ── Review items list ── */
.tht-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tht-review-item {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color .2s;
}

.tht-review-item:hover { border-color: var(--p3); }

.tht-rv-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.tht-rv-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--ff-h);
    flex-shrink: 0;
}

.tht-rv-meta {
    flex: 1;
    min-width: 0;
}

.tht-rv-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.tht-rv-stars {
    display: flex;
    gap: 1px;
}

.tht-rv-stars .tht-star-on  { color: #fbbf24; font-size: 14px; }
.tht-rv-stars .tht-star-half { color: #fbbf24; font-size: 14px; }
.tht-rv-stars .tht-star-off  { color: #d1d5db; font-size: 14px; }

.tht-rv-date {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.tht-rv-body {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
}

/* New review appended after submit */
.tht-review-item.tht-new {
    border-color: var(--p1);
    animation: thtSlideIn .4s ease;
}

@keyframes thtSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* No reviews state */
.tht-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.tht-no-reviews span { font-size: 44px; display: block; margin-bottom: 10px; }
.tht-no-reviews p    { font-size: 14px; }

/* ── Sidebar contact info ── */
.tht-sidebar-contact {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tht-sc-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 2px;
}

.tht-sc-link {
    font-size: 13px;
    color: var(--p1);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity .2s;
}

.tht-sc-link:hover { opacity: .75; }

/* Responsive */
@media (max-width: 600px) {
    .tht-review-form-wrap { padding: 16px; }
    .tht-pick-star { font-size: 28px; }
    .tht-review-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
}
