
:root {
  --sg-ink: #172c49;
  --sg-blue: #1766a6;
  --sg-orange: #f47c32;
  --sg-line: #e5eaf0;
}

body {
  background: #fff;
  color: var(--sg-ink);
  font-family: Arial, 'Open Sans', sans-serif;
}

a {
  color: var(--sg-blue);
}
a:hover {
  color: #ef752b;
}

.container {
  max-width: 1200px;
}

/* ---------- 2. Верхняя служебная панель ---------- */
#top {
  background: #f5f7fa;
  border-bottom: 1px solid var(--sg-line);
  min-height: 40px;
  padding: 0;
}

#top .sg-top-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  gap: 6px;
}

#top .sg-top-inner > .btn-group,
#top .sg-top-inner > .dropdown {
  margin-right: auto;
}

#top-links {
  float: none !important;
  margin-left: auto;
}

#top-links .list-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 0;
  gap: 3px;
}

#top-links .list-inline > li {
  padding: 0 3px;
}

#top-links a,
#top-links a:visited,
#top .btn-link {
  color: #53657c;
  text-shadow: none;
  font-size: 12px;
}

#top-links a:hover {
  color: var(--sg-blue);
}

#top-links .sg-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  color: #fff !important;
  text-decoration: none;
  transition: transform 0.15s;
}

#top-links .sg-social:hover {
  transform: translateY(-2px);
}

#top-links .sg-social--telegram {
  background: #229ed9;
}
#top-links .sg-social--max {
  background: #6655d8;
  font-size: 15px;
  font-weight: bold;
}
#top-links .sg-social--vk {
  background: #0077ff;
}

/* ---------- 3. Шапка сайта ---------- */
header {
  background: #fff;
  padding: 0 10px;
  margin: 0;
}

header .sg-header-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
}

header .sg-header-row > div {
  float: none;
  padding: 0;
}

header .sg-logo-col {
  flex: 0 0 220px;
  width: 220px;
}
header .sg-search-col {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
header .sg-cart-col {
  flex: 0 0 200px;
  width: 200px;
}

header #logo {
  margin: 0;
}
header #logo img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

#search {
  margin: 0;
  display: flex;
  width: 100%;
}
#search .input-lg {
  height: 44px;
  border: 1px solid #dce3eb;
  border-radius: 8px 0 0 8px;
  box-shadow: none;
}
#search .btn-lg {
  height: 44px;
  min-width: 52px;
  background: var(--sg-blue);
  border: 1px solid var(--sg-blue);
  color: #fff;
  border-radius: 0 8px 8px 0;
  text-shadow: none;
}

#cart {
  margin: 0;
}
#cart > .btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--sg-ink);
  color: #fff;
  box-shadow: none;
  text-shadow: none;
  font-size: 13px;
}
#cart > .btn:hover {
  background: var(--sg-blue);
}

/* ---------- 4. Навигация ---------- */
#menu {
  margin: 0 auto 20px;
  background: var(--sg-ink);
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  box-shadow: none;
}

#cart > .btn{
    width: 80% !important;
    margin-left: 65px;
}

#menu .nav > li > a {
  padding: 13px 20px;
  color: #fff;
  text-shadow: none;
  font-size: 14px;
  font-weight: 600;
}

#menu .nav > li > a:hover,
#menu .nav > li.open > a {
  background: var(--sg-blue);
}

#menu .navbar-header .navbar-toggle {
  border-color: #64768a;
}
#menu .navbar-header .navbar-toggle .icon-bar {
  background: #fff;
}

/* ---------- 5. Карточки товаров v2 ---------- */
#content h1,
#content h2,
#content h3 {
  color: var(--sg-ink);
}

.product-thumb {
  background: #fff;
  border: 1px solid var(--sg-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;
  transition: box-shadow 0.2s;
}
.product-thumb:hover {
  box-shadow: 0 8px 24px rgba(18, 45, 74, 0.09);
}

.product-thumb .image {
  padding: 12px;
}
.product-thumb .image img {
  max-width: 100%;
  margin: auto;
  object-fit: contain;
}

.product-thumb .caption {
  padding: 12px 15px;
}
.product-thumb h4 a {
  font-size: 14px;
  line-height: 1.45;
  color: var(--sg-ink);
  font-weight: 600;
}
.product-thumb .price {
  font-size: 18px;
  color: var(--sg-ink);
  font-weight: bold;
}

.product-thumb .button-group {
  background: #f8fafc;
  border-top: 1px solid var(--sg-line);
}
.product-thumb .button-group button {
  background: transparent;
  color: var(--sg-blue);
}
.product-thumb .button-group button:first-child {
  background: var(--sg-blue);
  color: #fff;
}
.product-thumb .button-group button:hover {
  background: var(--sg-ink);
  color: #fff;
}

.btn-primary {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  text-shadow: none;
}

.list-group-item {
  border-color: var(--sg-line);
}

footer {
  background: var(--sg-ink);
}

/* ---------- 6. Адаптивность v2 ---------- */
@media (max-width: 991px) {
  header .sg-header-row {
    gap: 12px;
  }
  header .sg-logo-col {
    flex-basis: 170px;
    width: 170px;
  }
  header .sg-cart-col {
    flex-basis: 170px;
    width: 170px;
  }
  header #logo img {
    max-height: 62px;
  }
  #top-links .hidden-sm {
    display: none !important;
  }
}

@media (max-width: 767px) {
  #top .sg-top-inner {
    justify-content: center;
    flex-wrap: wrap;
    padding: 5px 12px;
  }
  #top-links {
    margin: 0;
  }
  #top-links .list-inline {
    justify-content: center;
  }
  #top-links .list-inline > li {
    padding: 0 2px;
  }
  header {
    padding: 0;
  }
  header .sg-header-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  header .sg-logo-col {
    flex: 1 1 100%;
    width: 100%;
    text-align: center;
  }
  header #logo img {
    max-height: 64px;
    margin: auto;
  }
  header .sg-search-col {
    flex: 1 1 calc(100% - 145px);
    width: auto;
  }
  header .sg-cart-col {
    flex: 0 0 130px;
    width: 130px;
  }
  #cart > .btn {
    font-size: 11px;
    padding: 6px;
  }
  #menu {
    margin-bottom: 14px;
  }
  #menu .navbar-header {
    float: none;
  }
  #menu .navbar-toggle {
    display: block;
  }
  #menu .navbar-collapse {
    border: 0;
  }
  #menu .navbar-nav {
    margin: 0;
  }
  #menu .nav > li {
    float: none;
  }
}

@media (max-width: 430px) {
  header .sg-search-col,
  header .sg-cart-col {
    flex: 1 1 100%;
    width: 100%;
  }
  #top-links .list-inline > li:nth-last-child(-n + 2) {
    display: none;
  }
}

/* ---------- 7. v3 — вертикальный ритм, SVG-ассеты ---------- */
#top {
  padding: 0 !important;
  min-height: 0;
}
#top .sg-top-inner {
  min-height: 0;
  
}
#top-links .list-inline {
  min-height: 34px;
  column-gap: 6px;
  row-gap: 5px;
}
#top-links .list-inline > li {
  display: flex;
  align-items: center;
}
#top-links .list-inline > li > a:not(.sg-social) {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
#top-links .sg-social {
  width: 34px;
  height: 34px;
  padding: 4px;
  background: transparent !important;
  border-radius: 9px;
}
#top-links .sg-social img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}
#top-links .sg-social:hover {
  background: #edf3fa !important;
}

header {
  padding: 0 !important;
}
header .sg-header-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  min-height: 78px;
}
header .sg-header-row > div {
  float: none;
  padding: 0;
}
header .sg-logo-col {
  flex: 0 0 245px;
  width: 245px;
  padding-right: 28px !important;
}
header .sg-search-col {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding-right: 28px !important;
}
header .sg-cart-col {
  flex: 0 0 215px;
  width: 215px;
}
header #logo img {
  max-height: 76px;
}

#search,
#cart {
  margin: 0;
}
#search .input-lg,
#search .btn-lg,
#cart > .btn {
  height: 48px;
}
#search .btn-lg {
  flex: 0 0 56px;
}
#cart > .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

#menu {
  margin-top: 0;
  margin-bottom: 24px;
}

#content h2 {
  margin: 18px 0 22px;
  font-size: 25px;
  font-weight: 700;
}
#column-left .list-group {
  border: 1px solid var(--sg-line);
  border-radius: 10px;
  overflow: hidden;
}
#column-left .list-group-item {
  padding: 13px 15px;
  background: #fff;
  font-size: 13px;
}
#column-left .list-group-item:hover,
#column-left .list-group-item.active {
  background: #eff5fb;
  color: var(--sg-blue);
  border-color: var(--sg-line);
  text-shadow: none;
}

