/* ═══════════════════════════════════════════
   ТЕРМОРАЗРЫВ.РФ — Plugin Styles
═══════════════════════════════════════════ */

:root {
  --tr-ink:    #0d0d0d;
  --tr-paper:  #f5f0e8;
  --tr-warm:   #e8dcc8;
  --tr-steel:  #2a3540;
  --tr-rust:   #c44a1a;
  --tr-ice:    #d4eaf5;
  --tr-frost:  #6aadcc;
  --tr-gold:   #c9963a;
  --tr-green:  #2d8a52;
  --tr-mid:    #6b7a86;
  --tr-r:      10px;
}

/* ── BASE LAYOUT ── */
.tr-page { max-width: 1140px; margin: 0 auto; padding: 2rem 1.5rem; }
.tr-section { padding: 2.5rem 0; }
.tr-section + .tr-section { border-top: 1px solid var(--tr-warm); }

/* ── STARS BADGE (header) ── */
.tr-stars-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--tr-gold); color: white;
  padding: .3rem .8rem; border-radius: 2rem;
  font-weight: 700; font-size: .82rem; text-decoration: none;
  transition: opacity .2s;
}
.tr-stars-badge:hover { opacity: .85; }

/* ── BUTTONS ── */
.tr-btn {
  display: inline-block; padding: .65rem 1.4rem;
  border-radius: 2rem; border: none; cursor: pointer;
  font-weight: 700; font-size: .88rem;
  font-family: inherit; transition: all .2s; text-decoration: none;
}
.tr-btn-primary  { background: var(--tr-rust);  color: white; }
.tr-btn-primary:hover  { background: #a83c14; transform: translateY(-1px); }
.tr-btn-secondary { background: var(--tr-steel); color: white; }
.tr-btn-secondary:hover { background: #1e2c36; }
.tr-btn-gold     { background: var(--tr-gold);  color: white; }
.tr-btn-gold:hover     { background: #a87a28; }
.tr-btn-ghost    { background: transparent; color: var(--tr-steel); border: 1.5px solid var(--tr-warm); }
.tr-btn-ghost:hover    { background: var(--tr-warm); }
.tr-btn-danger   { background: #e53e3e; color: white; }
.tr-btn-danger:hover   { background: #c53030; }
.tr-btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.tr-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── FORMS ── */
.tr-form { display: flex; flex-direction: column; gap: 1rem; }
.tr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px) { .tr-form-row { grid-template-columns: 1fr; } }
.tr-field { display: flex; flex-direction: column; gap: .35rem; }
.tr-field label { font-size: .8rem; font-weight: 700; color: var(--tr-mid); letter-spacing: .04em; text-transform: uppercase; }
.tr-field input,
.tr-field select,
.tr-field textarea {
  padding: .7rem .95rem; border: 1.5px solid #d0c8bc;
  border-radius: 8px; font-family: inherit; font-size: .92rem;
  background: var(--tr-paper); color: var(--tr-ink);
  transition: border-color .15s; outline: none;
  width: 100%;
}
.tr-field input:focus,
.tr-field select:focus,
.tr-field textarea:focus { border-color: var(--tr-frost); }
.tr-field textarea { min-height: 110px; resize: vertical; }
.tr-field-note { font-size: .75rem; color: var(--tr-mid); }
.tr-required { color: var(--tr-rust); }

/* ── PHOTO UPLOAD ── */
.tr-photo-grid {
  display: grid; grid-template-columns: repeat(5,1fr); gap: .6rem;
}
@media(max-width:600px) { .tr-photo-grid { grid-template-columns: repeat(3,1fr); } }
.tr-photo-slot {
  aspect-ratio: 1; border: 2px dashed #d0c8bc; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer; background: var(--tr-paper);
  position: relative; overflow: hidden; transition: border-color .2s;
}
.tr-photo-slot:hover { border-color: var(--tr-frost); }
.tr-photo-slot .tr-photo-icon { font-size: 1.5rem; color: var(--tr-mid); }
.tr-photo-slot .tr-photo-label { font-size: .7rem; color: var(--tr-mid); margin-top: .2rem; }
.tr-photo-slot input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.tr-photo-slot img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.tr-photo-slot .tr-photo-remove {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: white; font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; z-index: 2;
}

/* ── NOTICES ── */
.tr-notice {
  padding: .8rem 1.1rem; border-radius: 8px;
  font-size: .88rem; margin: .75rem 0; display: none;
}
.tr-notice.show { display: block; }
.tr-notice-success { background: #e8f8f0; border: 1px solid #6acc8f; color: #1a5c35; }
.tr-notice-error   { background: #fdf0f0; border: 1px solid #cc6a6a; color: #7a2d2d; }
.tr-notice-info    { background: var(--tr-ice); border: 1px solid var(--tr-frost); color: var(--tr-steel); }

/* ── TABS ── */
.tr-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--tr-warm); margin-bottom: 2rem; overflow-x: auto; }
.tr-tab {
  padding: .7rem 1.3rem; font-weight: 700; font-size: .85rem;
  cursor: pointer; border: none; background: none; color: var(--tr-mid);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; font-family: inherit; transition: all .15s;
}
.tr-tab.active { color: var(--tr-rust); border-bottom-color: var(--tr-rust); }
.tr-tab-panel { display: none; }
.tr-tab-panel.active { display: block; }

/* ── LISTING CARDS ── */
.tr-listings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.25rem;
}
.tr-listing-card {
  background: white; border-radius: var(--tr-r); overflow: hidden;
  border: 1.5px solid #e0d8cc; transition: transform .2s, box-shadow .2s;
  position: relative;
}
.tr-listing-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.tr-listing-card.is-top { border-color: var(--tr-gold); }
.tr-top-badge {
  position: absolute; top: .6rem; left: .6rem;
  background: var(--tr-gold); color: white;
  font-size: .68rem; font-weight: 700; padding: .2rem .6rem;
  border-radius: 2rem; text-transform: uppercase; letter-spacing: .04em;
}
.tr-listing-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--tr-warm);
}
.tr-listing-img-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg,#e8dcc8,#d4eaf5);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--tr-mid);
}
.tr-listing-body { padding: 1rem 1.1rem; }
.tr-listing-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem;
}
.tr-listing-title { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; line-height: 1.35; }
.tr-listing-title a { color: var(--tr-ink); text-decoration: none; }
.tr-listing-title a:hover { color: var(--tr-rust); }
.tr-listing-price { font-weight: 800; color: var(--tr-rust); font-size: 1.05rem; }
.tr-listing-city { font-size: .78rem; color: var(--tr-mid); }
.tr-listing-date { font-size: .75rem; color: #bbb; margin-top: .5rem; }
.tr-listing-actions { padding: .75rem 1.1rem; border-top: 1px solid #f0ece4; display: flex; gap: .5rem; }

/* ── TYPE BADGES ── */
.tr-type-badge {
  display: inline-block; color: white; font-size: .7rem; font-weight: 700;
  padding: .18rem .6rem; border-radius: 2rem;
}

/* ── MASTER CARDS ── */
.tr-masters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.25rem;
}
.tr-master-card {
  background: white; border-radius: var(--tr-r); padding: 1.4rem;
  border: 1.5px solid #e0d8cc; transition: transform .2s, box-shadow .2s;
}
.tr-master-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.tr-master-card.verified { border-color: var(--tr-green); }
.tr-master-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--tr-steel); color: var(--tr-frost);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900; margin-bottom: .9rem;
  flex-shrink: 0;
}
.tr-master-name { font-weight: 800; font-size: 1rem; margin-bottom: .2rem; }
.tr-master-city { font-size: .82rem; color: var(--tr-mid); margin-bottom: .5rem; }
.tr-master-badge { font-size: .78rem; font-weight: 700; display: inline-block; margin-bottom: .7rem; }
.tr-master-exp { font-size: .82rem; color: #555; margin-bottom: .5rem; }
.tr-master-brands { font-size: .78rem; color: var(--tr-mid); }
.tr-master-rating { font-size: .9rem; margin-top: .5rem; }

/* ── STARS ── */
.tr-stars { color: var(--tr-gold); letter-spacing: 1px; }
.tr-stars-input { display: flex; gap: .3rem; flex-direction: row-reverse; justify-content: flex-end; }
.tr-stars-input input[type="radio"] { display: none; }
.tr-stars-input label {
  font-size: 1.6rem; color: #ddd; cursor: pointer;
  transition: color .1s;
}
.tr-stars-input label:hover,
.tr-stars-input label:hover ~ label,
.tr-stars-input input:checked ~ label { color: var(--tr-gold); }

/* ── REVIEW CARDS ── */
.tr-reviews-list { display: flex; flex-direction: column; gap: 1.1rem; }
.tr-review-card {
  background: white; border-radius: var(--tr-r); padding: 1.4rem;
  border: 1.5px solid #e0d8cc;
}
.tr-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.tr-review-author { font-weight: 700; font-size: .9rem; }
.tr-review-date { font-size: .75rem; color: var(--tr-mid); }
.tr-review-brand { font-size: .82rem; color: var(--tr-mid); }
.tr-review-text { font-size: .9rem; line-height: 1.7; color: #333; }
.tr-verdict-badge {
  display: inline-block; padding: .2rem .65rem; border-radius: 2rem;
  font-size: .72rem; font-weight: 700; margin-top: .6rem;
}
.tr-verdict-recommend    { background: #e8f8f0; color: var(--tr-green); }
.tr-verdict-not-recommend { background: #fdf0f0; color: #c44a1a; }
.tr-verdict-neutral      { background: #fdf5ea; color: var(--tr-gold); }

/* ── CABINET ── */
.tr-cabinet-header {
  background: var(--tr-steel); color: white;
  border-radius: var(--tr-r); padding: 1.75rem 2rem; margin-bottom: 2rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.tr-cabinet-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--tr-rust); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; flex-shrink: 0;
}
.tr-cabinet-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.tr-cabinet-role { font-size: .8rem; color: var(--tr-frost); margin-top: .2rem; }
.tr-cabinet-stars {
  margin-left: auto; background: var(--tr-gold); color: white;
  padding: .6rem 1.3rem; border-radius: 2rem; font-weight: 800; font-size: 1rem;
}

/* ── STARS SHOP ── */
.tr-stars-shop { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 1.5rem 0; }
@media(max-width:600px) { .tr-stars-shop { grid-template-columns: 1fr; } }
.tr-stars-pack {
  background: var(--tr-paper); border: 1.5px solid #e0d8cc;
  border-radius: var(--tr-r); padding: 1.25rem; text-align: center;
  transition: all .2s;
}
.tr-stars-pack:hover { border-color: var(--tr-gold); transform: translateY(-2px); }
.tr-stars-pack.best { border-color: var(--tr-rust); background: #fff8f5; }
.tr-stars-pack-n { font-size: 2rem; font-weight: 900; color: var(--tr-gold); }
.tr-stars-pack-label { font-size: .78rem; color: var(--tr-mid); margin: .2rem 0 .8rem; }
.tr-stars-pack-price { font-size: 1.1rem; font-weight: 800; color: var(--tr-rust); margin-bottom: .8rem; }
.tr-best-badge { display: inline-block; background: var(--tr-rust); color: white; font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 2rem; margin-bottom: .5rem; }

/* ── MY LISTINGS TABLE ── */
.tr-my-listings { display: flex; flex-direction: column; gap: .75rem; }
.tr-my-listing {
  background: white; border: 1.5px solid #e0d8cc; border-radius: 10px;
  padding: 1rem 1.2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.tr-my-listing-thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: var(--tr-warm); flex-shrink: 0; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; color: var(--tr-mid);
}
.tr-my-listing-info { flex: 1; min-width: 150px; }
.tr-my-listing-title { font-weight: 700; font-size: .92rem; }
.tr-my-listing-status {
  font-size: .75rem; font-weight: 600; margin-top: .2rem;
}
.status-publish  { color: var(--tr-green); }
.status-pending  { color: var(--tr-gold); }
.status-draft    { color: var(--tr-mid); }
.tr-my-listing-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── FILTERS ── */
.tr-filters {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.75rem;
  padding: 1.1rem 1.3rem; background: white; border-radius: var(--tr-r);
  border: 1.5px solid #e0d8cc;
}
.tr-filter-btn {
  padding: .38rem 1rem; border-radius: 2rem; border: 1.5px solid #d0c8bc;
  background: white; cursor: pointer; font-size: .8rem; font-weight: 600;
  font-family: inherit; color: var(--tr-ink); transition: all .15s;
}
.tr-filter-btn.active,
.tr-filter-btn:hover { background: var(--tr-steel); color: white; border-color: var(--tr-steel); }

/* ── AUTH MODAL ── */
.tr-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.tr-modal-overlay.open { opacity: 1; pointer-events: all; }
.tr-modal {
  background: white; border-radius: 16px; padding: 2rem;
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .25s;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.tr-modal-overlay.open .tr-modal { transform: translateY(0); }
.tr-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}
.tr-modal-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.tr-modal-close { font-size: 1.3rem; cursor: pointer; background: none; border: none; color: var(--tr-mid); padding: .2rem; }
.tr-modal-close:hover { color: var(--tr-ink); }
.tr-modal-footer { margin-top: 1rem; text-align: center; font-size: .82rem; color: var(--tr-mid); }
.tr-modal-footer a { color: var(--tr-rust); text-decoration: none; font-weight: 600; cursor: pointer; }

/* ── SINGLE LISTING PAGE ── */
.tr-listing-single { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; }
@media(max-width:768px) { .tr-listing-single { grid-template-columns: 1fr; } }
.tr-gallery { margin-bottom: 1.5rem; }
.tr-gallery-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--tr-r); margin-bottom: .6rem; }
.tr-gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; }
.tr-gallery-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .7; transition: opacity .15s; flex-shrink: 0; }
.tr-gallery-thumb.active, .tr-gallery-thumb:hover { opacity: 1; }
.tr-listing-contact-card {
  background: var(--tr-steel); color: white; border-radius: var(--tr-r);
  padding: 1.5rem; position: sticky; top: 80px;
}
.tr-contact-price { font-size: 1.5rem; font-weight: 900; color: var(--tr-gold); margin-bottom: .5rem; }
.tr-contact-city { font-size: .85rem; color: #aec1cd; margin-bottom: 1.2rem; }
.tr-phone-btn { width: 100%; text-align: center; margin-bottom: .75rem; }

/* ── PAGINATION ── */
.tr-pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.tr-page-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #d0c8bc;
  background: white; cursor: pointer; font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
  font-family: inherit; text-decoration: none; color: var(--tr-ink);
}
.tr-page-btn.active, .tr-page-btn:hover { background: var(--tr-steel); color: white; border-color: var(--tr-steel); }

/* ── EMPTY STATE ── */
.tr-empty { text-align: center; padding: 3rem 1rem; color: var(--tr-mid); }
.tr-empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.tr-empty-text { font-size: .95rem; line-height: 1.65; }

/* ── VERIFICATION BLOCK ── */
.tr-verify-block {
  background: linear-gradient(135deg, #f0fbf4, #e8f8f0);
  border: 1.5px solid #6acc8f; border-radius: var(--tr-r); padding: 1.5rem;
  margin: 1.5rem 0;
}
.tr-verify-block h3 { color: var(--tr-green); margin-bottom: .7rem; font-size: .95rem; }
.tr-verify-block ul { margin: .7rem 0 1rem 1.2rem; }
.tr-verify-block li { font-size: .88rem; color: #333; margin-bottom: .3rem; }

/* ── LOADING SPINNER ── */
.tr-spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: white;
  animation: tr-spin .7s linear infinite;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media(max-width:480px) {
  .tr-cabinet-header { flex-direction: column; text-align: center; }
  .tr-cabinet-stars  { margin-left: 0; }
  .tr-listings-grid  { grid-template-columns: 1fr; }
  .tr-masters-grid   { grid-template-columns: 1fr; }
}
