/* ========================================
   Shnyagi.net — Complete Stylesheet
   ======================================== */

/* --- Variables --- */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --green: #059669;
  --green-dark: #047857;
  --green-light: #d1fae5;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --orange-light: #fff7ed;
  --orange-border: #fed7aa;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.07), 0 10px 15px rgba(0,0,0,.1);
  --radius: 12px;
}

/* --- Reset --- */
*,*::before,*::after { box-sizing:border-box; }
body { margin:0; background:var(--gray-50); font-family:'Inter','Segoe UI',sans-serif; color:var(--gray-900); }

/* ====================
   PUBLIC PAGE
   ==================== */

.price-section {
  font-family:'Inter','Segoe UI',system-ui,sans-serif;
  width:100%; max-width:1200px; margin:0 auto;
  padding:20px 16px 70px;
  color:var(--gray-900);
}

.price-header { text-align:center; margin-bottom:24px; }
.price-header h2 { font-size:28px; font-weight:800; margin:0 0 6px; letter-spacing:-.5px; }
.price-header p { color:var(--gray-500); font-size:14px; margin:0; }
.price-header .badge {
  display:inline-block; background:var(--blue-light); color:var(--blue);
  padding:4px 14px; border-radius:20px; font-size:13px; font-weight:600; margin-top:8px;
}

.price-scroll {
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  border-radius:var(--radius); box-shadow:var(--shadow-lg);
  border:1px solid var(--gray-200);
}

.price-table {
  width:100%; border-collapse:collapse; font-size:13px;
  background:#fff; min-width:820px;
}

.price-table thead .title-row th {
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  color:#fff; font-size:16px; font-weight:700;
  padding:14px 12px; text-align:center;
}

.price-table thead .group-row th {
  background:var(--gray-50); color:var(--gray-700);
  font-weight:700; font-size:13px;
  padding:10px 8px; text-align:center;
  border-bottom:1px solid var(--gray-200);
  border-right:1px solid var(--gray-100);
}
.price-table thead .group-row th:last-child { border-right:none; }

.price-table tbody td {
  padding:10px 8px; text-align:center; vertical-align:middle;
  border-bottom:1px solid var(--gray-200);
  border-right:1px solid var(--gray-100);
  font-size:14px; white-space:nowrap;
}
.price-table tbody td:last-child { border-right:none; }
.price-table tbody tr:last-child td { border-bottom:none; }
.price-table tbody tr:nth-child(even) td { background:var(--gray-50); }
.price-table tbody tr:hover td { background:var(--blue-light); }
.price-table tbody tr:hover .owr-cell { border-left:2px solid var(--blue); }

.price-table tbody td:first-child {
  font-weight:700; color:var(--gray-500); font-size:13px; width:40px;
}

.site-cell {
  text-align:left; font-weight:600; min-width:200px; width:40%;
}
.site-cell a {
  color:var(--blue); text-decoration:none;
  display:inline-flex; align-items:center; gap:6px;
}
.site-cell a:hover { color:var(--blue-dark); text-decoration:underline; }
.site-cell .favicon { width:16px; height:16px; flex-shrink:0; border-radius:3px; }

.price-table tbody td .rub { font-weight:700; color:var(--gray-900); }
.price-table tbody td .empty { color:var(--gray-300); }

.placement-cell { text-align:center; white-space:nowrap; }
.placement-cell .rub { font-weight:700; font-size:16px; color:var(--gray-900); }
.owr-cell { background:var(--gray-50); min-width:240px; padding:8px 10px; }

.site-discount {
  display:inline-block; background:#ff4d4d; color:#fff;
  font-size:10px; font-weight:700; padding:1px 7px; border-radius:4px;
  margin-left:6px; vertical-align:middle; line-height:18px;
}