.product-layout {
  margin-bottom: 22px;
}
.product-thumb {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-thumb .image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 230px;
  padding: 16px;
}
.product-thumb .image img {
  max-height: 198px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.product-thumb .caption {
  flex: 1;
  padding: 14px 16px;
  min-height: 155px;
}
.product-thumb h4 {
  margin: 0 0 12px;
}
.product-thumb h4 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.product-thumb .caption p:not(.price) {
  color: #718096;
  font-size: 12px;
  line-height: 1.55;
}
.product-thumb .price {
  margin: 12px 0 0;
  font-size: 18px;
}
.product-thumb .button-group {
  display: flex;
  flex: 0 0 auto;
}
.product-thumb .button-group button {
  min-height: 43px;
}
.product-thumb .button-group button:first-child {
  flex: 1;
  border-radius: 0;
}
.product-thumb .button-group button:not(:first-child) {
  flex: 0 0 42px;
  width: 42px;
}

.btn-primary {
  border-radius: 7px;
}
.breadcrumb {
  background: transparent;
  padding: 10px 0;
}
.pagination > .active > span {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
}
footer {
  margin-top: 40px;
  padding-top: 30px;
}

@media (min-width: 768px) {
  .row.product-grid-row {
    display: flex;
    flex-wrap: wrap;
  }
}
@media (max-width: 1199px) {
  header .sg-logo-col {
    flex-basis: 205px;
    width: 205px;
    padding-right: 18px !important;
  }
  header .sg-search-col {
    padding-right: 20px !important;
  }
  header .sg-cart-col {
    flex-basis: 190px;
    width: 190px;
  }
}
@media (max-width: 991px) {
  header .sg-logo-col {
    flex-basis: 170px;
    width: 170px;
  }
  header .sg-cart-col {
    flex-basis: 160px;
    width: 160px;
  }
  header .sg-search-col {
    padding-right: 16px !important;
  }
  #top .sg-top-inner {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (max-width: 767px) {
  #top .sg-top-inner {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  header {
    padding: 0 !important;
  }
  header .sg-header-row {
    flex-wrap: wrap;
    min-height: 0;
    row-gap: 12px;
  }
  header .sg-logo-col {
    flex: 1 1 100%;
    width: 100%;
    padding-right: 0 !important;
  }
  header .sg-search-col {
    flex: 1 1 0;
    padding-right: 12px !important;
  }
  header .sg-cart-col {
    flex: 0 0 130px;
    width: 130px;
  }
  header #logo img {
    max-height: 60px;
  }
  #search .input-lg,
  #search .btn-lg,
  #cart > .btn {
    height: 44px;
  }
  .product-thumb .image {
    height: 205px;
  }
}
@media (max-width: 430px) {
  header .sg-search-col {
    flex: 1 1 100%;
    padding-right: 0 !important;
  }
  header .sg-cart-col {
    flex: 1 1 100%;
    width: 100%;
  }
  #top-links .sg-social {
    width: 32px;
    height: 32px;
  }
  #top-links .sg-social img {
    width: 24px;
    height: 24px;
  }
}

/* ---------- 8. v4 — страница категории, карточки, футер ---------- */
.sg-category-page {
  padding-bottom: 24px;
}
.sg-page-heading h1 {
  font-size: 30px;
  font-weight: 750;
  margin: 12px 0 22px;
}
.sg-category-intro {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 28px;
  line-height: 1.65;
  color: #58677b;
}
.sg-category-thumb {
  width: 150px;
  max-height: 130px;
  object-fit: contain;
  border: 1px solid #e5eaf0;
  border-radius: 12px;
  padding: 10px;
}
.sg-category-description {
  min-width: 0;
}

.sg-subcategories {
  margin: 18px 0 30px;
}
.sg-subcategories h2 {
  font-size: 20px !important;
  margin: 0 0 14px !important;
}
.sg-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sg-subcategory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 16px;
  background: #f7f9fc;
  border: 1px solid #e3eaf2;
  border-radius: 11px;
  font-weight: 600;
  color: #172c49;
  text-decoration: none !important;
}
.sg-subcategory:hover {
  background: #eef5fc;
  border-color: #bdd6ed;
  color: #1766a6;
}

.sg-catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid #e5eaf0;
  border-bottom: 1px solid #e5eaf0;
  margin-bottom: 24px;
}
.sg-view-switch {
  display: flex;
  gap: 5px;
  margin-right: auto;
}
.sg-toolbar-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sg-toolbar-control label {
  margin: 0;
  white-space: nowrap;
  color: #627389;
  font-size: 13px;
}
.sg-toolbar-control select {
  max-width: 190px;
  border-radius: 8px;
}

.sg-product-grid {
  display: flex;
  flex-wrap: wrap;
  row-gap: 22px;
}
.sg-product-grid > .product-layout {
  display: flex;
  margin-bottom: 0;
}
.sg-product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  overflow: hidden;
  background: white;
  transition: box-shadow 0.2s, transform 0.2s;
}
.sg-product-card:hover {
  box-shadow: 0 12px 30px rgba(20, 44, 74, 0.1);
  transform: translateY(-2px);
}
.sg-product-card .sg-product-image {
  height: 215px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-product-card .sg-product-image img {
  max-height: 183px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.sg-product-card .sg-product-body {
  flex: 1;
  min-height: 120px;
  padding: 12px 15px 15px;
}
.sg-product-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}
.sg-product-card h4 a {
  color: #172c49;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.sg-product-card .price {
  margin: 12px 0 0;
  color: #172c49;
  font-size: 20px;
  font-weight: 750;
}
.sg-product-card .price-old {
  font-size: 13px;
  color: #98a3b3;
  text-decoration: line-through;
  font-weight: 400;
}
.sg-product-card .price-new {
  color: #1766a6;
}
.sg-product-card .price-tax {
  display: block;
  font-size: 11px;
  color: #8795a5;
  font-weight: 400;
}
.sg-rating {
  color: #f49a34;
  font-size: 12px;
}

.sg-product-actions {
  display: flex;
  gap: 7px;
  padding: 12px 14px 14px;
  border-top: 1px solid #edf0f4;
  background: #fff;
}
.sg-product-actions button {
  height: 40px;
  min-width: 40px;
  border: 1px solid #e0e8f0;
  border-radius: 8px;
  background: #fff;
  color: #1766a6;
}
.sg-product-actions .sg-add-cart {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #1766a6;
  color: white;
  border-color: #1766a6;
  font-weight: 600;
}
.sg-product-actions button:hover {
  background: #172c49;
  color: white;
  border-color: #172c49;
}

.sg-pagination {
  margin-top: 26px;
}
.sg-empty-products {
  padding: 45px 0;
  text-align: center;
}
.sg-section-title {
  font-size: 25px;
  font-weight: 700;
  margin: 28px 0 22px;
}

.sg-footer {
  margin-top: 48px;
  background: #172c49;
  color: #d4e0ed;
  padding: 48px 0 0;
}
.sg-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 36px;
}
.sg-footer-brand {
  font-size: 23px;
  font-weight: 800;
  color: white;
  margin-bottom: 15px;
}
.sg-footer-about p {
  line-height: 1.65;
  max-width: 280px;
}
.sg-footer h4 {
  color: white;
  font-size: 15px;
  font-weight: 700;
  margin: 3px 0 18px;
}
.sg-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sg-footer li {
  margin: 0 0 11px;
}
.sg-footer a {
  color: #d4e0ed;
  text-decoration: none;
}
.sg-footer a:hover {
  color: white;
}
.sg-footer-social {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.sg-footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: white;
}
.sg-footer-social img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.sg-footer-bottom {
  margin-top: 38px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 12px;
}
.sg-footer-bottom a {
  color: #d4e0ed;
}

@media (max-width: 991px) {
  .sg-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sg-subcategory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .sg-page-heading h1 {
    font-size: 25px;
  }
  .sg-category-intro {
    flex-direction: column;
  }
  .sg-category-thumb {
    width: 120px;
  }
  .sg-catalog-toolbar {
    gap: 10px;
  }
  .sg-toolbar-control {
    flex: 1 1 170px;
  }
  .sg-toolbar-control select {
    width: 100%;
  }
  .sg-subcategory-grid {
    grid-template-columns: 1fr;
  }
  .sg-product-grid > .product-layout {
    width: 50%;
  }
  .sg-product-card .sg-product-image {
    height: 175px;
  }
  .sg-product-card .sg-product-image img {
    max-height: 150px;
  }
  .sg-product-actions {
    gap: 4px;
    padding: 8px;
  }
  .sg-product-actions button {
    min-width: 32px;
  }
  .sg-product-actions .sg-add-cart span {
    font-size: 11px;
  }
  .sg-footer-grid {
    gap: 24px;
  }
}
@media (max-width: 480px) {
  .sg-product-grid > .product-layout {
    width: 100%;
  }
  .sg-footer-grid {
    grid-template-columns: 1fr;
  }
  .sg-footer-bottom {
    display: block;
  }
  .sg-footer-bottom span {
    display: block;
    margin-bottom: 8px;
  }
}

/* ---------- 9. v5 — подгонка под реальный каталог 2026 ---------- */
:root {
  --sg-ink: #173963;
  --sg-blue: #1667a8;
  --sg-orange: #f58225;
  --sg-border: #e4eaf1;
  --sg-muted: #66788b;
}

body {
  color: #20364b;
  background: #fff;
}

#top {
  background: #f6f8fb;
  border-bottom: 1px solid var(--sg-border);
}
#top > .container {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 0px !important;
}
#top-links {
  float: none !important;
}
#top-links .list-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
#top-links .list-inline > li {
  padding: 0;
}
#top-links a {
  color: var(--sg-ink);
}

header > .container {
  padding-top: 18px;
  padding-bottom: 18px;
}
header .row {
  display: flex;
  align-items: center;
  gap: 28px;
}
header .row > [class*="col-"] {
  float: none;
  padding-left: 0;
  padding-right: 0;
}
header .row > .col-sm-4 {
  width: 230px;
  flex: 0 0 230px;
}
header .row > .col-sm-5 {
  width: auto;
  flex: 1;
  min-width: 0;
}
header .row > .col-sm-3 {
  width: 240px;
  flex: 0 0 240px;
}

#logo img {
  max-width: 205px;
  max-height: 85px;
  object-fit: contain;
}

