/* Hprint.kz — общие стили (HP-Inspired Design System из дизайн-пакета) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #ffffff; overflow-x: hidden; }
body {
  font-family: 'Manrope', Arial, sans-serif;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
input, textarea, button, select { font-family: 'Manrope', Arial, sans-serif; }
input:focus, textarea:focus { outline: 2px solid #024ad8; outline-offset: -1px; }

img, video, svg { max-width: 100%; height: auto; }

/* Кнопки: UPPERCASE 600, letter-spacing 0.7px, радиус 4px; press-состояния по системе */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 4px; font-weight: 600; font-size: 14px; letter-spacing: 0.7px;
  text-transform: uppercase; text-decoration: none; cursor: pointer; border: none;
}
.btn-primary { background: #024ad8; color: #ffffff; }
.btn-primary:active { background: #0e3191; }
.btn-bright { background: #296ef9; color: #ffffff; }
.btn-bright:active { background: #0e3191; }
.btn-outline { background: #ffffff; color: #1a1a1a; border: 1px solid #1a1a1a; }
.btn-outline:active { background: #f7f7f7; }
.btn-ghost-dark { background: transparent; color: #ffffff; border: 1px solid #ffffff; }
.btn-ghost-dark:active { background: #292929; }
.btn-card { font-size: 12.6px; font-weight: 700; letter-spacing: 0.126px; padding: 11px 8px; flex: 1; }
.btn-mod { font-size: 12.6px; font-weight: 700; letter-spacing: 0.126px; padding: 8px 12px; white-space: nowrap; }

.link-blue { color: #024ad8; text-decoration: none; font-weight: 500; }
.suggestion-row:hover { background: #f7f7f7; }

/* Слот изображения: до загрузки фото через CMS — серый плейсхолдер */
.img-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #636363; font-size: 13px; text-align: center; padding: 12px;
  background: #f7f7f7; overflow: hidden;
}
.img-slot img { width: 100%; height: 100%; object-fit: contain; }
.img-slot svg { opacity: 0.45; }

/* Всплывающее подтверждение (вместо alert в прототипе) */
#pf-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px);
  background: #1a1a1a; color: #ffffff; font-size: 14px; font-weight: 500;
  padding: 12px 20px; border-radius: 8px; box-shadow: 0 8px 24px rgba(26,26,26,0.12);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200;
  max-width: min(520px, calc(100vw - 48px));
}
#pf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#pf-toast.error { background: #b3261e; }

/* ---------- Layout helpers ---------- */
.pf-container { max-width: 1366px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.pf-main { flex: 1; max-width: 1366px; width: 100%; margin: 0 auto; padding: 56px 24px 80px; }
.pf-main-narrow { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 56px 24px 80px; }
.pf-page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.pf-page-head h1 { margin: 0; font-size: 44px; line-height: 1; font-weight: 500; }
.pf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.pf-grid-2-start { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.pf-grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pf-grid-cards-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.pf-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.pf-section-head h2 { margin: 0; font-size: 36px; line-height: 1; font-weight: 500; }
.pf-cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pf-cta-band-inner { display: flex; flex-direction: column; gap: 12px; }
.pf-cta-band-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pf-promo-box { margin-top: 40px; background: #f7f7f7; border-radius: 16px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* Hero */
.pf-hero { background: #f7f7f7; overflow: hidden; }
.pf-hero-inner { max-width: 1366px; margin: 0 auto; padding: 64px 24px; position: relative; }
.pf-hero-deco { position: absolute; left: -40px; top: 80px; display: flex; gap: 14px; pointer-events: none; }
.pf-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.pf-hero-content { display: flex; flex-direction: column; gap: 24px; padding-left: 56px; }
.pf-hero-content h1 { margin: 0; font-size: 52px; line-height: 1.04; font-weight: 500; }
.pf-hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pf-hero-media { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Catalog device row */
.pf-device-row {
  display: grid; grid-template-columns: 280px 1fr 300px; gap: 32px;
  background: #ffffff; border: 1px solid #e8e8e8; border-radius: 16px;
  box-shadow: 0 2px 8px rgba(26,26,26,0.08); padding: 32px;
}
.pf-device-img { width: 280px; height: 220px; background: #f7f7f7; border-radius: 12px; }
.pf-device-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pf-device-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-device-title h2 { margin: 0; font-size: 24px; line-height: 1.17; font-weight: 500; }
.pf-device-mods { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Modification rows */
.pf-mod-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px 12px;
}
.pf-mod-row-lg {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid #e8e8e8; border-radius: 8px; padding: 14px 16px;
}
.pf-mod-row-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* Product page */
.pf-product-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; margin-top: 24px; }
.pf-product-img { width: 100%; height: 420px; background: #f7f7f7; border-radius: 16px; }
.pf-spec-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; padding: 14px 20px; border-bottom: 1px solid #e8e8e8; font-size: 14px; }

/* Cart */
.pf-cart-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 24px;
  align-items: center; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px 20px;
}
.pf-cart-footer {
  margin-top: 32px; background: #f7f7f7; border-radius: 16px; padding: 32px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.pf-cart-form { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 280px; }
.pf-cart-total { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

/* Footer */
.pf-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.pf-footer-bottom {
  border-top: 1px solid #292929; margin-top: 40px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}

/* ---------- Header / nav ---------- */
.pf-topbar { background: #1a1a1a; color: #ffffff; }
.pf-topbar-inner {
  max-width: 1366px; margin: 0 auto; padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 12px; line-height: 1.33;
}
.pf-topbar-left { display: flex; gap: 24px; color: #c2c2c2; flex-wrap: wrap; }
.pf-topbar-right { display: flex; gap: 24px; align-items: center; flex-shrink: 0; }

.pf-header { background: #ffffff; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 50; }
.pf-header-row {
  max-width: 1366px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 16px;
}
.pf-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #1a1a1a; flex-shrink: 0; min-width: 0; }
.pf-logo-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.pf-logo-tagline { font-size: 10px; color: #636363; letter-spacing: 1.4px; margin-top: 3px; }

.pf-search-wrap { flex: 1; position: relative; max-width: 520px; min-width: 0; }
.pf-search-box {
  display: flex; align-items: center; gap: 10px; border: 1px solid #c2c2c2;
  border-radius: 4px; padding: 10px 14px; background: #ffffff;
}
.pf-search-box input { border: none; flex: 1; font-size: 14px; color: #1a1a1a; background: transparent; padding: 0; outline: none; min-width: 0; }

.pf-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.pf-header-actions .btn { padding: 10px 14px; font-size: 12px; }
.pf-header-actions .btn span.btn-label { display: inline; }
.pf-cart-link { position: relative; padding: 6px; color: #1a1a1a; display: flex; text-decoration: none; flex-shrink: 0; }

.pf-nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 1px solid #e8e8e8;
  border-radius: 4px; background: #ffffff; color: #1a1a1a; cursor: pointer; flex-shrink: 0;
}
.pf-nav-toggle svg { display: block; }

.pf-nav { border-top: 1px solid #e8e8e8; }
.pf-nav-inner {
  max-width: 1366px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 24px; flex-wrap: wrap;
}
.pf-nav-inner a {
  padding: 12px 0; font-size: 15px; font-weight: 500; color: #1a1a1a;
  text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.pf-nav-inner a.is-active { border-bottom-color: #024ad8; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .pf-device-row { grid-template-columns: 220px 1fr; }
  .pf-device-mods { grid-column: 1 / -1; }
  .pf-device-img { width: 220px; }
  .pf-footer-grid { grid-template-columns: 1fr 1fr; }
  .pf-hero-content h1 { font-size: 42px; }
}

@media (max-width: 768px) {
  .pf-container, .pf-main, .pf-main-narrow { padding-left: 16px; padding-right: 16px; }
  .pf-main, .pf-main-narrow { padding-top: 32px; padding-bottom: 48px; }
  .pf-page-head { margin-bottom: 24px; }
  .pf-page-head h1 { font-size: 32px; }

  /* Topbar */
  .pf-topbar-inner { padding: 8px 16px; justify-content: center; }
  .pf-topbar-left { display: none; }
  .pf-topbar-right { gap: 12px; font-size: 11px; }
  .pf-topbar-email { display: none; }

  /* Header */
  .pf-header-row { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .pf-logo-tagline { display: none; }
  .pf-search-wrap { order: 3; flex: 1 1 100%; max-width: none; }
  .pf-header-actions { gap: 8px; }
  .pf-header-actions .btn-kp .btn-label { display: none; }
  .pf-header-actions .btn-kp::after { content: 'КП'; }
  .pf-header-actions .btn-wa .btn-label { display: none; }
  .pf-nav-toggle { display: inline-flex; }

  /* Mobile nav drawer */
  .pf-nav { display: none; background: #ffffff; border-top: 1px solid #e8e8e8; box-shadow: 0 8px 24px rgba(26,26,26,0.08); }
  .pf-nav.is-open { display: block; }
  .pf-nav-inner { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
  .pf-nav-inner a { padding: 14px 0; border-bottom: 1px solid #f0f0f0; white-space: normal; }
  .pf-nav-inner a.is-active { border-bottom-color: #e8e8e8; color: #024ad8; }

  /* Hero */
  .pf-hero-inner { padding: 32px 16px; }
  .pf-hero-deco { display: none; }
  .pf-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .pf-hero-content { padding-left: 0; gap: 16px; }
  .pf-hero-content h1 { font-size: 32px; }
  .pf-hero-content p { font-size: 16px !important; max-width: none !important; }
  .pf-cta-band-inner h2 { font-size: 28px !important; }
  .pf-product-grid h1 { font-size: 28px !important; }
  .pf-page-head + .pf-grid-2-start h1,
  .pf-hero-grid h1 { font-size: 32px !important; }
  .pf-hero-actions { flex-direction: column; align-items: stretch; }
  .pf-hero-actions .btn { width: 100%; }
  .pf-hero-actions .link-blue { text-align: center; }

  /* Sections */
  .pf-section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 24px; }
  .pf-section-head h2 { font-size: 28px; }
  .pf-grid-2, .pf-grid-2-start, .pf-product-grid { grid-template-columns: 1fr; gap: 28px; }
  .pf-cta-band { flex-direction: column; align-items: stretch; }
  .pf-cta-band-actions { width: 100%; }
  .pf-cta-band-actions .btn { flex: 1; }
  .pf-promo-box { flex-direction: column; align-items: stretch; padding: 24px 20px; }

  /* Device rows */
  .pf-device-row { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .pf-device-img { width: 100% !important; height: 200px !important; }
  .pf-device-title h2 { font-size: 20px; }
  .pf-device-mods { grid-column: auto; }

  /* Mod rows */
  .pf-mod-row, .pf-mod-row-lg { flex-direction: column; align-items: stretch; gap: 10px; }
  .pf-mod-row-actions { width: 100%; justify-content: space-between; }
  .pf-mod-row .btn-mod, .pf-mod-row-lg .btn-mod { width: 100%; }

  /* Product */
  .pf-product-img { height: 280px !important; }
  .pf-spec-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }

  /* Cart */
  .pf-cart-row { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .pf-cart-row .pf-cart-qty { justify-content: flex-start; }
  .pf-cart-row .pf-cart-price { align-items: flex-start !important; }
  .pf-cart-row .pf-cart-remove { justify-self: end; }
  .pf-cart-footer { flex-direction: column; align-items: stretch; padding: 24px 20px; }
  .pf-cart-total { align-items: stretch; }
  .pf-cart-total .btn { width: 100%; }
  .pf-cart-form input { max-width: none !important; width: 100%; }

  /* Footer */
  .pf-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .pf-footer-bottom { flex-direction: column; }
  .pf-footer-legal { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }

  /* Buttons in cards */
  .btn-card { min-height: 44px; }
}

@media (max-width: 480px) {
  .pf-header-actions .btn-kp { padding: 10px 12px; min-width: 44px; }
  .pf-hero-content h1 { font-size: 28px; }
  .pf-page-head h1 { font-size: 28px; }
}
