*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --red: #E30613; --dark: #1a1a2e; --grey: #f5f6f8; --border: #e0e3e8;
  --text: #2c3e50; --dim: #8899aa; --white: #fff; --green: #27ae60;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--grey); color: var(--text); min-height: 100vh; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* Contact bar */
.contact-bar { background: var(--red); padding: 8px 0; text-align: center; font-size: 0.85rem; color: var(--white); }
.contact-bar a { color: var(--white); font-weight: 600; text-decoration: underline; }

/* Header */
header { background: var(--dark); padding: 14px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--white); text-decoration: none; }
.logo span { color: var(--red); }
.header-right { display: flex; align-items: center; gap: 12px; }
.cur-switch { display: flex; gap: 4px; margin-right: 4px; padding-right: 8px; border-right: 1px solid rgba(255,255,255,0.15); }
.cur-switch a, .cur-switch a:visited { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.cur-switch a:hover { color: var(--white); }
.cur-switch a.active, .cur-switch a.active:visited { color: var(--white); background: rgba(255,255,255,0.15); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a, .lang-switch a:visited { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.lang-switch a:hover { color: var(--white); }
.lang-switch a.active, .lang-switch a.active:visited { color: var(--white); background: rgba(255,255,255,0.15); }
.cart-btn {
  position: relative; background: none; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 8px 12px; color: var(--white); cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.cart-count { background: var(--red); color: var(--white); font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 100px; }

/* Layout */
.layout { display: flex; gap: 20px; margin-top: 20px; align-items: flex-start; }

/* Filter Sidebar */
.filters {
  width: 220px; min-width: 220px; background: var(--white); border-radius: 10px;
  padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: sticky; top: 16px;
}
.f-section { margin-bottom: 14px; }
.f-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.f-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; outline: none; }
.f-input:focus { border-color: var(--red); }
.f-toggles { display: flex; flex-wrap: wrap; gap: 4px; }
.f-tog {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 0.72rem; font-weight: 500; cursor: pointer;
  background: var(--white); color: var(--dim); transition: all 0.15s;
}
.f-tog input { display: none; }
.f-tog:hover { border-color: var(--dark); color: var(--text); }
.f-tog.active { background: var(--dark); color: var(--white); border-color: var(--dark); }
.f-tog-sm { padding: 3px 7px; font-size: 0.65rem; }
.f-range { display: flex; align-items: center; gap: 6px; }
.f-num { width: 70px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; text-align: center; outline: none; }
.f-num:focus { border-color: var(--red); }
/* Dual range slider */
.range-slider { position: relative; width: 100%; height: 28px; margin: 4px 0 2px; }
.range-slider input[type="range"] {
  position: absolute; top: 0; left: 0; width: 100%; height: 28px;
  -webkit-appearance: none; appearance: none; background: none;
  pointer-events: none; margin: 0; padding: 0;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: var(--border); border-radius: 2px;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--dark); border: 2px solid var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  margin-top: -6px; pointer-events: auto; cursor: pointer;
}
.range-slider input[type="range"]::-moz-range-track {
  height: 4px; background: var(--border); border-radius: 2px;
}
.range-slider input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--dark); border: 2px solid var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  pointer-events: auto; cursor: pointer;
}
.range-vals { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--dim); }
.f-note { font-size: 0.65rem; color: var(--dim); margin-top: 4px; font-style: italic; }
.f-apply { display: none; }
.f-reset { display: block; text-align: center; margin-top: 8px; font-size: 0.72rem; color: var(--dim); text-decoration: none; }
.f-reset:hover { color: var(--red); }

/* Main Content */
.main-content { flex: 1; min-width: 0; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.domain-count { font-size: 0.88rem; color: var(--dim); font-weight: 500; }
.sort-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sort-label { font-size: 0.75rem; color: var(--dim); }
.sort-opt {
  font-size: 0.72rem; color: var(--dim); text-decoration: none; padding: 4px 8px;
  border-radius: 6px; border: 1px solid var(--border); transition: all 0.15s;
}
.sort-opt:hover { border-color: var(--dark); color: var(--text); }
.sort-opt.active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* Table */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: var(--dark); color: var(--white); }
th { padding: 10px 12px; text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 7px 12px; border-bottom: 1px solid var(--grey); }
tr:hover { background: #f0f4ff; }
.col-num { text-align: right; }
.col-domain { font-weight: 600; }
.col-lang { font-size: 0.78rem; color: var(--dim); white-space: nowrap; }
.col-val { color: var(--dim); font-size: 0.82rem; text-align: left; }
.col-cart { width: 36px; text-align: center; }
.info-icon { font-size: 0.75rem; cursor: help; opacity: 0.6; }

.add-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); color: var(--dim); font-size: 1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.add-btn:hover { border-color: var(--red); color: var(--red); }
.add-btn.in-cart { background: var(--green); border-color: var(--green); color: var(--white); }
.empty { text-align: center; padding: 40px; color: var(--dim); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 16px 0 24px; }
.page-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; font-size: 0.82rem; color: var(--text); }
.page-btn:hover { border-color: var(--dark); }
.page-btn.active { background: var(--dark); color: var(--white); border-color: var(--dark); }
.page-dots { padding: 6px 4px; color: var(--dim); }

/* Cart */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; display: none; }
.cart-overlay.open { display: block; }
.cart-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 90vw; background: var(--white); box-shadow: -4px 0 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; z-index: 101; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cart-header h2 { font-size: 1.1rem; font-weight: 700; }
.cart-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--dim); }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { color: var(--dim); font-size: 0.88rem; text-align: center; padding: 30px 0; }
.cart-list { list-style: none; }
.cart-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grey); font-size: 0.88rem; }
.cart-list li .remove-btn { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 0.78rem; }
.cart-list li .remove-btn:hover { color: var(--red); }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.cart-total { font-size: 0.82rem; color: var(--dim); margin-bottom: 10px; }
.save-btn { display: block; width: 100%; padding: 12px; background: var(--red); color: var(--white); border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--white); border-radius: 14px; padding: 28px; max-width: 420px; width: 100%; box-shadow: 0 16px 40px rgba(0,0,0,0.2); }
.modal h2 { font-size: 1.2rem; margin-bottom: 6px; }
.modal-sub { font-size: 0.85rem; color: var(--dim); margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--dim); margin-bottom: 4px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.92rem; outline: none; }
.field input:focus { border-color: var(--red); }
.modal-msg { padding: 10px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 12px; }
.msg-ok { background: #e8f5e9; color: var(--green); }
.msg-err { background: #ffebee; color: #c62828; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-cancel { padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); cursor: pointer; }
.btn-save { padding: 10px 24px; background: var(--red); color: var(--white); border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
footer { padding: 20px 0; text-align: center; font-size: 0.78rem; color: var(--dim); border-top: 1px solid var(--border); }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .filters { width: 100%; min-width: 0; position: static; }
  .cart-panel { width: 100%; }
}