#search {
  width: 100%;
  display: flex;
}
#search .input-lg {
  height: 48px;
  flex: 1;
  min-width: 0;
  border-radius: 10px 0 0 10px;
}
#search .btn-lg {
  height: 48px;
  border-radius: 0 10px 10px 0;
  background: var(--sg-blue);
  border-color: var(--sg-blue);
}

#cart > .btn {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  background: var(--sg-ink);
  border: 0;
}

#menu {
  background: var(--sg-ink);
  border: 0;
  border-radius: 10px;
  margin-top: 4px;
  margin-bottom: 20px;
}
#menu .nav > li > a {
  color: #fff;
}
#menu .nav > li > a:hover {
  background: #245482;
}

.sg-category-page .sg-page-heading h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sg-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sg-subcategory {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  color: var(--sg-ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sg-subcategory:hover {
  border-color: var(--sg-blue);
  color: var(--sg-blue);
  text-decoration: none;
}

.sg-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}

.sg-product-card {
  height: 100%;
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.sg-product-card:hover {
  border-color: #c9d9e8;
  box-shadow: 0 12px 30px rgba(23, 57, 99, 0.08);
}

.sg-product-image {
  height: 225px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sg-product-body {
  flex: 1;
  padding: 14px 16px;
}
.sg-product-body h4 {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  min-height: 64px;
  max-height: 64px;
  overflow: hidden;
  margin: 0 0 12px;
}
.sg-product-body h4 a {
  color: var(--sg-ink);
}
.sg-product-body .price {
  font-size: 21px;
  font-weight: 700;
  color: var(--sg-ink);
  margin: 0;
}

.sg-product-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.sg-product-actions button {
  border: 1px solid var(--sg-border);
  background: #fff;
  border-radius: 9px;
  min-height: 42px;
  padding: 0 12px;
}
.sg-product-actions .sg-add-cart {
  background: var(--sg-blue);
  color: #fff;
  border-color: var(--sg-blue);
  flex: 1;
}

.sg-product-grid > .product-layout {
  margin-bottom: 22px;
}

.sg-footer {
  background: #112c4c;
  color: #d9e6f5;
  padding: 44px 0 20px;
}
.sg-footer a {
  color: #d9e6f5;
}
.sg-footer a:hover {
  color: #fff;
}
.sg-footer h4 {
  color: #fff;
}
.sg-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 18px;
  margin-top: 24px;
}

@media (max-width: 991px) {
  header .row {
    gap: 14px;
  }
  header .row > .col-sm-4 {
    width: 170px;
    flex-basis: 170px;
  }
  header .row > .col-sm-3 {
    width: 190px;
    flex-basis: 190px;
  }
  #logo img {
    max-width: 165px;
  }
  .sg-subcategory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  header .row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  header .row > .col-sm-4 {
    flex: 1 1 100%;
    width: 100%;
  }
  header .row > .col-sm-5 {
    flex: 1 1 calc(100% - 140px);
  }
  header .row > .col-sm-3 {
    flex: 0 0 128px;
    width: 128px;
  }
  #logo img {
    max-height: 65px;
  }
  #cart > .btn {
    font-size: 11px;
  }
  #top > .container {
    justify-content: center;
  }
  #top-links .list-inline {
    justify-content: center;
  }
  .sg-subcategory-grid {
    grid-template-columns: 1fr;
  }
  .sg-product-image {
    height: 190px;
  }
}

/* ============================================================
   Сангрупмаркет v6 — карточки, категории и подвал.
   Подключать ПОСЛЕ существующего CSS.
   ============================================================ */

/* ---------- Сетка товаров ---------- */
.sg-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 28px;
}

.sg-product-grid__item {
  min-width: 0;
  width: auto !important;
  float: none !important;
  padding: 0 !important;
}

/* ---------- Карточка товара ---------- */
.sg-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 385px;
  background: #fff;
  border: 1px solid #e4eaf2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(20, 48, 83, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.sg-product-card:hover {
  box-shadow: 0 10px 26px rgba(20, 48, 83, 0.12);
  transform: translateY(-2px);
}

.sg-product-card__image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  padding: 16px;
  background: #fff;
}

.sg-product-card__image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sg-product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
}

.sg-product-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #17375e;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 63px;
}

.sg-product-card__rating {
  color: #eaa12b;
  font-size: 12px;
  margin-top: 8px;
}

.sg-product-card__price {
  margin-top: auto;
  padding: 14px 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sg-product-card__price strong {
  font-size: 20px;
  color: #122e52;
}

.sg-product-card__price del {
  font-size: 13px;
  color: #8795a7;
}

/* ---------- Кнопки действий ---------- */
.sg-product-card__actions {
  display: flex;
  gap: 7px;
}

.sg-product-card__actions button {
  height: 39px;
  border-radius: 8px;
  cursor: pointer;
}

.sg-product-card__buy {
  flex: 1;
  min-width: 0;
  background: #1966a6;
  border: 1px solid #1966a6;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.sg-product-card__buy:hover {
  background: #144e80;
}

.sg-product-card__icon {
  width: 39px;
  flex-shrink: 0;
  background: #f4f7fb;
  border: 1px solid #e1e8f1;
  color: #17375e;
}

/* ---------- Заголовки секций ---------- */
.sg-section-title {
  font-size: 24px;
  font-weight: 700;
  color: #17375e;
  margin: 26px 0 18px;
}

#product-category h2 {
  font-size: 28px;
  font-weight: 700;
  color: #17375e;
}

/* ---------- Панель сортировки на странице категории ---------- */
#product-category #content > div.row:has(#input-sort) {
  background: #f7f9fc;
  border-radius: 12px;
  padding: 12px 4px;
  margin: 20px -4px;
}

/* ---------- Подвал ---------- */
.sg-footer {
  background: #142e50;
  color: #dbe5f1;
  padding: 44px 0 18px;
  margin-top: 50px;
}

.sg-footer h5 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
}

.sg-footer a {
  color: #dbe5f1;
}

.sg-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.sg-footer hr {
  border-color: #35516f;
}

.sg-footer__bottom {
  font-size: 12px;
  color: #aebfd2;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1199px) {
  .sg-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sg-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .sg-product-card {
    min-height: 340px;
  }

  .sg-product-card__image {
    height: 155px;
    padding: 10px;
  }

  .sg-product-card__body {
    padding: 10px;
  }

  .sg-product-card__title {
    font-size: 12px;
    min-height: 54px;
  }

  .sg-product-card__price strong {
    font-size: 16px;
  }

  .sg-product-card__icon {
    width: 32px;
  }

  .sg-product-card__actions button {
    height: 36px;
  }

  .sg-product-card__buy {
    font-size: 11px;
  }

  .sg-product-card__buy .fa {
    display: none;
  }

  .sg-footer {
    padding-top: 30px;
  }
}

@media (max-width: 370px) {
  .sg-product-grid {
    grid-template-columns: 1fr;
  }

  .sg-product-card__image {
    height: 190px;
  }
}


/* Сангрупмаркет — выравнивание карточек v7 */
/* Подключить ПОСЛЕ всех предыдущих CSS */

/* ===== НОВАЯ СЕТКА ТОВАРОВ ===== */

.sg-product-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

/* Категории с боковой колонкой */
#product-category #content.col-sm-9 .sg-product-grid,
#product-category #content.col-sm-6 .sg-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.sg-product-grid__item {
  min-width: 0 !important;
  width: auto !important;
  float: none !important;
  display: flex !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===== КАРТОЧКА ТОВАРА ===== */

.sg-product-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 14px !important;
  background: #fff !important;
  overflow: hidden !important;
  box-shadow: 0 2px 10px rgba(15,45,80,.035) !important;
  transform: none !important;
}

/* ===== ИЗОБРАЖЕНИЯ ===== */

.sg-product-card__image {
  height: 210px !important;
  flex: 0 0 210px !important;
  padding: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sg-product-card__image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* ===== НАЗВАНИЕ И ОПИСАНИЕ ===== */

.sg-product-card__body {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  padding: 16px !important;
  min-height: 0 !important;
}

.sg-product-card__title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  line-height: 1.45 !important;
  height: 61px !important;
  min-height: 61px !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  color: #16385e !important;
}

/* ===== ЦЕНЫ ===== */

.sg-product-card__price {
  margin-top: auto !important;
  padding: 18px 0 14px !important;
  min-height: 60px !important;
  display: flex !important;
  align-items: end !important;
  gap: 8px !important;
}

.sg-product-card__price strong {
  font-size: 22px !important;
  line-height: 1.2 !important;
}

/* ===== КНОПКИ ===== */

.sg-product-card__actions {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 42px 42px !important;
  gap: 8px !important;
  align-items: stretch !important;
  margin: 0 !important;
}

.sg-product-card__actions button {
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 9px !important;
  line-height: 1.2 !important;
}

.sg-product-card__buy {
  width: 100% !important;
  padding: 0 8px !important;
  white-space: nowrap !important;
}

.sg-product-card__icon {
  width: 42px !important;
  padding: 0 !important;
}

/* ===== СТАНДАРТНЫЕ КАРТОЧКИ OPENCART ===== */

#product-category .product-layout .product-thumb,
.sg-featured .product-layout .product-thumb {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: none !important;
  background: #fff !important;
}