.obtn {
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 14px; border:1px solid var(--gray-200); border-radius:8px;
  background:#fff; cursor:pointer; font-size:13px; color:var(--gray-600);
  transition:all .15s; font-family:inherit; font-weight:500;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.obtn:hover {
  border-color:var(--blue); color:var(--blue);
  background:var(--blue-light); box-shadow:0 1px 4px rgba(37,99,235,.12);
}
.obtn .ocnt {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:10px;
  background:var(--blue); color:#fff; font-size:11px; font-weight:700; line-height:1;
}
.obtn .ocnt-zero { background:var(--gray-200); color:var(--gray-500); }
.obtn-row { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }

body.has-order { padding-bottom:80px; }

.order-bar {
  display:none; position:fixed; bottom:0; left:0; right:0; z-index:900;
  background:#fff; border-top:2px solid var(--blue);
  box-shadow:0 -4px 20px rgba(0,0,0,.12); padding:12px 20px;
}
.order-bar.active { display:block; }
.obar-inner {
  display:flex; align-items:center; justify-content:center;
  gap:20px; flex-wrap:wrap;
}
.obar-info { font-size:15px; color:var(--gray-700); white-space:nowrap; }
.obar-info strong { color:var(--gray-900); }
.obar-total { color:var(--blue); font-size:17px; }

.cart-detail {
  margin-bottom:16px; border:1px solid var(--gray-200);
  border-radius:10px; overflow:hidden; font-size:14px;
}
.cart-detail table { width:100%; border-collapse:collapse; }
.cart-detail th {
  background:var(--gray-50); padding:8px 10px; text-align:left;
  font-size:12px; font-weight:600; color:var(--gray-500);
  text-transform:uppercase; letter-spacing:.5px;
  border-bottom:1px solid var(--gray-200);
}
.cart-detail td {
  padding:8px 10px; border-bottom:1px solid var(--gray-100);
  vertical-align:top;
}
.cart-detail .tar { text-align:right; }
.cart-detail .site-header td {
  background:var(--gray-50); font-weight:700;
  font-size:14px; border-bottom:1px solid var(--gray-200);
}
.cart-detail .item-row td { padding-left:16px; font-size:13px; }
.cart-detail .rm-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border:none; background:transparent;
  color:var(--gray-400); cursor:pointer; font-size:16px; border-radius:4px; padding:0;
}
.cart-detail .rm-btn:hover { background:#fee2e2; color:#dc2626; }
.cart-detail .totals {
  padding:10px 12px; text-align:right; font-weight:700; font-size:16px;
  color:var(--blue); background:var(--blue-light); border-top:2px solid var(--blue);
}

.add-modal { width:500px; }
.add-modal .fg { margin-bottom:12px; }
.add-modal .fg:last-child { margin-bottom:0; }
.add-modal textarea {
  width:100%; padding:10px 12px; border:1px solid var(--gray-200);
  border-radius:8px; font-size:14px; font-family:inherit;
  resize:vertical; box-sizing:border-box;
}
.add-modal textarea:focus {
  border-color:var(--blue); outline:none;
  box-shadow:0 0 0 3px var(--blue-light);
}
.add-modal input[type=url] {
  width:100%; padding:10px 12px; border:1px solid var(--gray-200);
  border-radius:8px; font-size:14px; font-family:inherit; box-sizing:border-box;
}
.add-modal input[type=url]:focus {
  border-color:var(--blue); outline:none;
  box-shadow:0 0 0 3px var(--blue-light);
}
.add-modal .add-actions {
  display:flex; gap:8px; margin-top:12px;
  padding-top:12px; border-top:1px solid var(--gray-200);
}
.add-modal .add-actions .btn {
  flex:1; text-align:center; font-size:14px; padding:9px 16px;
}

/* --- Shared modal --- */
.modal-overlay {
  display:none; position:fixed; inset:0; z-index:1000;
  background:rgba(0,0,0,.4); align-items:center; justify-content:center;
}
.modal-overlay.active { display:flex; }
.modal {
  background:#fff; border-radius:var(--radius);
  max-width:94vw; max-height:90vh; overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,.2); animation:modalIn .2s ease;
}
@keyframes modalIn {
  from{transform:translateY(20px);opacity:0}
  to{transform:translateY(0);opacity:1}
}
.modal-h {
  padding:16px 18px; border-bottom:1px solid var(--gray-200);
  display:flex; justify-content:space-between; align-items:center;
  font-weight:700; font-size:15px;
}
.modal-h .close {
  width:32px; height:32px; border:none; background:var(--gray-100);
  border-radius:8px; cursor:pointer; font-size:18px;
  display:flex; align-items:center; justify-content:center;
  color:var(--gray-500); text-decoration:none;
}
.modal-h .close:hover { background:var(--gray-200); }
.modal-b { padding:18px; }
.modal-actions {
  display:flex; gap:8px; margin-top:16px;
  padding-top:16px; border-top:1px solid var(--gray-200);
}