#product-category .product-layout .product-thumb > .image,
.sg-featured .product-layout .product-thumb > .image {
  height: 210px !important;
  flex: 0 0 210px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

#product-category .product-layout .product-thumb > .image img,
.sg-featured .product-layout .product-thumb > .image img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

#product-category .product-layout .product-thumb .caption,
.sg-featured .product-layout .product-thumb .caption {
  min-height: 0 !important;
  flex: 1 !important;
  padding: 16px !important;
}

#product-category .product-layout .product-thumb .caption h4,
.sg-featured .product-layout .product-thumb .caption h4 {
  height: 66px !important;
  overflow: hidden !important;
  line-height: 1.45 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

/*#product-category .product-layout .product-thumb .caption > p:not(.price),*/
/*.sg-featured .product-layout .product-thumb .caption > p:not(.price) {*/
/*  display: none !important;*/
/*}*/

#product-category .product-layout .product-thumb .button-group,
.sg-featured .product-layout .product-thumb .button-group {
  margin-top: auto !important;
  display: flex !important;
  min-height: 44px !important;
}

#product-category .product-layout .product-thumb .button-group button:first-child,
.sg-featured .product-layout .product-thumb .button-group button:first-child {
  flex: 1 !important;
  width: auto !important;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 1199px) {
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  }
}

@media (max-width: 991px) {
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}

@media (max-width: 540px) {
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    gap: 10px !important;
  }

  .sg-product-card__image {
    height: 145px !important;
    flex-basis: 145px !important;
    padding: 10px !important;
  }

  .sg-product-card__body {
    padding: 11px !important;
  }

  .sg-product-card__title {
    font-size: 12px !important;
    height: 55px !important;
    min-height: 55px !important;
  }

  .sg-product-card__price strong {
    font-size: 17px !important;
  }

  .sg-product-card__actions {
    grid-template-columns: minmax(0,1fr) 32px 32px !important;
    gap: 4px !important;
  }

  .sg-product-card__actions button {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11px !important;
  }

  .sg-product-card__icon {
    width: 32px !important;
  }
}


/* ==========================================================
   САНГРУПМАРКЕТ — ИСПРАВЛЕНИЯ v8
   Рекомендуемые товары, карточки, поиск и корзина
   Добавлено к существующему sangrup-custom.css
   ========================================================== */

/* ==========================================================
   1. ОТСТУП МЕЖДУ ПОИСКОМ И КОРЗИНОЙ
   ========================================================== */

/* Шапка с классами Сангруп */
header .sg-header-row {
  column-gap: 20px !important;
}

/* Поиск не должен прилипать к корзине */
header .sg-header-row .sg-search-col {
  padding-right: 20px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Стандартная Bootstrap-разметка шапки */
header .row > .col-sm-5 {
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Корзина сохраняет нормальную ширину */
header .sg-cart-col {
  flex-shrink: 0 !important;
}

/* ==========================================================
   2. РЕКОМЕНДУЕМЫЕ ТОВАРЫ НА ГЛАВНОЙ
   ТРИ КАРТОЧКИ В РЯД
   ========================================================== */

/* Новая сетка OpenCart / Сангруп */
#common-home .sg-product-grid,
#common-home .sg-featured .sg-product-grid,
#common-home #content .sg-product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  align-items: stretch !important;
  margin: 20px 0 30px !important;
}

/* Убираем ограничения старых Bootstrap-колонок */
#common-home .sg-product-grid > .sg-product-grid__item,
#common-home .sg-product-grid > .product-layout,
#common-home .sg-product-grid > [class*="col-"] {
  display: flex !important;
  flex-direction: column !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Если рекомендуемые выводятся стандартным модулем */
@media (min-width: 992px) {
  #common-home #content > .row:has(> .product-layout),
  #common-home #content > div > .row:has(> .product-layout) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
    align-items: stretch !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #common-home #content > .row:has(> .product-layout) > .product-layout,
  #common-home #content > div > .row:has(> .product-layout) > .product-layout {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
  }
}

/* ==========================================================
   3. ОДИНАКОВЫЕ КАРТОЧКИ РЕКОМЕНДУЕМЫХ ТОВАРОВ
   ========================================================== */

#common-home .sg-product-card,
#common-home .sg-featured .product-thumb,
#common-home .sg-product-grid .product-thumb {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 425px !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 3px 14px rgba(20, 48, 83, .05) !important;
  transform: none !important;
  transition: border-color .2s, box-shadow .2s !important;
}

#common-home .sg-product-card:hover,
#common-home .sg-featured .product-thumb:hover,
#common-home .sg-product-grid .product-thumb:hover {
  border-color: #c6d8e9 !important;
  box-shadow: 0 9px 24px rgba(20, 48, 83, .1) !important;
}

/* ==========================================================
   4. ОДИНАКОВЫЕ ФОТОГРАФИИ
   ========================================================== */

#common-home .sg-product-card__image,
#common-home .sg-product-card .sg-product-image,
#common-home .sg-featured .product-thumb > .image,
#common-home .sg-product-grid .product-thumb > .image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 210px !important;
  height: 210px !important;
  min-height: 210px !important;
  width: 100% !important;
  padding: 18px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
}

#common-home .sg-product-card__image a,
#common-home .sg-featured .product-thumb > .image a,
#common-home .sg-product-grid .product-thumb > .image a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

#common-home .sg-product-card__image img,
#common-home .sg-product-card .sg-product-image img,
#common-home .sg-featured .product-thumb > .image img,
#common-home .sg-product-grid .product-thumb > .image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* ==========================================================
   5. ОДИНАКОВЫЕ НАЗВАНИЯ
   ========================================================== */

#common-home .sg-product-card__body,
#common-home .sg-product-card .sg-product-body,
#common-home .sg-featured .product-thumb .caption,
#common-home .sg-product-grid .product-thumb .caption {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 16px !important;
}

#common-home .sg-product-card__title,
#common-home .sg-product-card .sg-product-body h4,
#common-home .sg-featured .product-thumb .caption h4,
#common-home .sg-product-grid .product-thumb .caption h4 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  flex: 0 0 66px !important;
  height: 66px !important;
  min-height: 66px !important;
  max-height: 66px !important;
  overflow: hidden !important;
  margin: 0 0 12px !important;
  color: #173963 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 22px !important;
}

#common-home .sg-product-card__title a,
#common-home .sg-product-card .sg-product-body h4 a,
#common-home .sg-featured .product-thumb h4 a,
#common-home .sg-product-grid .product-thumb h4 a {
  color: #173963 !important;
  font-size: 15px !important;
  line-height: 22px !important;
  text-decoration: none !important;
}

/* Убираем длинное описание внутри карточек */
/*#common-home .sg-featured .product-thumb .caption > p:not(.price),*/
/*#common-home .sg-product-grid .product-thumb .caption > p:not(.price) {*/
/*  display: none !important;*/
/*}*/

/* ==========================================================
   6. ЦЕНЫ НА ОДНОЙ ВЫСОТЕ
   ========================================================== */

#common-home .sg-product-card__price,
#common-home .sg-product-card .sg-product-body .price,
#common-home .sg-featured .product-thumb .price,
#common-home .sg-product-grid .product-thumb .price {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  min-height: 55px !important;
  padding: 14px 0 10px !important;
  color: #173963 !important;
  font-size: 21px !important;
  font-weight: 700 !important;
}

#common-home .sg-product-card__price strong {
  font-size: 21px !important;
  color: #173963 !important;
}

#common-home .price-old {
  color: #98a3b3 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

/* ==========================================================
   7. КНОПКИ КУПИТЬ / ИЗБРАННОЕ / СРАВНИТЬ
   ========================================================== */

#common-home .sg-product-card__actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px 42px !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
}

#common-home .sg-product-card__actions button {
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 9px !important;
}

#common-home .sg-product-card__buy {
  min-width: 0 !important;
  width: 100% !important;
  padding: 0 8px !important;
  background: #1667a8 !important;
  border-color: #1667a8 !important;
  color: #fff !important;
}

#common-home .sg-product-card__icon {
  width: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
}

/* Стандартные кнопки OpenCart */
#common-home .sg-featured .product-thumb .button-group,
#common-home .sg-product-grid .product-thumb .button-group {
  display: flex !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-height: 44px !important;
  margin-top: auto !important;
  background: #f8fafc !important;
}

#common-home .sg-featured .product-thumb .button-group button:first-child,
#common-home .sg-product-grid .product-thumb .button-group button:first-child {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  background: #1667a8 !important;
  color: #fff !important;
}

#common-home .sg-featured .product-thumb .button-group button:not(:first-child),
#common-home .sg-product-grid .product-thumb .button-group button:not(:first-child) {
  flex: 0 0 42px !important;
  width: 42px !important;
}

/* ==========================================================
   8. ОБЩАЯ СЕТКА КАТЕГОРИЙ — 3 В РЯД
   Исправляет старое правило v7 на 4 карточки
   ========================================================== */

.sg-product-grid,
#product-category #content.col-sm-9 .sg-product-grid,
#product-category #content.col-sm-6 .sg-product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

.sg-product-grid > .sg-product-grid__item,
.sg-product-grid > .product-layout {
  display: flex !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ==========================================================
   9. АДАПТИВНОСТЬ
   ========================================================== */

@media (max-width: 991px) {
  #common-home .sg-product-grid,
  #common-home .sg-featured .sg-product-grid,
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  header .sg-header-row .sg-search-col,
  header .row > .col-sm-5 {
    padding-right: 16px !important;
  }
}

@media (max-width: 767px) {
  header .sg-header-row {
    column-gap: 12px !important;
  }

  header .sg-header-row .sg-search-col,
  header .row > .col-sm-5 {
    padding-right: 12px !important;
  }
}

@media (max-width: 540px) {
  #common-home .sg-product-grid,
  #common-home .sg-featured .sg-product-grid,
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #common-home .sg-product-card,
  #common-home .sg-featured .product-thumb,
  #common-home .sg-product-grid .product-thumb {
    min-height: 350px !important;
  }

  #common-home .sg-product-card__image,
  #common-home .sg-product-card .sg-product-image,
  #common-home .sg-featured .product-thumb > .image,
  #common-home .sg-product-grid .product-thumb > .image {
    height: 145px !important;
    min-height: 145px !important;
    flex-basis: 145px !important;
    padding: 10px !important;
  }

  #common-home .sg-product-card__body,
  #common-home .sg-product-card .sg-product-body,
  #common-home .sg-featured .product-thumb .caption,
  #common-home .sg-product-grid .product-thumb .caption {
    padding: 10px !important;
  }

  #common-home .sg-product-card__title,
  #common-home .sg-product-card .sg-product-body h4,
  #common-home .sg-featured .product-thumb .caption h4,
  #common-home .sg-product-grid .product-thumb .caption h4 {
    flex-basis: 54px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    font-size: 12px !important;
    line-height: 18px !important;
  }

  #common-home .sg-product-card__title a,
  #common-home .sg-product-card .sg-product-body h4 a,
  #common-home .sg-featured .product-thumb h4 a,
  #common-home .sg-product-grid .product-thumb h4 a {
    font-size: 12px !important;
    line-height: 18px !important;
  }

  #common-home .sg-product-card__price strong,
  #common-home .sg-featured .product-thumb .price,
  #common-home .sg-product-grid .product-thumb .price {
    font-size: 17px !important;
  }

  #common-home .sg-product-card__actions {
    grid-template-columns: minmax(0, 1fr) 32px 32px !important;
    gap: 4px !important;
  }

  #common-home .sg-product-card__actions button {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11px !important;
  }

  #common-home .sg-product-card__icon {
    width: 32px !important;
    min-width: 32px !important;
  }
}

@media (max-width: 430px) {
  header .sg-header-row .sg-search-col,
  header .row > .col-sm-5 {
    padding-right: 0 !important;
  }

  header .sg-header-row {
    row-gap: 12px !important;
  }
}

@media (max-width: 370px) {
  #common-home .sg-product-grid,
  #common-home .sg-featured .sg-product-grid,
  .sg-product-grid,
  #product-category #content.col-sm-9 .sg-product-grid,
  #product-category #content.col-sm-6 .sg-product-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ======================================================
   САНГРУПМАРКЕТ — v11
   КОМПАКТНАЯ СОРТИРОВКА И КАРТОЧКИ СПИСКОМ
   ====================================================== */

/* ===== ПАНЕЛЬ СОРТИРОВКИ ===== */

#product-category .sg-catalog-toolbar,
#product-category #content > .row:has(#input-sort) {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  margin: 18px 0 24px !important;
  background: #fff !important;
  border: 1px solid #e0e8f1 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(25,55,85,.035) !important;
}

/* Сбрасываем лишние отступы Bootstrap */
#product-category #content > .row:has(#input-sort)
> [class*="col-"] {
  margin-bottom: 0 !important;
}

/* Кнопки вида */
#product-category #list-view,
#product-category #grid-view {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff !important;
  color: #1766a6 !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

#product-category #list-view i,
#product-category #grid-view i {
  font-size: 16px !important;
  color: inherit !important;
}

#product-category #list-view:hover,
#product-category #grid-view:hover {
  background: #edf5fc !important;
  color: #1766a6 !important;
}

#product-category #list-view.active,
#product-category #grid-view.active {
  background: #1766a6 !important;
  color: #fff !important;
  border-color: #1766a6 !important;
}

/* Сравнение */
#product-category #compare-total {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 38px !important;
  padding: 0 10px !important;
  color: #1766a6 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

#product-category #compare-total:hover {
  background: #edf5fc !important;
}

/* Убираем серые прямоугольники подписей */
#product-category label[for="input-sort"],
#product-category label[for="input-limit"],
#product-category .input-group-addon {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #61738a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 0 8px 0 0 !important;
}

/* Выпадающие списки */
#product-category #input-sort,
#product-category #input-limit {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 30px 0 12px !important;
  background-color: #fff !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 8px !important;
  color: #173963 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

/* ===== РЕЖИМ СПИСКА ===== */

/* Контейнер с товарами в режиме списка */
#product-category .sg-product-grid:has(> .product-list) {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

/* Каждый товар занимает всю строку */
#product-category .product-list,
#product-category .sg-product-grid > .product-list {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding: 0 !important;
  margin: 0 0 14px !important;
}

/* Карточка: фото | информация | действия */
#product-category .product-list .product-thumb {
  display: grid !important;
  grid-template-columns: 180px minmax(0,1fr) 160px !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  gap: 18px !important;

  width: 100% !important;
  min-height: 200px !important;
  height: auto !important;
  padding: 16px !important;
  margin: 0 !important;

  background: #fff !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(20,48,83,.04) !important;
  overflow: hidden !important;
}

/* Фото */
#product-category .product-list .product-thumb > .image {
  grid-column: 1 !important;
  grid-row: 1 !important;
  float: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 180px !important;
  height: 165px !important;
  min-height: 0 !important;
  max-height: 165px !important;

  padding: 5px !important;
  margin: 0 !important;
}

#product-category .product-list .product-thumb > .image a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

#product-category .product-list .product-thumb > .image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Информация */
#product-category .product-list .product-thumb > .caption {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;

  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Название */
#product-category .product-list .product-thumb .caption h4 {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: none !important;
  margin: 0 0 8px !important;
  overflow: visible !important;
}

#product-category .product-list .product-thumb .caption h4 a {
  display: block !important;
  color: #173963 !important;
  font-size: 17px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

/* Описание */
#product-category .product-list .product-thumb
.caption > p:not(.price) {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  max-height: 42px !important;
  overflow: hidden !important;
  margin: 0 0 10px !important;
  color: #718196 !important;
  font-size: 13px !important;
  line-height: 21px !important;
}

/* Цена */
#product-category .product-list .product-thumb .price {
  margin: 4px 0 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  color: #173963 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
}

/* Блок кнопок справа */
#product-category .product-list .product-thumb > .button-group {
  grid-column: 3 !important;
  grid-row: 1 !important;

  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 8px !important;
  align-content: center !important;
  align-items: center !important;

  width: 160px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;

  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

/* Кнопка купить */
#product-category .product-list .product-thumb
.button-group button:first-child {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  float: none !important;
  background: #1766a6 !important;
  border: 1px solid #1766a6 !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* Избранное и сравнение */
#product-category .product-list .product-thumb
.button-group button:not(:first-child) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;

  background: #f2f7fc !important;
  border: 1px solid #e0e9f2 !important;
  border-radius: 8px !important;
  color: #1766a6 !important;
}

#product-category .product-list .product-thumb
.button-group button:hover {
  filter: brightness(.94);
}

/* ===== ПЛАНШЕТ ===== */

@media (max-width: 991px) {
  #product-category .product-list .product-thumb {
    grid-template-columns: 135px minmax(0,1fr) 125px !important;
    gap: 12px !important;
    padding: 12px !important;
    min-height: 170px !important;
  }

  #product-category .product-list .product-thumb > .image {
    width: 135px !important;
    height: 135px !important;
    max-height: 135px !important;
  }

  #product-category .product-list .product-thumb > .button-group {
    width: 125px !important;
  }
}

/* ===== МОБИЛЬНЫЕ ===== */

@media (max-width: 767px) {
  #product-category .product-list .product-thumb {
    grid-template-columns: 105px minmax(0,1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 12px !important;
  }

  #product-category .product-list .product-thumb > .image {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 105px !important;
    height: 115px !important;
    max-height: 115px !important;
  }

  #product-category .product-list .product-thumb > .caption {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  #product-category .product-list .product-thumb .caption h4 a {
    font-size: 14px !important;
  }

  #product-category .product-list .product-thumb .price {
    font-size: 19px !important;
  }

  #product-category .product-list .product-thumb
  .caption > p:not(.price) {
    display: none !important;
  }

  #product-category .product-list .product-thumb > .button-group {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-template-columns: minmax(0,1fr) 42px 42px !important;
    width: 100% !important;
  }

  #product-category .product-list .product-thumb
  .button-group button:first-child {
    grid-column: 1 !important;
  }
}


/* ==========================================
   САНГРУПМАРКЕТ — РОВНЫЕ ОТСТУПЫ СОРТИРОВКИ
   ========================================== */

#product-category .sg-catalog-toolbar,
#product-category #content > .row:has(#input-sort) {
  min-height: 0 !important;
  height: auto !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  align-items: center !important;
}

/* Убираем лишнюю высоту внутренних колонок */
#product-category #content > .row:has(#input-sort) > [class*="col-"] {
  min-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Убираем нижние отступы у групп полей */
#product-category .sg-catalog-toolbar .form-group,
#product-category #content > .row:has(#input-sort) .form-group,
#product-category #content > .row:has(#input-sort) .input-group {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}


/* ======================================================
   САНГРУПМАРКЕТ — КОРЗИНЫ v13
   Мини-корзина + страница корзины
   ====================================================== */

/* ===== МИНИ-КОРЗИНА ===== */

#cart > .sg-mini-cart-menu {
  width: 440px !important;
  min-width: 440px !important;
  max-width: calc(100vw - 24px) !important;
  right: 0 !important;
  left: auto !important;
  margin-top: 16px !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid #e0e8f1 !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(18,47,78,.16) !important;
  overflow: hidden;
}

#cart .sg-mini-cart-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px;
  border-bottom: 1px solid #eaf0f6;
  color: #173963;
  font-size: 16px;
  font-weight: 700;
}

#cart .sg-mini-cart-heading i {
  color: #1766a6;
  font-size: 18px;
}