/* --- Form elements --- */
.fg { margin-bottom:12px; }
.fg label {
  display:block; font-size:12px; font-weight:600;
  color:var(--gray-500); margin-bottom:4px;
}
.fg input, .fg textarea {
  width:100%; padding:8px 10px; border:1px solid var(--gray-200);
  border-radius:6px; font-size:13px; font-family:inherit; box-sizing:border-box;
}
.fg input:focus, .fg textarea:focus {
  border-color:var(--blue); outline:none;
  box-shadow:0 0 0 3px var(--blue-light);
}
.fg .hint { font-size:11px; color:var(--gray-500); }
.cb-label {
  display:flex !important; align-items:center;
  gap:8px; cursor:pointer; flex-direction:row;
}
.cb-label input[type=checkbox] { width:auto; margin:0; flex-shrink:0; }

/* --- Notes --- */
.price-notes {
  margin:20px 0 0; padding:16px 20px;
  background:var(--gray-50); border-radius:var(--radius);
  border:1px solid var(--gray-200);
}
.price-notes p {
  margin:6px 0; font-size:13px; color:var(--gray-500); line-height:1.5;
  padding-left:20px; position:relative;
}
.price-notes p::before {
  content:''; position:absolute; left:0; top:8px;
  width:6px; height:6px; background:var(--blue);
  border-radius:50%; opacity:.4;
}
.price-notes p:first-child { margin-top:0; }
.price-notes p:last-child { margin-bottom:0; }
.price-notes strong { color:var(--gray-700); }
.price-notes a { color:var(--blue); text-decoration:none; font-weight:600; }
.price-notes a:hover { text-decoration:underline; }