#cart .sg-mini-cart-items {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 14px;
}

#cart .sg-mini-cart-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f6;
}

#cart .sg-mini-cart-item:last-child {
  border-bottom: 0;
}

#cart .sg-mini-cart-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  padding: 5px;
  border: 1px solid #edf1f6;
  border-radius: 9px;
  background: #fff;
}

#cart .sg-mini-cart-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#cart .sg-mini-cart-voucher,
#cart .sg-mini-cart-no-image {
  color: #1766a6;
  font-size: 23px;
}

#cart .sg-mini-cart-details {
  min-width: 0;
}

#cart .sg-mini-cart-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #173963 !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
}

#cart a.sg-mini-cart-name:hover {
  color: #1766a6 !important;
}

#cart .sg-mini-cart-option {
  margin-top: 4px;
  color: #7a8a9b;
  font-size: 11px;
}

#cart .sg-mini-cart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: #77889a;
}

#cart .sg-mini-cart-meta strong {
  color: #173963;
  font-size: 15px;
}

#cart .sg-mini-cart-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff4f4;
  border: 1px solid #f7dddd;
  border-radius: 7px;
  color: #cf5252;
  cursor: pointer;
}

#cart .sg-mini-cart-remove:hover {
  background: #cf5252;
  color: #fff;
}

#cart .sg-mini-cart-summary {
  padding: 12px 18px;
  background: #f7f9fc;
  border-top: 1px solid #eaf0f6;
}

#cart .sg-mini-cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  color: #65768a;
  font-size: 13px;
}

#cart .sg-mini-cart-total-row strong {
  color: #173963;
  font-size: 14px;
}

#cart .sg-mini-cart-grand-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #e1e8f0;
  color: #173963;
  font-weight: 700;
}

#cart .sg-mini-cart-grand-total strong {
  font-size: 19px;
}

#cart .sg-mini-cart-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px 18px 18px;
  background: #fff;
}

#cart .sg-mini-cart-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
}

#cart .sg-mini-cart-btn-primary {
  background: #1766a6;
  border: 1px solid #1766a6;
  color: #fff !important;
}

#cart .sg-mini-cart-btn-primary:hover {
  background: #124f82;
}

#cart .sg-mini-cart-btn-secondary {
  background: #fff7ef;
  border: 1px solid #f2d7ba;
  color: #b65d17 !important;
}

#cart .sg-mini-cart-btn-secondary:hover {
  background: #ffead6;
}

#cart .sg-mini-cart-empty {
  padding: 28px 16px;
  text-align: center;
  color: #8190a0;
}

#cart .sg-mini-cart-empty > i {
  display: block;
  margin-bottom: 12px;
  color: #b7c8d8;
  font-size: 32px;
}

/* ===== БОЛЬШАЯ КОРЗИНА ===== */

#checkout-cart.sg-cart-page {
  padding-bottom: 35px;
}

#checkout-cart .sg-cart-page-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 25px;
  color: #173963;
  font-size: 29px;
  font-weight: 700;
}

#checkout-cart .sg-cart-page-title > i {
  color: #1766a6;
}

#checkout-cart .sg-cart-page-title small {
  color: #8a98a8;
  font-size: 13px;
  font-weight: 400;
}

#checkout-cart .sg-cart-table-wrap {
  border: 1px solid #e0e8f1;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 3px 14px rgba(20,48,83,.035);
}

#checkout-cart .sg-cart-table-wrap .table-responsive {
  margin-bottom: 0;
  border: 0;
}

#checkout-cart .sg-cart-table {
  width: 100%;
  margin-bottom: 0;
  border: 0;
}

#checkout-cart .sg-cart-table thead {
  background: #f4f7fb;
}

#checkout-cart .sg-cart-table thead td {
  padding: 15px 12px;
  border-bottom: 1px solid #e3eaf2;
  color: #526780;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#checkout-cart .sg-cart-table tbody td {
  padding: 16px 12px;
  vertical-align: middle;
  border-top: 1px solid #edf1f6;
  color: #40556d;
  font-size: 13px;
}

#checkout-cart .sg-cart-product-image img {
  width: 74px;
  height: 74px;
  max-width: none;
  padding: 5px;
  object-fit: contain;
  border: 1px solid #edf1f6;
  border-radius: 9px;
}

#checkout-cart .sg-cart-product-image > i {
  color: #1766a6;
  font-size: 24px;
}

#checkout-cart .sg-cart-product-name a {
  color: #173963;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

#checkout-cart .sg-cart-product-name a:hover {
  color: #1766a6;
}

#checkout-cart .sg-cart-product-option {
  margin-top: 5px;
  color: #8190a0;
  font-size: 12px;
}

#checkout-cart .sg-cart-model {
  color: #8190a0;
  font-size: 12px;
}

#checkout-cart .sg-cart-quantity {
  width: 145px;
  max-width: 145px;
}

#checkout-cart .sg-cart-quantity .form-control {
  height: 38px;
  text-align: center;
  border-color: #dce6f0;
  box-shadow: none;
}

#checkout-cart .sg-cart-quantity .btn {
  height: 38px;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
}

#checkout-cart .sg-cart-update {
  background: #eaf3fb;
  border: 1px solid #d1e5f5;
  color: #1766a6;
}

#checkout-cart .sg-cart-update:hover {
  background: #1766a6;
  color: #fff;
}

#checkout-cart .sg-cart-delete {
  background: #fff1f1;
  border: 1px solid #f5d9d9;
  color: #d34d4d;
}

#checkout-cart .sg-cart-delete:hover {
  background: #d34d4d;
  color: #fff;
}

#checkout-cart .sg-cart-price {
  white-space: nowrap;
  color: #53677f;
}

#checkout-cart .sg-cart-line-total {
  white-space: nowrap;
  color: #173963 !important;
  font-size: 16px !important;
  font-weight: 700;
}

#checkout-cart .sg-cart-extra {
  margin-top: 25px;
}

#checkout-cart .sg-cart-extra h2 {
  font-size: 21px;
}

#checkout-cart .sg-cart-summary {
  width: 100%;
  max-width: 370px;
  margin: 28px 0 24px auto;
  padding: 20px;
  background: #f7f9fc;
  border: 1px solid #e3eaf2;
  border-radius: 12px;
}

#checkout-cart .sg-cart-summary h3 {
  margin: 0 0 16px;
  color: #173963;
  font-size: 17px;
  font-weight: 700;
}

#checkout-cart .sg-cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: #65768a;
  font-size: 13px;
}

#checkout-cart .sg-cart-summary-row strong {
  color: #173963;
  font-size: 14px;
}

#checkout-cart .sg-cart-summary-final {
  margin-top: 5px;
  padding-top: 14px;
  border-top: 1px solid #dfe7f0;
  color: #173963;
  font-weight: 700;
}

#checkout-cart .sg-cart-summary-final strong {
  font-size: 22px;
}

#checkout-cart .sg-cart-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 15px;
}

#checkout-cart .sg-cart-continue,
#checkout-cart .sg-cart-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-shadow: none;
}

#checkout-cart .sg-cart-continue {
  background: #fff;
  border: 1px solid #dbe5f0;
  color: #1766a6;
}

#checkout-cart .sg-cart-continue:hover {
  background: #edf5fc;
}

#checkout-cart .sg-cart-checkout {
  background: #1766a6;
  border: 1px solid #1766a6;
  color: #fff;
}

#checkout-cart .sg-cart-checkout:hover {
  background: #124f82;
  color: #fff;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */

@media (max-width: 767px) {
  #cart > .sg-mini-cart-menu {
    width: min(440px, calc(100vw - 24px)) !important;
    min-width: 0 !important;
  }

  #checkout-cart .sg-cart-page-title {
    font-size: 24px;
  }

  #checkout-cart .sg-cart-table {
    min-width: 700px;
  }

  #checkout-cart .sg-cart-table tbody td {
    padding: 12px 8px;
  }

  #checkout-cart .sg-cart-summary {
    max-width: 100%;
  }

  #checkout-cart .sg-cart-bottom-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #checkout-cart .sg-cart-continue,
  #checkout-cart .sg-cart-checkout {
    width: 100%;
  }
}


/* ===================================================
   САНГРУПМАРКЕТ — ПОИСК v17
   Только CSS. Старый search.twig не меняем.
   =================================================== */

/* Форма поиска */
#product-search #input-search,
#product-search select[name="category_id"] {
  height: 42px;
  border: 1px solid #dce5ef;
  border-radius: 9px;
  box-shadow: none;
  color: #173963;
}

#product-search #button-search {
  min-height: 42px;
  padding: 9px 22px;
  border-radius: 9px;
  background: #1766a6;
  border-color: #1766a6;
  font-weight: 600;
  text-shadow: none;
}

/* Панель сортировки */
#product-search #content > .row:has(#input-sort) {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin: 20px 0 22px !important;
  padding: 14px 16px !important;
  background: #f7f9fc !important;
  border: 1px solid #e1e9f2 !important;
  border-radius: 12px !important;
}

#product-search #content > .row:has(#input-sort) > div {
  float: none !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

#product-search #content > .row:has(#input-sort) .form-group {
  margin: 0 !important;
}

#product-search #content > .row:has(#input-sort) .input-group {
  display: flex !important;
  align-items: center !important;
}

#product-search #content > .row:has(#input-sort) .input-group-addon {
  display: flex !important;
  align-items: center !important;
  height: 40px !important;
  padding: 0 10px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #526b86 !important;
  font-weight: 600 !important;
}

#product-search #input-sort,
#product-search #input-limit {
  height: 40px !important;
  border: 1px solid #d9e5f0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #173963 !important;
  box-shadow: none !important;
}

#product-search #input-sort {
  width: 185px !important;
}

#product-search #input-limit {
  width: 80px !important;
}

#product-search #compare-total {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #eaf3fb;
  color: #1766a6;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* Скрываем кнопки переключения вида */
#product-search #list-view,
#product-search #grid-view {
  display: none !important;
}

/* Убираем пустое место от колонки с переключателями */
#product-search #content > .row:has(#input-sort)
> .col-md-2 {
  display: none !important;
}

/* Сетка товаров — 4 в ряд */
#product-search #content > .row:has(> .product-layout) {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
  margin: 0 0 24px !important;
}

/* Убираем ширины Bootstrap */
#product-search #content > .row:has(> .product-layout)
> .product-layout {
  display: flex !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Карточка */
#product-search .product-layout .product-thumb {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 13px !important;
  box-shadow: 0 2px 10px rgba(20,48,83,.04) !important;
}

/* Фото */
#product-search .product-layout .product-thumb > .image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  width: 100% !important;
  height: 205px !important;
  flex: 0 0 205px !important;
  padding: 15px !important;
  margin: 0 !important;
}

#product-search .product-layout .product-thumb > .image a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

#product-search .product-layout .product-thumb > .image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Контейнер текста и кнопок */
#product-search .product-layout .product-thumb > div:not(.image) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Текст */
#product-search .product-layout .product-thumb .caption {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 14px !important;
}

/* Названия одной высоты */
#product-search .product-layout .product-thumb .caption h4 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  height: 63px !important;
  min-height: 63px !important;
  max-height: 63px !important;
  margin: 0 0 10px !important;
  line-height: 21px !important;
}

#product-search .product-layout .product-thumb .caption h4 a {
  color: #173963 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 21px !important;
}

/* Описания одной высоты */
#product-search .product-layout .product-thumb .caption > p:not(.price) {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 0 12px !important;
  color: #788aa0 !important;
  font-size: 12px !important;
  line-height: 21px !important;
}

/* Цена */
#product-search .product-layout .product-thumb .caption .price {
  margin: auto 0 0 !important;
  padding: 12px 0 0 !important;
  min-height: 44px !important;
  color: #173963 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

/* Кнопки внизу карточки */
#product-search .product-layout .product-thumb .button-group {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 38px 38px !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: auto !important;
  padding: 0 12px 14px !important;
  background: #fff !important;
  border: 0 !important;
}

#product-search .product-layout .product-thumb .button-group button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 5px !important;
  background: #edf5fc !important;
  border: 1px solid #dce7f2 !important;
  border-radius: 8px !important;
  color: #1766a6 !important;
  text-shadow: none !important;
}

#product-search .product-layout .product-thumb
.button-group button:first-child {
  background: #1766a6 !important;
  border-color: #1766a6 !important;
  color: #fff !important;
}

/* Адаптивность */
@media (max-width: 1199px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 540px) {
  #product-search #content > .row:has(> .product-layout) {
    gap: 10px !important;
  }

  #product-search .product-layout .product-thumb > .image {
    height: 145px !important;
    flex-basis: 145px !important;
    padding: 10px !important;
  }

  #product-search .product-layout .product-thumb .caption {
    padding: 10px !important;
  }

  #product-search .product-layout .product-thumb .button-group {
    grid-template-columns: minmax(0, 1fr) 32px 32px !important;
    gap: 4px !important;
    padding: 0 8px 10px !important;
  }

  #product-search .product-layout .product-thumb .button-group button {
    height: 36px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 370px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: 1fr !important;
  }
}

#product-search #content > .row:has(> .product-layout) {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

/* Каждая ячейка занимает всю высоту ряда */
#product-search #content > .row:has(> .product-layout)
> .product-layout {
  display: flex !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  float: none !important;
  width: 100% !important;
  padding: 0 !important;
}

/* Карточка растягивается по высоте ячейки */
#product-search .product-layout > .product-thumb {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
}

/* Контейнер под изображением растягивается */
#product-search .product-layout .product-thumb > div:not(.image) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
}

/* Текстовый блок заполняет свободное пространство */
#product-search .product-layout .product-thumb .caption {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

/* Цена располагается внизу текстовой части */
#product-search .product-layout .product-thumb .caption .price {
  margin-top: auto !important;
}

/* Кнопки прижаты к самому низу карточки */
#product-search .product-layout .product-thumb .button-group {
  flex: 0 0 auto !important;
  margin-top: auto !important;
  position: static !important;
  bottom: auto !important;
}

/* Отменяем фиксированную высоту стандартного OpenCart */
#product-search .product-layout.product-list .product-thumb,
#product-search .product-layout.product-grid .product-thumb {
  min-height: 0 !important;
}

/* Адаптивная сетка */
@media (max-width: 1199px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 370px) {
  #product-search #content > .row:has(> .product-layout) {
    grid-template-columns: 1fr !important;
  }
}

#product-category #content > .row:has(#input-sort),
#product-search #content > .row:has(#input-sort),
#product-category .sg-catalog-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 14px 20px !important;
  padding: 14px 18px !important;
  margin: 18px 0 24px !important;
  background: #f7f9fc !important;
  border: 1px solid #e0e9f3 !important;
  border-radius: 14px !important;
  min-height: 0 !important;
}

#product-category #content > .row:has(#input-sort) > div,
#product-search #content > .row:has(#input-sort) > div {
  float: none !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

#product-category #content > .row:has(#input-sort) .form-group,
#product-search #content > .row:has(#input-sort) .form-group,
#product-category .sg-catalog-toolbar .form-group {
  margin: 0 !important;
}

#product-category #content > .row:has(#input-sort) .input-group,
#product-search #content > .row:has(#input-sort) .input-group {
  display: flex !important;
  align-items: center !important;
  width: auto !important;
  margin: 0 !important;
}

#product-category #content > .row:has(#input-sort) .input-group-addon,
#product-search #content > .row:has(#input-sort) .input-group-addon {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  height: 42px !important;
  padding: 0 10px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #526b86 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

#product-category #input-sort,
#product-search #input-sort {
  width: 185px !important;
  min-width: 0 !important;
}

#product-category #input-limit,
#product-search #input-limit {
  width: 85px !important;
  min-width: 0 !important;
}

#product-category #input-sort,
#product-category #input-limit,
#product-search #input-sort,
#product-search #input-limit,
#product-category .sg-toolbar-control select {
  height: 42px !important;
  padding: 8px 30px 8px 12px !important;
  border: 1px solid #d8e4f0 !important;
  border-radius: 9px !important;
  background-color: #fff !important;
  color: #173963 !important;
  box-shadow: none !important;
  font-size: 13px !important;
}

#product-category #input-sort:focus,
#product-category #input-limit:focus,
#product-search #input-sort:focus,
#product-search #input-limit:focus {
  border-color: #1766a6 !important;
  box-shadow: 0 0 0 3px rgba(23,102,166,.1) !important;
}

/* Только плитки — скрываем переключатели */

#product-category #list-view,
#product-category #grid-view,
#product-search #list-view,
#product-search #grid-view,
#product-category .sg-view-switch {
  display: none !important;
}

#product-category #content > .row:has(#input-sort) > .col-md-2,
#product-search #content > .row:has(#input-sort) > .col-md-2 {
  display: none !important;
}

/* Кнопка сравнения */

#product-category #compare-total,
#product-search #compare-total {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  background: #eaf3fb !important;
  color: #1766a6 !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

#product-category #compare-total:hover,
#product-search #compare-total:hover {
  background: #dcecf9 !important;
}

/* 3. НОВЫЕ КАРТОЧКИ — ОДИНАКОВАЯ ВЫСОТА */

.sg-product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

.sg-product-grid__item {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.sg-product-card {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #fff !important;
}

.sg-product-card__image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 210px !important;
  flex: 0 0 210px !important;
  padding: 16px !important;
}

.sg-product-card__image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.sg-product-card__body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 16px !important;
}

.sg-product-card__title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  height: 64px !important;
  min-height: 64px !important;
  color: #173963 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  text-decoration: none !important;
}

.sg-product-card__description {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  min-height: 58px !important;
  max-height: 58px !important;
  margin: 10px 0 0 !important;
  color: #74869b !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.sg-product-card__rating {
  margin-top: 8px !important;
  color: #f4a340 !important;
}

.sg-product-card__price {
  display: flex !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: auto !important;
  padding: 16px 0 14px !important;
  min-height: 58px !important;
}

.sg-product-card__price strong {
  color: #173963 !important;
  font-size: 21px !important;
  font-weight: 700 !important;
}

.sg-product-card__price del {
  color: #94a1b1 !important;
  font-size: 13px !important;
}

/* 4. КРАСИВЫЕ КНОПКИ КАРТОЧЕК */

.sg-product-card__actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px 42px !important;
  gap: 8px !important;
  margin-top: 0 !important;
}

.sg-product-card__actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 8px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background .2s, color .2s, border-color .2s !important;
}

.sg-product-card__buy {
  width: 100% !important;
  min-width: 0 !important;
  background: #1766a6 !important;
  border: 1px solid #1766a6 !important;
  color: #fff !important;
}

.sg-product-card__buy:hover {
  background: #124f82 !important;
  border-color: #124f82 !important;
}

.sg-product-card__icon {
  width: 42px !important;
  background: #edf5fc !important;
  border: 1px solid #d9e7f4 !important;
  color: #1766a6 !important;
  font-size: 16px !important;
}

.sg-product-card__icon:hover {
  background: #1766a6 !important;
  border-color: #1766a6 !important;
  color: #fff !important;
}