/* --- Buttons --- */
.btn {
  display:inline-block; padding:7px 16px; border-radius:8px;
  font-weight:600; font-size:13px; cursor:pointer;
  border:none; text-decoration:none; font-family:inherit;
}
.bp { background:var(--blue); color:#fff; }
.bp:hover { background:var(--blue-dark); }
.bp:disabled { background:var(--gray-200); color:var(--gray-400); cursor:default; }
.bs { background:var(--gray-100); color:var(--gray-700); }
.bs:hover { background:var(--gray-200); }
.bg { background:var(--green); color:#fff; }
.bg:hover { background:var(--green-dark); }
.bx { padding:5px 12px; font-size:12px; }
.bw { display:block; width:100%; }

/* ====================
   ADMIN PANEL
   ==================== */

.aw { max-width:900px; margin:0 auto; padding:30px 16px; }
.ah {
  display:flex; justify-content:space-between;
  align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:24px;
}
.ah h1 { font-size:24px; font-weight:800; margin:0; }

.card {
  background:#fff; border-radius:var(--radius);
  box-shadow:var(--shadow); border:1px solid var(--gray-200); overflow:hidden;
}
.ch {
  padding:14px 18px; background:var(--gray-50);
  border-bottom:1px solid var(--gray-200);
  font-weight:700; font-size:14px; color:var(--gray-700);
  display:flex; justify-content:space-between; align-items:center;
}
.cb { padding:16px; }

.at { width:100%; border-collapse:collapse; font-size:13px; }
.at th {
  text-align:left; padding:10px 8px; background:var(--gray-50);
  color:var(--gray-500); font-size:11px; text-transform:uppercase;
  letter-spacing:.5px; border-bottom:2px solid var(--gray-200);
}
.at td {
  padding:10px 8px; border-bottom:1px solid var(--gray-100);
}
.at tr:hover td { background:var(--blue-light); }
.at .ac { white-space:nowrap; text-align:right; }

.ac a,.ac button {
  display:inline-block; padding:4px 10px;
  border-radius:6px; font-size:12px; font-weight:600;
  text-decoration:none; cursor:pointer; border:none;
}
.ac .ae { background:var(--blue-light); color:var(--blue); }
.ac .ae:hover { background:var(--blue); color:#fff; }
.ac .ad { background:#fee2e2; color:#dc2626; }
.ac .ad:hover { background:#dc2626; color:#fff; }

.bdg {
  display:inline-block; font-size:11px; font-weight:700;
  padding:2px 8px; border-radius:10px;
}
.ba { background:var(--green-light); color:var(--green); }

.s-hl.disc-10 { background:#fefce8; }
.s-hl.disc-20 { background:#fdf2f8; }

table .rub { white-space:nowrap; }

.tabs {
  display:flex; gap:0; margin-bottom:16px;
  border-bottom:2px solid var(--gray-200);
}
.tab {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 18px; font-size:14px; font-weight:600;
  color:var(--gray-500); text-decoration:none;
  border-bottom:2px solid transparent; margin-bottom:-2px;
  transition:all .15s;
}
.tab:hover { color:var(--gray-700); }
.tab-active { color:var(--blue) !important; border-bottom-color:var(--blue); }
.tab-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  font-size:10px; font-weight:700;
  background:var(--blue-light); color:var(--blue);
}

.fr { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.lc { max-width:380px; margin:80px auto; }
.lc h2 { text-align:center; margin-top:0; }
.lc .fg input { padding:12px; font-size:15px; }

.es { text-align:center; padding:40px 20px; color:var(--gray-500); }
.es p { font-size:14px; margin:0 0 16px; }

/* --- Toast --- */
.toast {
  position:fixed; top:20px; right:20px; z-index:2000;
  padding:12px 20px; border-radius:10px;
  font-size:14px; font-weight:600;
  box-shadow:var(--shadow-lg); animation:toastIn .3s ease; display:none;
}
.toast.show { display:block; }
.toast.ok { background:var(--green-light); color:var(--green); border:1px solid var(--green); }
@keyframes toastIn {
  from{transform:translateX(100px);opacity:0}
  to{transform:translateX(0);opacity:1}
}

/* ====================
   PRINT
   ==================== */
@media print {
  html, body { height:auto; overflow:visible; }
  body { background:#fff !important; }
  #invoiceModal {
    display:block !important; position:absolute !important;
    top:0; left:0; right:0; background:none !important;
    z-index:auto !important; height:auto !important;
    overflow:visible !important;
  }
  #invoiceModal .modal {
    box-shadow:none !important; border:none !important;
    max-width:100% !important; animation:none !important;
  }
  #invoiceModal .modal-h,
  #invoiceModal .close,
  #invoiceModal .btn { display:none !important; }
  .price-section, .order-bar, #addModal, #checkoutModal { display:none !important; }
}

/* ====================
   RESPONSIVE
   ==================== */
@media (max-width:768px) {
  .price-header h2 { font-size:22px; }
  .price-section { padding:10px 0; }
  .price-table { font-size:12px; }
  .price-table tbody td { padding:8px 5px; }
  .price-table .title-row th { font-size:13px; padding:10px; }
  .price-table .group-row th { font-size:11px; padding:8px 4px; }
  .fr { grid-template-columns:1fr; }
}