/* 5. СТАНДАРТНЫЕ КАРТОЧКИ OPENCART:
   СЕРДЦЕ И СРАВНЕНИЕ */

#product-category .product-thumb .button-group,
#product-search .product-thumb .button-group,
#common-home .product-thumb .button-group {
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 7px !important;
  padding: 10px !important;
  margin-top: auto !important;
  background: #fff !important;
  border-top: 1px solid #edf1f6 !important;
}

#product-category .product-thumb .button-group button,
#product-search .product-thumb .button-group button,
#common-home .product-thumb .button-group button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  height: 42px !important;
  min-height: 42px !important;
  border-radius: 9px !important;
  font-size: 15px !important;
  text-shadow: none !important;
}

#product-category .product-thumb .button-group button:first-child,
#product-search .product-thumb .button-group button:first-child,
#common-home .product-thumb .button-group button:first-child {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  background: #1766a6 !important;
  border: 1px solid #1766a6 !important;
  color: #fff !important;
}

#product-category .product-thumb .button-group button:not(:first-child),
#product-search .product-thumb .button-group button:not(:first-child),
#common-home .product-thumb .button-group button:not(:first-child) {
  flex: 0 0 42px !important;
  width: 42px !important;
  padding: 0 !important;
  background: #edf5fc !important;
  border: 1px solid #d9e7f4 !important;
  color: #1766a6 !important;
}

#product-category .product-thumb .button-group button:not(:first-child):hover,
#product-search .product-thumb .button-group button:not(:first-child):hover,
#common-home .product-thumb .button-group button:not(:first-child):hover {
  background: #1766a6 !important;
  border-color: #1766a6 !important;
  color: #fff !important;
}

/* 6. АДАПТИВНОСТЬ */

@media (max-width: 991px) {
  .sg-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 540px) {
  .sg-product-grid {
    gap: 10px !important;
  }

  .sg-product-card__image {
    height: 150px !important;
    flex-basis: 150px !important;
    padding: 10px !important;
  }

  .sg-product-card__body {
    padding: 11px !important;
  }

  .sg-product-card__title {
    height: 55px !important;
    min-height: 55px !important;
    font-size: 12px !important;
  }

  .sg-product-card__description {
    min-height: 54px !important;
    max-height: 54px !important;
    font-size: 11px !important;
  }

  .sg-product-card__actions {
    grid-template-columns: minmax(0, 1fr) 32px 32px !important;
    gap: 4px !important;
  }

  .sg-product-card__actions button {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11px !important;
  }

  .sg-product-card__icon {
    width: 32px !important;
  }

  #product-category #content > .row:has(#input-sort),
  #product-search #content > .row:has(#input-sort),
  #product-category .sg-catalog-toolbar {
    padding: 12px !important;
    gap: 10px !important;
  }

  #product-category #input-sort,
  #product-search #input-sort {
    width: 155px !important;
  }
}

.sg-product-card__description {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;

  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;

  margin: 10px 0 12px !important;
  padding: 0 !important;

  color: #74869b !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
}

/* Описание в стандартных карточках OpenCart */
#product-category .product-thumb .caption > p:not(.price):not(.price-tax),
#common-home .product-thumb .caption > p:not(.price):not(.price-tax),
#product-search .product-thumb .caption > p:not(.price):not(.price-tax) {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;

  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;

  margin: 10px 0 12px !important;
  color: #74869b !important;
  font-size: 13px !important;
  line-height: 20px !important;
}

/* =====================================================
   САНГРУПМАРКЕТ — МОБИЛЬНАЯ ВЕРСИЯ
   Шапка, поиск, меню, рекомендуемые
   Футер и каталог не изменяем
   ===================================================== */

@media (max-width: 767px) {

  /* 1. ШАПКА */

  header {
    padding: 0 !important;
  }

  header > .container {
    padding: 12px 15px !important;
  }

  header .row,
  header .sg-header-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
  }

  /* Логотип слева */

  header .row > .col-sm-4,
  header .sg-logo-col {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    text-align: left !important;
  }

  header #logo {
    margin: 0 !important;
    text-align: left !important;
  }

  header #logo img,
  header .sg-logo-col img {
    display: block !important;
    max-width: 100% !important;
    max-height: 58px !important;
    width: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  /* Корзина справа от логотипа */

  header .row > .col-sm-3,
  header .sg-cart-col {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 46% !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 2 !important;
  }

  #cart {
    margin: 0 !important;
    width: auto !important;
  }

  #cart > .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    width: auto !important;
    min-height: 44px !important;
    height: auto !important;

    margin: 0 !important;
    padding: 10px 12px !important;

    border-radius: 9px !important;
    background: #173963 !important;
    color: #fff !important;

    font-size: 12px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }

  /* Поиск на отдельной строке */

  header .row > .col-sm-5,
  header .sg-search-col {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    padding: 0 !important;
    margin: 0 !important;
    order: 3 !important;
  }

  #search {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #search .input-lg {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 1% !important;
    height: 46px !important;

    padding: 10px 12px !important;
    border: 1px solid #dce6f0 !important;
    border-radius: 9px 0 0 9px !important;

    font-size: 14px !important;
    box-shadow: none !important;
  }

  #search .btn-lg {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 46px !important;

    border-radius: 0 9px 9px 0 !important;
    background: #1766a6 !important;
    border-color: #1766a6 !important;
    color: #fff !important;
  }

  /* 2. МОБИЛЬНОЕ МЕНЮ */

  #menu {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    border-radius: 9px !important;
    background: #173963 !important;
  }

  #menu .navbar-header {
    min-height: 46px !important;
  }

  #menu .navbar-toggle {
    margin: 7px 10px !important;
    border: 1px solid rgba(255,255,255,.3) !important;
    border-radius: 7px !important;
  }

  #menu .navbar-collapse {
    border: 0 !important;
    box-shadow: none !important;
  }

  /* 3. РЕКОМЕНДУЕМЫЕ:
        ОДНА КАРТОЧКА В СТРОКЕ */

  #common-home .sg-featured .sg-product-grid,
  #common-home #content .sg-featured .sg-product-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
  }

  #common-home .sg-featured .sg-product-grid__item {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  #common-home .sg-featured .sg-product-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Карточки рекомендуемых не сжимаем */

  #common-home .sg-featured .sg-product-card__image {
    height: 200px !important;
    flex-basis: 200px !important;
  }

  #common-home .sg-featured .sg-product-card__body {
    padding: 16px !important;
  }

  #common-home .sg-featured .sg-product-card__title {
    font-size: 15px !important;
    line-height: 1.45 !important;
    height: auto !important;
    min-height: 44px !important;
  }

  #common-home .sg-featured .sg-product-card__actions {
    grid-template-columns: minmax(0,1fr) 42px 42px !important;
    gap: 8px !important;
  }

  #common-home .sg-featured .sg-product-card__actions button {
    min-height: 44px !important;
    height: 44px !important;
    font-size: 13px !important;
  }

  #common-home .sg-featured .sg-product-card__icon {
    width: 42px !important;
  }
}

/* Совсем узкие телефоны */

@media (max-width: 380px) {

  header #logo img {
    max-height: 48px !important;
  }

  #cart > .btn {
    padding: 9px !important;
    font-size: 11px !important;
  }

  header .row,
  header .sg-header-row {
    gap: 10px !important;
  }
}

/* =====================================================
   САНГРУПМАРКЕТ — МОБИЛЬНАЯ ШАПКА
   Иконки справа + исправление ширины поиска
   ===================================================== */

@media (max-width: 767px) {

  /* 1. Иконки верхней панели справа */

  #top .sg-top-inner,
  #top > .container {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #top-links {
    float: none !important;
    margin-left: auto !important;
    margin-right: 0 !important;
  }

  #top-links .list-inline {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
  }

  /* 2. Шапка не должна быть шире экрана */

  header,
  header > .container,
  header .row,
  header .sg-header-row {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  header .row,
  header .sg-header-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 3. Поиск занимает отдельную строку */

  header .sg-search-col,
  header .row > .col-sm-5 {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* 4. Сам блок поиска */

  header #search {
    display: flex !important;
    align-items: stretch !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box !important;
  }

  /* В OpenCart поиск обычно внутри .input-group */

  header #search.input-group {
    display: flex !important;
  }

  header #search .form-control,
  header #search .input-lg {
    flex: 1 1 0% !important;

    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 46px !important;
    box-sizing: border-box !important;
  }

  /* Убираем лишнюю ширину стандартного input-group-btn */

  header #search .input-group-btn {
    display: flex !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  /* Синяя кнопка с лупой */

  header #search .btn,
  header #search .btn-lg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;

    height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;

    border-radius: 0 9px 9px 0 !important;
    box-sizing: border-box !important;
  }

  /* 5. Дополнительная защита от выхода за экран */

  #search,
  #search input,
  #search button {
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) {

  /* Выпадающее окно корзины */
  #cart > .sg-mini-cart-menu,
  #cart > .dropdown-menu {
    position: fixed !important;

    top: 115px !important;
    left: 50% !important;
    right: auto !important;

    transform: translateX(-50%) !important;

    width: calc(100vw - 24px) !important;
    max-width: 380px !important;
    min-width: 0 !important;

    margin: 0 !important;
    box-sizing: border-box !important;

    z-index: 9999 !important;
  }

  /* Содержимое не должно растягивать окно */
  #cart > .sg-mini-cart-menu *,
  #cart > .dropdown-menu * {
    box-sizing: border-box;
  }

  #cart > .sg-mini-cart-menu,
  #cart > .dropdown-menu {
    max-height: calc(100dvh - 130px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
}
