/* PC Configurator Adapted Styles vFinal */

:root {
  /* Theme-adapted variables (font overridden per page in pc_configurator.twig from theme_fonts) */
  --up-font-family: inherit;
  --up-bg-wd: #ffffff;
  --up-bg-main: #f7f8fb;
  --up-bg-gray: #f7f8fb;
  --up-border-color: #eaedf7;
  --up-text-wd-color: #000000;
  --up-text-color: #333333;
  --up-text-light-color: #999999;
  --up-text-link: #00a5d4;
  --up-text-link-hover: #222222;
  --up-color-success: #55b747;
  --up-color-danger: #ff5757;
  --up-color-warning: #f0ad4e;
  --up-border-radius-small: 8px;
  --up-border-radius-medium: 12px;
  --up-border-radius-large: 20px;
  --up-box-shadow-1px: 0px 4px 20px rgba(0, 0, 0, 0.1);
  --up-bg-menu-hover: rgb(255, 255, 255);

  /* Fluid Font Sizes using clamp() for responsiveness */
  /* Format: clamp(min-size, preferred-size, max-size) */
  --font-size-xs: clamp(1.08rem, 1.95vw, 1.16rem); /* ~17px - 18.5px */
  --font-size-sm: clamp(1.16rem, 2.32vw, 1.31rem); /* ~18.5px - 21px */
  --font-size-base: clamp(1.31rem, 2.68vw, 1.46rem); /* ~21px - 23px */
  --font-size-lg: clamp(1.46rem, 3.17vw, 1.62rem); /* ~23px - 26px */
  --font-size-xl: clamp(1.62rem, 3.9vw, 1.92rem); /* ~26px - 30.5px */
  --font-size-xxl: clamp(1.92rem, 4.76vw, 2.07rem); /* ~30.5px - 33px */
  --font-size-xxxl: clamp(2.07rem, 5.37vw, 2.38rem); /* ~33px - 38px */
}

#pc-configurator {
  font-family: var(--up-font-family);
}

/* Ready Build Toggle Button */
.ready-build-toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 20px;
  background-color: var(--up-bg-gray, #f7f8fb);
  border: 1px solid var(--up-border-color, #eaedf7);
  border-radius: var(--up-border-radius-medium, 12px);
}

.ready-build-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-right: 20px;
  min-width: 0;
}

.ready-build-description {
  font-size: var(--font-size-sm);
  color: var(--up-text-color, #333333);
  line-height: 1.5;
}

/* Индикатор сборки в баннере готовой сборки (конфигуратор скрыт) */
.ready-build-toggle-container .assembly-indicator {
  margin-left: 0;
  align-self: flex-start;
}

#change-configuration-btn {
  padding: 8px 20px;
  font-size: var(--font-size-base);
  font-weight: 500;
  border-radius: var(--up-border-radius-medium);
  transition: all 0.3s ease;
  box-shadow: var(--up-box-shadow-1px);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 0px;
}

#change-configuration-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.15);
}

#change-configuration-btn:active {
  transform: translateY(0);
}

/* Responsive: на мобильных устройствах текст и кнопка в колонку */
@media (max-width: 768px) {
  .ready-build-toggle-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ready-build-main {
    margin-right: 0;
    margin-bottom: 15px;
    width: 100%;
  }

  .ready-build-description {
    margin-right: 0;
  }
  
  #change-configuration-btn {
    width: 100%;
  }
}

/* Hidden configurator state */
#configurator-app.configurator-hidden {
  display: none !important;
}

/* === Fix: Prevent body scroll when modal is open === */
body.configurator-modal-open {
  overflow: hidden;
}

/* Blur effect for when a modal is open */
#configurator-app.blur-active > .row {
  filter: blur(4px);
  transition: filter 0.3s ease;
}

#product-modal .modal-content.blur-active {
  filter: blur(4px);
  transition: filter 0.3s ease;
}

/* Make modal backdrop slightly transparent to see the blur */
.modal-backdrop.in {
  background-color: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Main Layout & Panels */
#pc-configurator .panel {
  background-color: var(--up-bg-wd);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-large, 20px);
  margin-bottom: 20px;
}
#pc-configurator .panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: transparent;
  border-bottom: 1px solid var(--up-border-color);
}
#pc-configurator .panel-title {
  color: var(--up-text-wd-color);
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.product-page-configurator .panel-title {
  font-size: var(--font-size-lg) !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
}
.product-page-configurator .panel-heading {
  overflow: visible;
}

@media (max-width: 768px) {
  .product-page-configurator .panel-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .product-page-configurator .panel-title {
    width: 100%;
    margin: 0;
  }

  .product-page-configurator .panel-heading .pc-clear-config-btn,
  .product-page-configurator .panel-heading .pc-builds-btn {
    float: none !important;
    width: 100%;
    margin: 0 !important;
    text-align: center;
    white-space: normal;
  }
}

.price-action-group.has-server-rental-btn .pc-server-rental-btn {
  margin-right: 8px;
  margin-left: auto;
  white-space: nowrap;
}

.price-action-group.has-server-rental-btn .cart {
  margin-left: 0 !important;
  width: auto !important;
}

.price-action-group .pc-server-rental-btn {
  white-space: normal;
}

@media (max-width: 768px) {
  .price-action-group.has-server-rental-btn {
    row-gap: 8px;
    column-gap: 8px;
    align-items: center;
  }

  .price-action-group.has-server-rental-btn .quantity-adder {
    order: 1;
  }

  .price-action-group.has-server-rental-btn .price {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
  }

  .price-action-group.has-server-rental-btn .pc-server-rental-btn {
    order: 3;
    flex: 1 1 calc(50% - 4px);
    width: calc(50% - 4px) !important;
    max-width: none;
    margin: 0 !important;
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    font-size: 13px;
    text-align: center;
    white-space: normal;
  }

  .price-action-group.has-server-rental-btn .cart {
    order: 4;
    flex: 1 1 calc(50% - 4px);
    width: calc(50% - 4px) !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
  }

  .price-action-group.has-server-rental-btn .cart .btn-general {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 14px;
  }

  .price-action-group.has-server-rental-btn .btn-fastorder {
    order: 5;
    width: 100%;
    margin-top: 0;
    margin-left: 0;
  }

  .price-action-group.has-server-rental-btn .info-group,
  .price-action-group.has-server-rental-btn .points {
    order: 6;
    width: 100%;
  }
}

#server-rental-modal .server-rental-modal-content {
  border: 1px solid #e5ebf5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

#server-rental-modal .modal-dialog {
  width: auto;
  max-width: 760px;
  margin: 20px auto;
}

#server-rental-modal .modal-header {
  background: #fff;
  border-bottom: 1px solid #e5ebf5;
  padding: 12px 16px;
}

#server-rental-modal .modal-title {
  color: #111827;
  font-size: 18px;
  font-weight: 700;
}

#server-rental-modal .close {
  color: #64748b;
  opacity: 1;
  text-shadow: none;
}

#server-rental-modal .close:hover {
  color: #111827;
}

#server-rental-modal .modal-body {
  padding: 14px 16px 16px;
  background: #fff;
}

#server-rental-modal .server-rental-content {
  font-size: 13px;
  line-height: 1.4;
  color: #334155;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#server-rental-modal .server-rental-hero {
  background: #f7f9fc;
  border: 1px solid #e5ebf5;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 0;
  grid-column: 1 / -1;
}

#server-rental-modal .server-rental-hero-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6fb;
  color: #0b5cab;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#server-rental-modal .server-rental-intro {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
}

#server-rental-modal .server-rental-section {
  background: #f7f9fc;
  border: 1px solid #e5ebf5;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 0;
}

#server-rental-modal .server-rental-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

#server-rental-modal .server-rental-benefits-wrap ul,
#server-rental-modal .server-rental-terms-wrap ul,
#server-rental-modal .server-rental-benefits-list,
#server-rental-modal .server-rental-terms-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#server-rental-modal .server-rental-benefits-wrap li,
#server-rental-modal .server-rental-benefits-list li {
  position: relative;
  margin: 0 0 5px;
  padding-left: 22px;
  color: #334155;
  font-size: 13px;
}

#server-rental-modal .server-rental-benefits-wrap li:last-child,
#server-rental-modal .server-rental-benefits-list li:last-child {
  margin-bottom: 0;
}

#server-rental-modal .server-rental-benefits-wrap li::before,
#server-rental-modal .server-rental-benefits-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(85, 183, 71, 0.15);
  color: #3f9b35;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

#server-rental-modal .server-rental-terms-wrap ul,
#server-rental-modal .server-rental-terms-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 12px;
}

#server-rental-modal .server-rental-terms-wrap li,
#server-rental-modal .server-rental-terms-list li {
  position: relative;
  margin: 0;
  padding-left: 14px;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

#server-rental-modal .server-rental-terms-wrap li::before,
#server-rental-modal .server-rental-terms-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00a5d4;
}

#server-rental-modal .server-rental-terms-wrap li strong,
#server-rental-modal .server-rental-terms-list li strong {
  color: #111827;
  font-weight: 600;
}

#server-rental-modal .server-rental-contacts-wrap {
  grid-column: 1 / -1;
}

#server-rental-modal .server-rental-contacts-section {
  margin-bottom: 0;
  background: #f7f9fc;
}

#server-rental-modal .server-rental-contacts-cta {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

#server-rental-modal .server-rental-contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#server-rental-modal .server-rental-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

#server-rental-modal .server-rental-contact-item:hover,
#server-rental-modal .server-rental-contact-item:focus {
  color: inherit;
  text-decoration: none;
  border-color: #00a5d4;
}

#server-rental-modal .server-rental-contact-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0, 165, 212, 0.12) center / 16px 16px no-repeat;
}

#server-rental-modal .server-rental-contact-icon-phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a5d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

#server-rental-modal .server-rental-contact-icon-email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a5d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}

#server-rental-modal .server-rental-contact-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#server-rental-modal .server-rental-contact-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

#server-rental-modal .server-rental-contact-value {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

@media (min-width: 640px) {
  #server-rental-modal .server-rental-content {
    grid-template-columns: 0.72fr 1.28fr;
  }

  #server-rental-modal .server-rental-terms-section {
    grid-column: 2;
    grid-row: 2;
  }

  #server-rental-modal .server-rental-benefits-section {
    grid-column: 1;
    grid-row: 2;
  }

  #server-rental-modal .server-rental-terms-wrap ul,
  #server-rental-modal .server-rental-terms-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  #server-rental-modal .modal-dialog {
    margin: 8px auto;
    max-width: calc(100% - 16px);
  }

  #server-rental-modal .modal-body {
    padding: 12px 14px 14px;
  }

  #server-rental-modal .server-rental-content {
    grid-template-columns: 1fr;
  }

  #server-rental-modal .server-rental-terms-section,
  #server-rental-modal .server-rental-benefits-section {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  #server-rental-modal .server-rental-terms-wrap ul,
  #server-rental-modal .server-rental-terms-list {
    grid-template-columns: 1fr;
  }

  #server-rental-modal .server-rental-contacts-grid {
    grid-template-columns: 1fr;
  }
}

/* Сборка 3–24 ч: видимая подпись + CSS-tooltip (надёжнее нативного title) */
.product-page-configurator .assembly-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: -2px;
  margin-top: 2px;
  cursor: help;
  vertical-align: middle;
  color: var(--up-text-gray-color, #6c757d);
}
.product-page-configurator .assembly-indicator-label {
  font-size: var(--font-size-sm, 13px);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}
.product-page-configurator .assembly-indicator-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.product-page-configurator .assembly-indicator-icon i {
  font-size: 14px;
}
.product-page-configurator .assembly-indicator::after {
  content: attr(data-assembly-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 2000;
  width: min(230px, 88vw);
  min-width: min(180px, 88vw);
  max-width: min(230px, 88vw);
  padding: 8px 10px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  background: rgba(33, 37, 41, 0.95);
  border-radius: var(--up-border-radius-small, 6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.product-page-configurator .assembly-indicator:hover::after,
.product-page-configurator .assembly-indicator:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.product-page-configurator .assembly-indicator:hover,
.product-page-configurator .assembly-indicator:focus-visible {
  color: var(--up-text-link, #2196f3);
  outline: none;
}

/* Summary Block */
#summary-container .panel-body {
  padding: 20px;
}
#summary-list-components .summary-item-list {
  font-size: var(--font-size-base);
  color: var(--up-text-color);
  margin-bottom: 15px;
}
#summary-list-components .summary-item-list li {
  padding: 3px 0;
}
#summary-list-components .component-name {
  font-weight: 500;
  color: var(--up-text-wd-color);
}

/* === INTEGRATED STEPPER & LIST STYLES === */
.steps-container .panel-body {
  padding: 20px 0 0 0;
}
.steps-container .list-group {
  position: relative;
  margin-left: 30px;
}
.product-page-configurator .steps-container .list-group {
  position: relative;
  margin-left: 10px;
}

.steps-container .list-group::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 25px;
  bottom: 25px;
  width: 2px;
  background-color: var(--up-border-color, #e0e0e0);
  z-index: 1;
}

.product-page-configurator .steps-container .list-group::before {
  display: none;
}

.list-group-item-wrapper {
  padding-right: 10px;
  padding-left: 45px;
  position: relative;
  padding-bottom: 20px;
}

.product-page-configurator .list-group-item-wrapper {
  padding-left: 10px;
}

.list-group-item-wrapper:last-child {
  padding-bottom: 0;
}
.step-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: var(--up-bg-main);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium);
  transition: all 0.3s ease;
}
.step-visual {
  position: absolute;
  left: 0;
  top: 10px;
  z-index: 2;
}
.step-counter {
  height: 38px;
  width: 38px;
  background: var(--up-bg-wd, #fff);
  border: 2px solid var(--up-border-color, #e0e0e0);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: var(--up-text-light-color, #aaa);
  transition: all 0.3s ease;
  font-size: var(--font-size-lg);
}
.step-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.step-name {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--up-text-wd-color, #333);
  display: flex;
  align-items: center;
}

/* Ensure tab before RAM total is rendered as spacing */
.step-name .step-ram-total {
  white-space: pre;
  -moz-tab-size: 4;
  tab-size: 4;
}

.product-page-configurator .step-name {
  font-size: var(--font-size-base) !important;
}

/* === Стили для SVG иконок === */
.svg-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  width: 20px;
  height: 20px;
  color: var(--up-text-gray-color);
  flex-shrink: 0;
}
.svg-icon-wrapper svg {
  width: 100%;
  height: 100%;
}
.step-required-badge {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--up-text-gray-color);
  background-color: var(--up-bg-gray);
  padding: 2px 6px;
  border-radius: var(--up-border-radius-small);
  margin-top: 4px;
  display: inline-block;
}
.step-action {
  margin-left: 20px;
}

/* Step States */
.step-main-row.completed .step-counter {
  border-color: var(--up-color-success, #4caf50);
  background-color: var(--up-color-success, #4caf50);
  color: #fff;
}
.step-main-row.completed .step-name .svg-icon-wrapper {
  color: var(--up-color-success, #4caf50);
}
.step-main-row.active {
  border-color: var(--up-text-link, #2196f3);
  box-shadow: 0 0 8px rgba(33, 150, 243, 0.3);
}
.step-main-row.active .step-counter {
  border-color: var(--up-text-link, #2196f3);
  color: var(--up-text-link, #2196f3);
  transform: scale(1.1);
}
.step-main-row.active .step-name .svg-icon-wrapper {
  color: var(--up-text-link, #2196f3);
}
.step-main-row.missing .step-counter {
  border-color: var(--up-color-danger, #f44336);
  background-color: var(--up-bg-wd, #fff);
  color: var(--up-color-danger, #f44336);
}
.step-main-row.missing .step-name {
  color: var(--up-color-danger, #f44336);
}
.step-main-row.missing .step-name .svg-icon-wrapper {
  color: var(--up-color-danger, #f44336);
}
.step-counter .svg-icon-wrapper {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* --- Animation for newly updated step --- */
@keyframes step-visual-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
    border-color: var(--up-color-warning, #ffc107);
  }
  100% {
    transform: scale(1);
  }
}

/* Respect users that prefer reduced motion */
/* @media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
} */

.step-main-row.step-just-updated .step-counter {
  animation: step-visual-pop 0.4s ease-in-out;
}

/* --- HOVER HIGHLIGHT START (THEME ADAPTIVE) --- */
.step-main-row.highlight-step {
  background-color: var(
    --up-bg-gray,
    #f0f2f5
  ); /* Адаптивный фон для подсветки */
  border-left: 4px solid var(--up-text-link, #2196f3);
}
/* --- HOVER HIGHLIGHT END --- */

/* Compatibility issue highlights */
.step-main-row.step-has-error {
  border-color: var(--up-color-danger, #dc3545);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.25);
}
.step-main-row.step-related-error {
  border-color: rgba(220, 53, 69, 0.35);
}
.step-main-row.step-has-warning {
  border-color: var(--up-color-warning, #ffc107);
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.25);
}
.step-main-row.step-related-warning {
  border-color: rgba(255, 193, 7, 0.35);
}
.product-details-row.step-has-error {
  border-left: 3px solid var(--up-color-danger, #dc3545);
  background-color: rgba(220, 53, 69, 0.05);
}
.product-details-row.step-has-warning {
  border-left: 3px solid var(--up-color-warning, #ffc107);
  background-color: rgba(255, 193, 7, 0.05);
}

/* Buttons */
#pc-configurator .choose-product-btn {
  color: var(--up-text-link, #4a71b1);
  background-color: transparent;
  border: 1px solid var(--up-text-link, #4a71b1);
  border-radius: var(--up-border-radius-small, 8px);
  font-size: var(--font-size-base);
  font-weight: 500;
  padding: 0px 20px;
  line-height: 44px;
  min-height: 44px;
  box-shadow: none;
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
#pc-configurator .choose-product-btn .svg-icon-wrapper {
  margin-right: 8px;
  color: var(--up-text-link);
}
#pc-configurator .choose-product-btn:hover {
  background-color: var(--up-text-link-hover);
  border-color: var(--up-text-link-hover);
  color: #fff;
}
#pc-configurator .add-another-btn {
  line-height: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0 15px;
  font-size: var(--font-size-sm);
  background: none;
  border: none;
}
#pc-configurator #add-to-cart-btn {
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding: 12px 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#pc-configurator #add-to-cart-btn .svg-icon-wrapper {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

/* === MODIFICATION START: Updated disabled button styles === */
#pc-configurator #add-to-cart-btn:disabled {
  background-color: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.25);
  color: var(--up-color-danger, #f44336);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}
#pc-configurator #add-to-cart-btn.btn-danger:disabled {
  background-color: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.25);
  color: var(--up-color-danger, #f44336);
  text-shadow: none;
  background-image: none;
  background-repeat: no-repeat;
}
/* === MODIFICATION END === */

.product-details-row .remove-product-btn {
  color: var(--up-text-gray-color, #a94442);
  background: transparent;
  border: none;
  padding: 5px;
  line-height: 1;
}
.product-details-row .remove-product-btn .svg-icon-wrapper {
  width: 16px;
  height: 16px;
  margin: 0;
}
.product-details-row .remove-product-btn:hover {
  opacity: 0.7;
  color: var(--up-text-wd-color);
}

/* === Product Details Row Animation === */
@keyframes product-add-animation {
  from {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
  }
  50% {
    padding-top: 10px;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 1px;
    opacity: 0.8;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px; /* Adjust if content is taller */
  }
}

.product-details-row.newly-added {
  animation: product-add-animation 0.4s ease-in-out forwards;
}
/* === End Product Details Row Animation === */

/* Selected Product Details Row */
.product-details-row {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background-color: transparent;
  border: none !important;
  gap: 15px;
  overflow: hidden; /* Needed for height animation */
}
.product-details-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background-color: var(--color-white, #fff);
  border: 1px solid var(--up-border-color, #eee);
  border-radius: var(--up-border-radius-small, 12px);
  flex-shrink: 0;
}
.product-details-name {
  flex-grow: 1;
  font-size: var(--font-size-base);
  color: var(--up-text-color, #555);
}

.product-page-configurator .product-details-name {
  font-size: var(--font-size-sm);
}

.product-details-price {
  font-weight: 600;
  font-size: var(--font-size-base);
  min-width: 120px;
  text-align: right;
  color: var(--up-text-wd-color, #333);
  flex-shrink: 0;
}
.add-another-wrapper {
  padding: 10px 20px 5px 20px;
  border-top: 1px dashed var(--up-border-color, #f0f0f0) !important;
}

/* Quantity Controls */
.quantity-control {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.quantity-control .quantity-input {
  width: 50px;
  text-align: center;
  height: 28px;
  font-size: var(--font-size-sm);
  padding: 2px 4px;
  margin: 0 5px;
  border-radius: var(--up-border-radius-small, 8px);
  border: 1px solid var(--up-border-color);
}
.quantity-control .quantity-input::-webkit-outer-spin-button,
.quantity-control .quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-control .quantity-input[type="number"] {
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: textfield;
}
.quantity-control .quantity-btn {
  width: 28px;
  height: 28px;
  line-height: 26px;
  padding: 0;
  font-size: var(--font-size-base);
  border-radius: 50%;
  border: 1px solid var(--up-border-color);
  background-color: var(--up-bg-main);
  color: var(--up-text-color);
}
.quantity-control .quantity-btn:hover {
  background-color: var(--up-border-color);
}

.quantity-display {
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--up-text-light-color);
  display: flex;
  align-items: center;
  padding: 0 15px;
}

/* Product page configurator quantity controls */
.component-quantity-btn {
  width: 28px;
  height: 28px;
  line-height: 26px;
  padding: 0;
  font-size: var(--font-size-base);
  border-radius: 50%;
  border: 1px solid var(--up-border-color);
  background-color: var(--up-bg-main);
  color: var(--up-text-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
  min-height: 0;
}

.component-quantity-input[type="number"] {
  height: 0;
}

.component-quantity-btn:hover {
  background-color: var(--up-border-color);
}

.component-quantity-btn:active {
  background-color: var(--up-text-light-color);
}

.component-quantity-input {
  width: 50px;
  text-align: center;
  height: 28px;
  font-size: var(--font-size-sm);
  padding: 2px 4px;
  margin: 0 5px;
  border-radius: var(--up-border-radius-small, 8px);
  border: 1px solid var(--up-border-color);
}

.component-quantity-input::-webkit-outer-spin-button,
.component-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.component-quantity-input[type="number"] {
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: textfield;
}

/* === MODIFICATION START: Adaptive Compatibility Notes Styles === */
#compatibility-notes .alert {
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: var(--up-border-radius-medium);
  padding: 15px;
  border-width: 1px;
  border-style: solid;
  text-shadow: none;
  color: var(--up-text-color); /* Default text color for the alert content */
}

#compatibility-notes .alert h5 {
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--up-text-wd-color); /* Main heading color */
}

#compatibility-notes .alert ul {
  padding-left: 20px;
  margin-bottom: 0;
}

/* Success State */
#compatibility-notes .alert-success {
  background-color: rgba(76, 175, 80, 0.1); /* transparent green from #4CAF50 */
  border-color: rgba(76, 175, 80, 0.2);
  color: var(--up-color-success, #4caf50); /* Make the text green */
}
#compatibility-notes .alert-success h5 {
  color: var(--up-color-success, #4caf50); /* Also make the heading green */
}

/* Warning State */
#compatibility-notes .alert-warning {
  background-color: rgba(
    255,
    152,
    0,
    0.1
  ); /* transparent orange from #ff9800 */
  border-color: rgba(255, 152, 0, 0.2);
}
#compatibility-notes .alert-warning h5 {
  color: #ff9800; /* Orange color for heading */
}
#compatibility-notes .alert-warning ul {
  color: var(--up-text-color); /* Standard text color for details */
}

/* Danger State */
#compatibility-notes .alert-danger {
  background-color: rgba(244, 67, 54, 0.1); /* transparent red from #f44336 */
  border-color: rgba(244, 67, 54, 0.2);
}
#compatibility-notes .alert-danger h5 {
  color: var(--up-color-danger, #f44336); /* Red color for heading */
}
#compatibility-notes .alert-danger ul {
  color: var(--up-text-color); /* Standard text color for details */
}
/* === MODIFICATION END === */

.summary-actions {
  margin-top: 20px;
}
.configurator-cart-error {
  margin-top: 15px;
}

/* === MODAL WINDOW STYLES (UPDATED) === */
/* Scoped to PC Configurator modals only — avoids affecting theme modals (e.g. #login-form-popup). */
#product-modal .modal-content,
#product-details-modal .modal-content,
#component-selection-modal .modal-content,
#component-product-details-modal .modal-content {
  background-color: var(--up-modal-bg, #fff);
  border-radius: var(--up-border-radius-large, 20px);
  overflow: hidden;
  border: none;
  box-shadow: var(--up-box-shadow-large);
  height: 90vh;
  display: flex;
  flex-direction: column;
}
#product-modal .modal-header,
#product-details-modal .modal-header,
#component-selection-modal .modal-header,
#component-product-details-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  border-bottom: 1px solid var(--up-border-color);
}
#product-modal .modal-title,
#product-details-modal .modal-title,
#component-selection-modal .modal-title,
#component-product-details-modal .modal-title {
  color: var(--up-text-wd-color);
  font-weight: 600;
}
#product-modal .close,
#product-details-modal .close,
#component-selection-modal .close,
#component-product-details-modal .close {
  color: var(--up-text-wd-color);
  opacity: 0.7;
  text-shadow: none;
}
#product-modal .close:hover,
#product-details-modal .close:hover,
#component-selection-modal .close:hover,
#component-product-details-modal .close:hover {
  opacity: 1;
}
#product-modal .modal-dialog {
  width: 90%;
  max-width: 1600px;
  margin: 30px auto;
}
#product-modal .modal-body {
  position: relative;
  padding: 15px;
  flex-grow: 1;
  overflow-y: hidden;
}
#product-modal .modal-body > .row,
#product-modal .modal-body > .row > [class*="col-"] {
  height: 100%;
}
#modal-filters-container,
#modal-product-list-container {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 50px;
  scrollbar-width: thin;
  scrollbar-color: var(--up-border-color) var(--up-bg-main);
}
#modal-filters-container {
  border-right: 1px solid var(--up-border-color);
}
#modal-filters-container::-webkit-scrollbar,
#modal-product-list-container::-webkit-scrollbar {
  width: 5px;
}
#modal-filters-container::-webkit-scrollbar-track,
#modal-product-list-container::-webkit-scrollbar-track {
  background: var(--up-bg-main);
}
#modal-filters-container::-webkit-scrollbar-thumb,
#modal-product-list-container::-webkit-scrollbar-thumb {
  background-color: var(--up-border-color);
  border-radius: 6px;
  border: 1px solid var(--up-bg-main);
}
#modal-filters-container::-webkit-scrollbar-thumb:hover,
#modal-product-list-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--up-text-gray-color);
}

/* === COMPONENT MODAL STYLES (Enhanced Component List) === */
#component-selection-modal .modal-dialog {
  width: 90%;
  max-width: 1600px;
  margin: 30px auto;
}
#component-selection-modal .modal-content {
  height: 90vh;
  display: flex;
  flex-direction: column;
}
#component-selection-modal .modal-body {
  position: relative;
  padding: 15px;
  padding-right: 5px;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#component-selection-modal .modal-body > .row {
  flex-grow: 1;
  display: flex;
  margin: 0;
}
#component-selection-modal .modal-body > .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}
#component-modal-filters-container {
  flex-grow: 1;
  overflow-y: auto;
  border-right: 1px solid var(--up-border-color);
  max-height: calc(90vh - 40px);
  scrollbar-width: thin;
  scrollbar-color: var(--up-border-color) var(--up-bg-main);
}
#component-modal-product-list-container {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--up-border-color) var(--up-bg-main);
  padding: 0;
  max-height: calc(90vh - 40px);
}
#component-modal-product-list-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#component-modal-filters-container::-webkit-scrollbar,
#component-modal-product-list-container::-webkit-scrollbar {
  width: 5px;
}
#component-modal-filters-container::-webkit-scrollbar-track,
#component-modal-product-list-container::-webkit-scrollbar-track {
  background: var(--up-bg-main);
}
#component-modal-filters-container::-webkit-scrollbar-thumb,
#component-modal-product-list-container::-webkit-scrollbar-thumb {
  background-color: var(--up-border-color);
  border-radius: 6px;
  border: 1px solid var(--up-bg-main);
}
#component-modal-filters-container::-webkit-scrollbar-thumb:hover,
#component-modal-product-list-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--up-text-gray-color);
}

/* --- Component Modal Responsive (match main configurator) --- */
@media (max-width: 991px) {
  #component-selection-modal .modal-dialog {
    width: 95%;
    max-width: 900px;
    margin: 15px auto;
  }
  #component-modal-filters-container {
    height: calc(100vh - 150px);
  }
}

@media (max-width: 768px) {
  #component-selection-modal .modal-dialog {
    margin: 0;
    width: 100%;
  }
  #component-selection-modal .modal-content {
    border-radius: 0;
    min-height: 100vh;
    border: none;
    overflow: hidden;
  }
  #component-selection-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
  }
  #component-modal-filters-container {
    padding-top: 20px;
    width: 100%;
    max-width: 100%;
    border-right: none;
  }
  #component-modal-product-list-container {
    width: 100%;
    height: auto;
  }
  .modal-controls-header {
    flex-direction: column;
    gap: 10px;
  }
  .modal-search-bar,
  .modal-view-options,
  .modal-sort-options {
    width: 100%;
  }
}

/* Component Product Details Modal Styles - base moved to aligned block below */

/* Component Modal Controls */
/* Removed global .modal-controls-header base in favor of scoped versions */

/* Removed global .modal-search-bar base in favor of scoped versions */

/* Removed global .modal-view-options base in favor of scoped versions */

.component-view-switcher-btn {
  background: var(--up-bg-light, #f8f9fa);
  border: 1px solid var(--up-border-color);
  padding: 8px 12px;
  border-radius: var(--up-border-radius, 4px);
  cursor: pointer;
  transition: all 0.2s;
}

.component-view-switcher-btn:hover {
  background: var(--up-bg-hover, #e9ecef);
}

.component-view-switcher-btn.active {
  background: var(--up-primary-color, #007bff);
  color: white;
  border-color: var(--up-primary-color, #007bff);
}

/* Removed global .modal-sort-options base in favor of scoped versions */

/* Component Modal Skeleton */
.modal-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  padding: 15px 0;
}

.skeleton-item {
  background: var(--up-bg-light, #f8f9fa);
  border-radius: var(--up-border-radius, 4px);
  overflow: hidden;
  animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  background: var(--up-bg-main, #e9ecef);
}

.skeleton-content {
  padding: 15px;
}

.skeleton-line {
  height: 16px;
  background: var(--up-bg-main, #e9ecef);
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-title {
  width: 70%;
}

.skeleton-price {
  width: 40%;
}

.skeleton-attr {
  width: 60%;
}

@keyframes skeleton-pulse {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 75%
  );
  background-color: var(--up-bg-light, #f4f5f7);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.main-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main-skeleton-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--up-border-color, #e0e0e0);
  border-radius: var(--up-border-radius-medium, 12px);
  background: var(--up-bg-main, #fff);
}

.main-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--up-bg-gray, #e6e9ef);
}

.main-skeleton-body {
  flex: 1;
}

.main-skeleton-line {
  height: 12px;
  background: var(--up-bg-gray, #e6e9ef);
  border-radius: 6px;
  margin-bottom: 8px;
}

.main-skeleton-line.short {
  width: 60%;
  margin-bottom: 0;
}

.main-skeleton-button {
  width: 120px;
  height: 32px;
  border-radius: 16px;
  background: var(--up-bg-gray, #e6e9ef);
}

.main-skeleton-summary-card {
  height: 50px;
  border-radius: var(--up-border-radius, 8px);
  margin-bottom: 8px;
  background: var(--up-bg-gray, #e6e9ef);
}

.main-skeleton-alert {
  height: 60px;
  border-radius: var(--up-border-radius, 8px);
  margin-top: 16px;
  background: var(--up-bg-gray, #e6e9ef);
}

/* Component Modal Filter Styles */
#component-modal-filters-content {
  padding: 10px;
  padding-left: 0;
}

#component-modal-filters-content h5 {
  color: var(--up-text-wd-color);
  font-weight: 600;
  margin-bottom: 0;
  font-size: var(--font-size-xl);
  border-bottom: none;
  padding-bottom: 0;
}

#component-modal-filters-content .filter-group {
  margin-bottom: 20px;
}

#component-modal-filters-content .filter-title {
  color: var(--up-text-wd-color);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: var(--font-size-base);
}

#component-modal-filters-content .filter-options {
  overflow-y: auto;
}

#component-modal-filters-content .checkbox {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

#component-modal-filters-content .checkbox input[type="checkbox"] {
  margin-right: 8px;
  margin-top: 0;
}

#component-modal-filters-content .checkbox label {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  color: var(--up-text-color);
  cursor: pointer;
  font-weight: 500;
}

#component-modal-filters-content .checkbox label:hover {
  color: var(--up-primary-color, #007bff);
}

/* Compatibility filter styles */
#component-modal-filters-content .compatibility-filter-group {
  background: var(--up-bg-light, #f8f9fa);
  padding: 15px;
  border-radius: var(--up-border-radius-medium, 12px);
  margin-bottom: 20px;
}

#component-modal-filters-content .compatibility-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#component-modal-filters-content .compatibility-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

#component-modal-filters-content .compatibility-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#component-modal-filters-content .compatibility-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

#component-modal-filters-content .compatibility-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

#component-modal-filters-content .compatibility-switch input:checked + .slider {
  background-color: var(--up-primary-color, #007bff);
}

#component-modal-filters-content
  .compatibility-switch
  input:checked
  + .slider:before {
  transform: translateX(26px);
}

/* Price filter styles */
#component-modal-filters-content .price-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

#component-modal-filters-content .price-filter input {
  flex: 1;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  padding: 6px 10px;
  font-size: var(--font-size-sm);
}

#component-modal-filters-content .price-filter span {
  color: var(--up-text-gray-color);
}

/* Filter sub-groups */
#component-modal-filters-content .filter-sub-group {
  margin-bottom: 15px;
  padding: 12px 5px;
  background-color: rgba(0, 165, 212, 0.03);
  border-left: 3px solid rgba(0, 165, 212, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
}

#component-modal-filters-content .filter-sub-group:hover {
  background-color: rgba(0, 165, 212, 0.05);
  border-left-color: rgba(0, 165, 212, 0.5);
}

#component-modal-filters-content .filter-sub-title {
  font-weight: 600;
  color: var(--up-text-wd-color);
  font-size: var(--font-size-sm);
  margin-bottom: 8px;
  padding-left: 0;
  display: flex;
  align-items: center;
}

#component-modal-filters-content .filter-sub-title::before {
  content: "▸";
  margin-right: 6px;
  color: rgba(0, 165, 212, 0.6);
  font-size: 0.8em;
}

/* Filter toggle button */
#component-modal-filters-content .filter-toggle-btn {
  background: none !important;
  border: none !important;
  color: var(--up-primary-color, #007bff) !important;
  cursor: pointer !important;
  padding: 5px 0 !important;
  font-size: var(--font-size-sm) !important;
  text-decoration: underline;
}

#component-modal-filters-content .filter-toggle-btn:hover {
  color: var(--up-primary-dark, #0056b3) !important;
}

/* Modal Controls Header */
#component-selection-modal .modal-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  padding-top: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--up-border-color);
  flex-wrap: wrap;
}

#component-selection-modal .filter-toggle-btn {
  border-radius: var(--up-border-radius, 4px);
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

#component-selection-modal .filter-toggle-btn:hover {
  text-decoration: underline;
}

/* Search Bar */
#component-selection-modal .modal-search-bar {
  flex-grow: 1;
  max-width: 300px;
  position: relative;
}

#component-selection-modal .modal-search-bar input {
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  padding: 8px 12px;
  padding-right: 40px;
  font-size: var(--font-size-base);
}

#component-selection-modal .modal-search-bar .modal-search-button {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  line-height: 1;
  border-radius: 0px 8px 8px 0px;
}

/* View Options */
#component-selection-modal .modal-view-options {
  display: flex;
  align-items: center;
  gap: 15px;
}

#component-selection-modal .view-switcher-group {
  display: flex;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
}

#component-selection-modal .view-switcher-btn {
  background: var(--up-bg-light, #f8f9fa) !important;
  border: none !important;
  padding: 8px 12px !important;
  color: var(--up-text-color) !important;
  border-radius: var(--up-border-radius-small);
  border-right: 1px solid var(--up-border-color) !important;
  line-height: 0px;
}

#component-selection-modal .view-switcher-btn:last-child {
  border-right: none !important;
  border-radius: 0px 4px 4px 0 !important;
}

#component-selection-modal .view-switcher-btn:first-child {
  border-right: none !important;
  border-radius: 4px 0px 0px 4px !important;
}

#component-selection-modal .view-switcher-btn.active {
  background: #1060c1 !important;
  color: white !important;
  border-radius: 4px 0px 0px 4px;
}

#component-selection-modal .view-switcher-btn:hover:not(.active) {
  background: var(--up-bg-hover, #e9ecef) !important;
}

/* Sort Options */
#component-selection-modal .modal-sort-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

#component-selection-modal .modal-sort-options label {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--up-text-gray-color);
}

#component-selection-modal .modal-sort-options select {
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  padding: 6px 10px;
  font-size: var(--font-size-base);
  min-width: 150px;
}

/* SVG Icons */
#component-selection-modal .svg-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
}

#component-selection-modal .svg-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

/* Skeleton Styles */
#component-selection-modal .skeleton-item {
  padding: 15px;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
}

#component-selection-modal .product-grid-view .skeleton-item {
  flex-direction: column;
  text-align: center;
}

#component-selection-modal .skeleton-image,
#component-selection-modal .skeleton-name,
#component-selection-modal .skeleton-price,
#component-selection-modal .skeleton-attributes {
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--up-border-radius, 4px);
}

#component-selection-modal .skeleton-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

#component-selection-modal .product-grid-view .skeleton-image {
  width: 100%;
  height: 120px;
  margin-bottom: 10px;
}

#component-selection-modal .skeleton-name {
  height: 20px;
  flex-grow: 1;
  margin-bottom: 8px;
}

#component-selection-modal .skeleton-price {
  height: 18px;
  width: 80px;
  margin-bottom: 8px;
}

#component-selection-modal .skeleton-attributes {
  height: 14px;
  width: 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Pagination Styles */
#component-selection-modal .modal-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--up-border-color);
  margin-top: 20px;
}

#component-selection-modal .pagination-info {
  font-size: var(--font-size-base);
  color: var(--up-text-gray-color);
}

#component-selection-modal .pagination-nav .pagination {
  margin: 0;
}

#component-selection-modal .pagination-nav .pagination > li > a,
#component-selection-modal .pagination-nav .pagination > li > span {
  color: var(--up-text-color);
  background-color: var(--up-bg-light, #f8f9fa);
  border: 1px solid var(--up-border-color);
}

#component-selection-modal .pagination-nav .pagination > li.active > a,
#component-selection-modal .pagination-nav .pagination > li.active > span {
  background-color: var(--up-primary-color, #007bff);
  border-color: var(--up-primary-color, #007bff);
  color: white;
}

#component-selection-modal .pagination-nav .pagination > li > a:hover,
#component-selection-modal .pagination-nav .pagination > li > span:hover {
  background-color: var(--up-bg-hover, #e9ecef);
  border-color: var(--up-border-color);
  color: var(--up-text-color);
}

/* Paginated Loader */
#component-modal-product-list-paginated-loader {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

#component-modal-product-list-paginated-loader .config-loader {
  display: flex;
  gap: 8px;
}

#component-modal-product-list-paginated-loader .config-loader .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--up-primary-color, #007bff);
  animation: loader-dots 1.4s infinite ease-in-out both;
}

#component-modal-product-list-paginated-loader
  .config-loader
  .dot:nth-child(1) {
  animation-delay: -0.32s;
}
#component-modal-product-list-paginated-loader
  .config-loader
  .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loader-dots {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Blur Effects */
.configurator-modal-open {
  overflow: hidden;
}

.blur-active {
  filter: blur(3px);
  transition: filter 0.3s ease;
}

/* Filter hidden state */
#component-selection-modal.filters-hidden #component-modal-filters-column {
  display: none !important;
}

#component-selection-modal.filters-hidden #component-modal-products-column {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Component Modal Product Attributes Styling (like main configurator) */
#component-selection-modal .attributes-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  font-size: var(--font-size-sm);
  text-align: left;
}

#component-selection-modal .attributes-list li {
  margin-bottom: 5px;
  display: flex;
  align-items: flex-start;
  line-height: 1.3;
}

#component-selection-modal .attributes-list li span {
  color: var(--up-text-gray-color);
  margin-right: 5px;
  flex-shrink: 0;
}

#component-selection-modal .attributes-list li strong {
  color: var(--up-text-color);
  font-weight: 500;
  flex-grow: 1;
}

/* Stock status badges */
#component-selection-modal .stock-status-badge {
  padding: 4px 6px;
  border-radius: var(--up-border-radius-small);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

#component-selection-modal .stock-status-badge.in-stock {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--up-color-success);
}

#component-selection-modal .stock-status-badge.out-of-stock {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--up-color-danger);
}

#component-selection-modal .stock-status-badge.delayed {
  background-color: rgba(240, 173, 78, 0.1);
  color: var(--up-color-warning);
}

#component-selection-modal .stock-status-badge.pre-order {
  background-color: rgba(0, 165, 212, 0.1);
  color: var(--up-text-link);
  border: none;
}

/* Base attributes styling for component modal (matching main configurator) */
#component-modal-product-list .attributes-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  font-size: var(--font-size-sm);
  text-align: left;
}

#component-modal-product-list .attributes-list li {
  margin-bottom: 5px;
  display: flex;
  align-items: flex-start;
  line-height: 1.3;
}

#component-modal-product-list .attributes-list li span {
  color: var(--up-text-gray-color);
  margin-right: 5px;
  flex-shrink: 0;
}

#component-modal-product-list .attributes-list li strong {
  color: var(--up-text-color);
  font-weight: 500;
  flex-grow: 0;
}

/* Grid view specific adjustments */
#component-modal-product-list.product-grid-view .attributes-list {
  margin: 0 0 15px 0;
  color: var(--up-text-color);
  border-top: 1px solid var(--up-border-color);
  padding-top: 10px;
  max-height: none;
  overflow: visible;
}

#component-modal-product-list.product-grid-view .attributes-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: var(--font-size-xs);
  margin-bottom: 3px;
}

#component-modal-product-list.product-grid-view .attributes-list li span {
  color: var(--up-text-gray-color);
  padding-right: 5px;
}

#component-modal-product-list.product-grid-view .attributes-list li strong {
  font-weight: 600;
  color: var(--up-text-wd-color);
}

/* List view attributes styling (matching main configurator) */
#component-modal-product-list.product-list-view .list-attributes {
  margin-top: 8px;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list
  li {
  display: inline-flex;
  align-items: center;
  background-color: var(--up-primary-color, #007bff14);
  border-radius: var(--up-border-radius-medium);
  padding: 4px 10px;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  white-space: break-spaces;
  border: 1px solid rgba(0, 0, 0, 0.2);
  margin-bottom: 0px;
  flex-wrap: wrap;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list
  li
  span {
  color: var(--up-text-gray-color);
  padding-right: 5px;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list
  li
  strong {
  color: var(--up-text-wd-color);
  font-weight: 500;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list
  li
  .stock-status-badge {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: var(--up-color-success);
  font-weight: 600;
}

#component-modal-product-list.product-list-view
  .list-attributes
  .attributes-list
  li:has(.stock-status-badge) {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.2);
}

/* Component Product Details Modal Styling - aligned with main configurator */
#component-product-details-modal .modal-content {
  background-color: var(--up-bg-wd, #fff);
  border: 1px solid var(--up-border-color, #e0e0e0);
  box-shadow: var(--up-box-shadow-1px, 0 2px 8px rgba(0, 0, 0, 0.1));
}

#component-product-details-modal .modal-header {
  background-color: transparent;
  border-bottom: 1px solid var(--up-border-color, #e0e0e0);
  padding: 15px 25px;
}

#component-product-details-modal .modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-text-wd-color, #333);
  display: none;
}

#component-product-details-modal .modal-lg {
  width: 90%;
  max-width: 1100px;
}

#component-product-details-modal .modal-body {
  padding: 25px 30px;
}

/* Name (right column) */
#component-details-modal-name {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--up-text-wd-color);
}

/* Meta (manufacturer, stock) */
#component-product-details-modal .details-meta {
  display: flex;
  gap: 20px;
  font-size: var(--font-size-sm);
  color: var(--up-text-color);
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--up-border-color);
}
#component-product-details-modal .details-meta strong {
  color: var(--up-text-wd-color);
  font-weight: 500;
}

/* Actions block */
#component-product-details-modal .details-actions {
  background-color: var(--up-bg-main);
  padding: 20px;
  border-radius: var(--up-border-radius-medium);
  margin-bottom: 20px;
}

/* Add button (same sizing as main) */
#component-details-modal-add-btn {
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding: 12px 25px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#component-details-modal-add-btn .svg-icon-wrapper {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

/* Responsive adjustments for component modal */
@media (max-width: 768px) {
  #component-selection-modal .modal-content {
    height: 95vh;
  }

  #component-selection-modal .modal-body > .row {
    flex-direction: column;
  }

  #component-modal-filters-column {
    max-height: 200px;
    margin-bottom: 0px;
  }

  #component-modal-filters-container {
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--up-border-color);
  }

  #component-modal-product-list-container {
    max-height: calc(95vh - 10px);
  }

  .modal-controls-header {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-view-options {
    justify-content: center;
  }

  .modal-skeleton {
    grid-template-columns: 1fr;
  }
}

/* Component Modal Product Styles */
#component-modal-product-list.product-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  padding: 15px;
}

@media (max-width: 768px) {
  #component-modal-product-list.product-grid-view {
    grid-template-columns: 1fr;
    padding: 0px;
  }
}

#component-modal-product-list.product-list-view .list-group {
  margin: 0;
}

#component-modal-product-list.product-list-view .list-group-item {
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium);
  margin-bottom: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.2s;
  background-color: var(--up-bg-main);
}

#component-modal-product-list.product-list-view .list-group-item:hover {
  background-color: var(--up-bg-light, #f8f9fa);
  border-color: var(--up-primary-color, #007bff);
}

#component-selection-modal .modal-product-card {
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  overflow: hidden;
  background: var(--up-bg-white, #fff);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#component-selection-modal .modal-product-card:hover {
  border-color: var(--up-primary-color, #007bff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#component-selection-modal .modal-product-card .card-clickable-area {
  cursor: pointer;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#component-selection-modal .modal-product-card .card-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white, #fff);
  border-bottom: 1px solid var(--up-border-color);
}

#component-selection-modal .modal-product-card .card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#component-selection-modal .modal-product-card .card-body-main {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: var(--up-bg-light, #f8f9fa);
}

#component-selection-modal .modal-product-card .card-name {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--up-text-wd-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  box-orient: vertical;
  overflow: hidden;
}

#component-selection-modal .modal-product-card .card-price {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-primary-color, #007bff);
  margin-bottom: 10px;
}

#component-selection-modal .modal-product-card .attribute-item {
  font-size: var(--font-size-sm);
  color: var(--up-text-gray-color);
  margin-bottom: 2px;
}

#component-selection-modal .modal-product-card .card-footer {
  padding: 15px;
  border-top: none;
  background: var(--up-bg-light, #f8f9fa);
}

/* List view specific styles */
.modal-product-list-row .list-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.modal-product-list-row .list-image {
  width: 80px;
  height: 80px;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--up-bg-white, #fff);
}

.modal-product-list-row .list-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-product-list-row .list-details {
  flex-grow: 1;
}

.modal-product-list-row .list-name {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--up-text-wd-color);
}

.modal-product-list-row .list-attributes {
  flex-grow: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  color: var(--up-text-gray-color);
}

.modal-product-list-row .list-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.modal-product-list-row .list-price {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-primary-color, #007bff);
}

.modal-product-list-row .mobile-price {
  display: none;
}

@media (max-width: 768px) {
  .modal-product-list-row .desktop-price {
    display: none;
  }

  .modal-product-list-row .list-clickable-area {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  /* Mobile grouped block: image, name, and price together */
  .modal-product-list-row .mobile-grouped-block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0px;
  }

  .modal-product-list-row .mobile-grouped-block .list-image-container {
    width: auto;
    margin-right: 15px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .modal-product-list-row .mobile-grouped-block .list-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-product-list-row .mobile-grouped-block .list-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--up-text-wd-color);
  }

  .modal-product-list-row .mobile-grouped-block .list-price.mobile-price {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 600;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
    color: var(--up-primary-color, #007bff);
  }

  /* Attributes block below grouped block */
  .modal-product-list-row .list-clickable-area > .list-attributes {
    width: 100%;
    margin-top: 0;
  }

  .modal-product-list-row .list-action {
    align-items: center;
    width: 100%;
    margin-top: 10px;
    padding-left: 0;
  }
}

/* Details modal improvements */
#component-product-details-modal .details-image-main {
  text-align: center;
  margin-bottom: 15px;
}

#component-product-details-modal .details-image-main img {
  max-width: 100%;
  height: auto;
  border-radius: var(--up-border-radius, 4px);
}

#component-product-details-modal .attribute-row {
  padding: 5px 0;
  border-bottom: 1px solid var(--up-border-color);
  font-size: var(--font-size-base);
}

#component-product-details-modal .attribute-row:last-child {
  border-bottom: none;
}

/* === New Loader Styles === */
.config-loader {
  background: var(--loader-overlay-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  width: 100%;
}
.config-loader .dot {
  width: 15px;
  height: 15px;
  margin: 0 5px;
  background-color: var(--up-text-link); /* Adaptive color */
  border-radius: 50%;
  display: inline-block;
  animation: dot-pulse 1.4s infinite ease-in-out both;
}
.config-loader .dot:nth-child(1) {
  animation-delay: -0.32s;
}
.config-loader .dot:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes dot-pulse {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
#modal-loader {
  padding-top: 40px;
}

/* === NEW: MODAL CONTROLS (SEARCH, SORT) === */
#product-modal .modal-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 15px 0;
  border-bottom: 1px solid var(--up-border-color);
  margin-bottom: 15px;
}
#product-modal .modal-search-bar {
  flex-grow: 1;
  max-width: 40%;
  position: relative;
}
#product-modal .modal-search-bar .modal-search-button {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  line-height: 1;
  border-radius: 0px 8px 8px 0px;
}

@media (max-width: 768px) {
  #product-modal .modal-search-bar .modal-search-button,
  #component-selection-modal .modal-search-bar .modal-search-button {
    display: none;
  }
}
#product-modal .modal-search-bar .form-control {
  background-color: var(--up-bg-main);
  border-color: var(--up-border-color);
  box-shadow: none;
  padding-left: 15px;
  padding-right: 40px;
}
#product-modal .modal-search-bar .form-control:focus {
  border-color: var(--up-text-link);
  box-shadow: 0 0 0 1px var(--up-text-link);
}

#product-modal .modal-view-options {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* === NEW: View Switcher Styles === */
#product-modal .view-switcher-group {
  display: flex;
  background-color: var(--up-bg-main);
  border-radius: var(--up-border-radius-small);
  border: 1px solid var(--up-border-color);
  padding: 0px;
}
#product-modal .view-switcher-btn {
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 5px 10px !important;
  color: var(--up-text-gray-color) !important;
  transition: all 0.2s;
  border-radius: var(--up-border-radius-small);
  line-height: 0px;
}
#product-modal .view-switcher-btn .svg-icon-wrapper {
  margin: 0;
  width: 20px;
  height: 20px;
}
#product-modal .view-switcher-btn:not(.active):hover {
  color: var(--up-text-link) !important;
  background-color: transparent !important;
}
#product-modal .view-switcher-btn.active {
  background-color: #1060c1 !important;
  color: #fff !important;
  box-shadow: none !important;
}

#product-modal .view-switcher-btn:last-child {
  border-right: none !important;
  border-radius: 0px 4px 4px 0 !important;
}

#product-modal .view-switcher-btn:first-child {
  border-right: none !important;
  border-radius: 4px 0px 0px 4px !important;
}

#product-modal .modal-sort-options {
  display: flex;
  align-items: center;
  gap: 10px;
}
#product-modal .modal-sort-options label {
  margin: 0;
  font-weight: 500;
  color: var(--up-text-color);
}
#product-modal .modal-sort-options .form-control {
  width: auto;
  background-color: var(--up-bg-main);
  border-color: var(--up-border-color);
  box-shadow: none;
}

/* Fix: Prevent scrollbar on filter apply */
#modal-product-list-container {
  position: relative;
  min-height: 400px;
}
#modal-product-list-paginated-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--loader-overlay-bg);
  backdrop-filter: blur(2px);
  z-index: 10;
  display: none; /* Toggled by JS */
  justify-content: center;
  align-items: center;
}

/* === NEW: PAGINATION STYLES === */
#product-modal .modal-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0 0;
  margin-top: 20px;
  border-top: 1px solid var(--up-border-color);
}
#product-modal .pagination-info {
  font-size: var(--font-size-base);
  color: var(--up-text-color);
}
#product-modal .pagination-nav .pagination {
  margin: 0;
  box-shadow: none;
}
#product-modal .pagination-nav .pagination > li > a,
#product-modal .pagination-nav .pagination > li > span {
  background-color: var(--up-bg-main);
  border-color: var(--up-border-color);
  color: var(--up-text-link);
  border-radius: var(--up-border-radius-small);
  margin: 0 3px;
}
#product-modal .pagination-nav .pagination > li > a:hover,
#product-modal .pagination-nav .pagination > li > span:hover {
  background-color: var(--up-bg-gray);
  border-color: var(--up-text-link);
}
#product-modal .pagination-nav .pagination > .active > span {
  background-color: var(--up-text-link);
  border-color: var(--up-text-link);
  color: #fff;
}
#product-modal .pagination-nav .pagination > .disabled > span {
  background-color: var(--up-bg-gray);
  color: var(--up-text-gray-color);
  border-color: var(--up-border-color);
}

/* === MODAL FILTERS STYLING (EXISTING) === */
#modal-filters-content {
  padding: 10px;
  padding-left: 0px !important;
}

#modal-filters-content h5 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-text-wd-color);
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.filter-group {
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--up-bg-main);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium, 12px);
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--up-text-wd-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--up-border-color);
  margin-top: 0;
}

.filter-sub-group {
  margin-top: 15px;
  margin-bottom: 15px;
  padding: 12px 15px;
  background-color: rgba(0, 165, 212, 0.03);
  border-left: 3px solid rgba(0, 165, 212, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.filter-sub-group:hover {
  background-color: rgba(0, 165, 212, 0.05);
  border-left-color: rgba(0, 165, 212, 0.5);
}

.filter-sub-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--up-text-wd-color);
  margin-bottom: 10px;
  padding-left: 0;
  display: flex;
  align-items: center;
}

.filter-sub-title::before {
  content: "▸";
  margin-right: 6px;
  color: rgba(0, 165, 212, 0.6);
  font-size: 0.8em;
}

/* === MODIFICATION: REMOVED max-height === */
.filter-options {
  overflow-y: auto;
  padding-right: 0px;
}

/* === NEW: Compatibility Filter Switch === */
.compatibility-filter-group .filter-title {
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: none;
}
.compatibility-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  color: var(--up-text-color);
}
.compatibility-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.compatibility-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--up-primary-color, #007bff);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--up-color-success, #4caf50);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* === CUSTOM CHECKBOX STYLES (FIX 2.0) === */
.filter-options .checkbox {
  margin: 0 0 2px 0;
  position: relative;
}

/* Two-column layout for short filter values */
.filter-options.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.filter-options.two-column .checkbox {
  margin: 0;
  width: 100%;
}

/* Two-column layout for modal filters */
#component-modal-filters-content .filter-options.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

#component-modal-filters-content .filter-options.two-column .checkbox {
  margin: 0;
  width: 100%;
}

/* Two-column layout for main configurator filters */
#modal-filters-content .filter-options.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

#modal-filters-content .filter-options.two-column .checkbox {
  margin: 0;
  width: 100%;
}

/* Responsive adjustments for two-column filters - adaptive for all screen sizes */
@media (max-width: 1200px) {
  .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  #component-modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  #modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

@media (max-width: 768px) {
  .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  #component-modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  #modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }
}

@media (max-width: 480px) {
  .filter-options.two-column {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  #component-modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  #modal-filters-content .filter-options.two-column {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.filter-options .checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.filter-options .checkbox label {
  display: block;
  position: relative;
  padding: 8px 12px 8px 35px;
  border-radius: var(--up-border-radius-small, 8px);
  transition: background-color 0.2s ease;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  color: var(--up-text-color);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.filter-options .checkbox label:hover {
  background-color: var(--up-bg-gray);
  color: var(--up-text-wd-color);
}

.filter-options .checkbox label::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: var(--up-bg-wd);
  border: 1px solid var(--up-border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.filter-options .checkbox label:hover::before {
  border-color: var(--up-text-link);
}

.filter-options .checkbox input[type="checkbox"]:checked + label::before {
  background-color: var(--up-text-link);
  border-color: var(--up-text-link);
}

.filter-options .checkbox label::after {
  content: "";
  position: absolute;
  display: none;
  left: 16px;
  top: 50%;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-60%) rotate(45deg);
}

.filter-options .checkbox input[type="checkbox"]:checked + label::after {
  display: block;
}

/* === New: Price Filter Styles === */
.price-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-filter span {
  color: var(--up-text-color);
}
.price-filter input.form-control {
  background-color: var(--up-bg-wd);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-small, 8px);
  color: var(--up-text-wd-color);
  box-shadow: none;
  text-align: center;
  padding: 8px;
  height: auto;
  font-weight: 600;
  width: 100px;
}

.price-filter input.form-control:focus {
  border-color: var(--up-text-link);
}

.filter-options::-webkit-scrollbar {
  width: 6px;
}
.filter-options::-webkit-scrollbar-track {
  background: transparent;
  margin: 5px 0;
}
.filter-options::-webkit-scrollbar-thumb {
  background: var(--up-border-color);
  border-radius: 3px;
}
.filter-options::-webkit-scrollbar-thumb:hover {
  background: var(--up-text-gray-color);
}

/* === PRODUCT GRID VIEW === */
#modal-product-list.product-grid-view {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}
@media (max-width: 1600px) {
  #modal-product-list.product-grid-view {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 1200px) {
  #modal-product-list.product-grid-view {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 992px) {
  #modal-product-list.product-grid-view {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  #modal-product-list.product-grid-view {
    grid-template-columns: 1fr;
  }
}
.modal-product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--up-bg-main);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card-clickable-area {
  cursor: pointer;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.modal-product-card:hover {
  box-shadow: var(--up-box-shadow-small);
  border-color: var(--up-text-link);
}
.card-image {
  text-align: center;
  padding: 15px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-white);
}
.card-image img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
}
.card-body-main {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.4;
  color: var(--up-text-wd-color);
  min-height: 0px;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
  box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-primary-color, #007bff);
  margin-bottom: 15px;
}
.product-grid-view .attributes-list {
  list-style: none;
  padding: 0;
  margin: 0px;
  font-size: var(--font-size-sm);
  color: var(--up-text-color);
  border-top: 1px solid var(--up-border-color);
  padding-top: 10px;
  max-height: none;
  overflow: visible;
}
.product-grid-view .attributes-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid var(--up-border-color);
  margin-bottom: 4px;
  text-align: end;
}

.product-grid-view .attributes-list li:last-child {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: none;
  margin-bottom: 0px;
  text-align: end;
}

.product-grid-view .attributes-list li:first-child {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: none;
  text-align: end;
}

.product-grid-view .attributes-list li span {
  color: var(--up-text-gray-color);
  padding-right: 5px;
}
.product-grid-view .attributes-list li strong {
  font-weight: 600;
  color: var(--up-text-wd-color);
}
.card-footer {
  padding: 0 15px 15px 15px;
  margin-top: auto;
}
.card-footer .btn-add-to-build {
  font-size: var(--font-size-base);
  font-weight: 600;
}
.product-image {
  background-color: var(--color-white, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === PRODUCT LIST VIEW (ИЗМЕНЕНО) === */
#modal-product-list.product-list-view .list-group-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: var(--up-bg-main);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium);
  margin-bottom: 10px;
  padding: 15px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
#modal-product-list.product-list-view .list-group-item:hover {
  border-color: var(--up-text-link);
  box-shadow: var(--up-box-shadow-small);
}
.list-clickable-area {
  flex-grow: 1;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  cursor: pointer;
  min-width: 0;
  flex-wrap: nowrap;
}
.list-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.list-image {
  width: 80px;
  height: 80px;
  padding: 5px;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-small);
  flex-shrink: 0;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.list-details {
  flex-grow: 1;
  min-width: 0;
}
.list-name {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--up-text-wd-color);
  margin-bottom: 10px;
  line-height: 1.3;
}
.list-attributes {
  flex-grow: 1;
  min-width: 0;
}
.list-attributes .attributes-list {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.list-attributes .attributes-list li {
  display: inline-flex;
  align-items: center;
  background-color: var(--up-primary-color, #007bff14);
  border-radius: var(--up-border-radius-medium);
  padding: 4px 10px;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  white-space: break-spaces;
  border: none !important;
}
.list-attributes .attributes-list li span {
  color: var(--up-text-gray-color);
  padding-right: 5px;
}
.list-attributes .attributes-list li strong {
  color: var(--up-text-wd-color);
  font-weight: 500;
}
.list-attributes .attributes-list li .stock-status-badge {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: var(--up-color-success);
  font-weight: 600;
}
.list-attributes .attributes-list li:has(.stock-status-badge) {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.2);
}
.list-price {
  font-size: var(--font-size-xl);
  font-weight: 500;
  color: var(--up-color-price, var(--up-text-wd-color));
  min-width: 150px;
  text-align: right;
  padding: 0 15px;
}

.list-price.mobile-price {
  display: none;
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: 5px;
  text-align: left;
  padding: 0;
}

@media (max-width: 768px) {
  .card-image {
    padding: 10px;
  }
  .list-price.desktop-price {
    display: none;
  }

  .list-price.mobile-price {
    display: block;
  }

  .list-clickable-area {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .list-image-container {
    width: auto;
    margin-right: 15px;
    margin-bottom: 0;
    flex-shrink: 0;
    order: 1;
  }

  .list-image {
    margin-right: 0;
    margin-bottom: 0;
  }

  .list-details {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    order: 2;
  }

  .list-details .list-price.mobile-price {
    text-align: left;
    margin-top: 5px;
    margin-bottom: 0;
    order: 2;
  }

  .list-details .list-name {
    order: 1;
  }

  .list-details .list-attributes {
    order: 3;
    width: 100%;
    margin-top: 10px;
    flex-basis: 100%;
  }

  .list-attributes .attributes-list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .list-attributes .attributes-list li {
    margin-bottom: 0px;
    white-space: normal;
    line-height: 1.4;
    flex-wrap: nowrap !important;
  }
  .list-attributes .attributes-list li span {
    color: var(--up-text-gray-color);
    margin-right: 5px;
  }
  .list-attributes .attributes-list li strong {
    color: var(--up-text-wd-color);
  }
  .list-attributes .attributes-list li .stock-status-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--up-border-radius-small);
  }
  .list-price {
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--up-text-wd-color);
    min-width: 0px;
    text-align: center;
    padding: 0;
  }
}
.list-action {
  margin-left: auto;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.list-action .list-price {
  text-align: center;
  margin-bottom: 8px;
  padding: 0;
}

.list-action .btn-add-to-build {
  min-width: 150px;
  font-size: var(--font-size-base);
  font-weight: 600;
}

/* === Product Details Modal Styles (Redesigned) === */
#product-details-modal .modal-content {
  background-color: var(--up-bg-wd, #fff);
  border: 1px solid var(--up-border-color, #e0e0e0);
  box-shadow: var(--up-box-shadow-1px, 0 2px 8px rgba(0, 0, 0, 0.1));
}

#product-details-modal .modal-header {
  background-color: transparent;
  border-bottom: 1px solid var(--up-border-color, #e0e0e0);
  padding: 15px 25px;
}

#component-selection-modal .modal-header {
  padding: 5px 15px;
}

#product-details-modal .modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--up-text-wd-color, #333);
  display: none;
}

#product-details-modal .modal-lg {
  width: 90%;
  max-width: 1100px;
}

#product-details-modal .modal-body {
  padding: 25px 30px;
}

/* Left column (Images) */
.details-image-main {
  margin-bottom: 15px;
  padding: 15px;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-white, #fff);
  position: relative;
  overflow: hidden;
}

.details-image-main img {
  max-height: 370px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.details-image-main:hover img {
  transform: scale(1.05);
}

.details-image-thumbnails {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.details-image-thumbnails .thumbnail-item {
  width: 80px;
  height: 80px;
  padding: 5px;
  border: 2px solid var(--up-border-color);
  border-radius: var(--up-border-radius-small);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-white, #fff);
}

.details-image-thumbnails .thumbnail-item:hover {
  border-color: var(--up-text-link);
  transform: translateY(-2px);
}
.details-image-thumbnails .thumbnail-item.active {
  border-color: var(--up-text-link);
  box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
}

.details-image-thumbnails .thumbnail-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Right column (Info) */
#details-modal-name {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--up-text-wd-color);
}

.details-meta {
  display: flex;
  gap: 20px;
  font-size: var(--font-size-sm);
  color: var(--up-text-color);
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--up-border-color);
}
.details-meta strong {
  color: var(--up-text-wd-color);
  font-weight: 500;
}

.details-price {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  color: var(--up-color-price, var(--up-text-wd-color));
  margin-bottom: 20px;
}

.details-actions {
  background-color: var(--up-bg-main);
  padding: 20px;
  border-radius: var(--up-border-radius-medium);
  margin-bottom: 20px;
}

#details-modal-add-btn {
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding: 12px 25px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#details-modal-add-btn .svg-icon-wrapper {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.attributes-container {
  margin-top: 20px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 15px; /* For scrollbar spacing on desktop */
}

@media (max-width: 768px) {
  .attributes-container {
    max-height: none;
    overflow-y: visible;
    padding-right: 0; /* No scrollbar on mobile, so no padding needed */
  }
}

.attributes-container::-webkit-scrollbar {
  width: 6px;
}
.attributes-container::-webkit-scrollbar-track {
  background: transparent;
  margin: 5px 0;
}
.attributes-container::-webkit-scrollbar-thumb {
  background: var(--up-border-color);
  border-radius: 3px;
}
.attributes-container::-webkit-scrollbar-thumb:hover {
  background: var(--up-text-gray-color);
}

.attributes-container .attribute-group {
  margin-bottom: 15px;
}
.attributes-container .attribute-group:last-child {
  margin-bottom: 5px;
}

.attributes-container .attribute-group-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--up-border-color);
  color: var(--up-text-wd-color);
}

.attributes-container .attribute-table {
  width: 100%;
  font-size: var(--font-size-base);
  border-collapse: collapse;
}

.attributes-container .attribute-table tr {
  transition: background-color 0.2s ease;
}

.attributes-container .attribute-table tr:hover {
  background-color: var(--up-bg-main);
}

.attributes-container .attribute-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--up-border-color);
}

.attributes-container .attribute-table tr:last-child td {
  border-bottom: none;
}

.attributes-container .attribute-table td:first-child {
  width: 45%;
  color: var(--up-text-color);
  font-weight: 400;
}

.attributes-container .attribute-table td:last-child {
  font-weight: 500;
  color: var(--up-text-wd-color);
}

/* === NEW: Summary Cards (Task 2) === */
#summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Override old li styles */
#summary-list li {
  display: block;
  padding: 0;
  font-weight: normal;
}
#summary-list li strong {
  font-size: inherit;
  font-weight: normal;
  color: inherit;
}

.summary-card {
  background-color: var(--up-bg-wd);
  border-radius: var(--up-border-radius-medium, 12px);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--up-border-color);
}

.summary-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card-icon .svg-icon-wrapper {
  width: 22px;
  height: 22px;
  margin: 0;
}

.power-card .svg-icon-wrapper {
  color: #ecc94b;
}

.price-card .svg-icon-wrapper {
  color: #48bb78;
}

.summary-card-icon .svg-icon-wrapper svg {
  stroke-width: 2;
}

.summary-card.power-card .summary-card-icon {
  background-color: rgba(236, 201, 75, 0.15);
  color: #ecc94b;
}

.summary-card.power-card .summary-card-value span {
  color: #ecc94b;
}

.summary-card.price-card .summary-card-icon {
  background-color: rgba(72, 187, 120, 0.15);
  color: #48bb78;
}

.summary-card.price-card .summary-card-value span {
  color: #48bb78;
}

.summary-card-value {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  overflow: hidden;
}

.summary-card-value span {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  white-space: nowrap;
}

.summary-card-value small {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--up-text-gray-color);
  text-transform: uppercase;
}

hr {
  border-top: 1px solid var(--up-border-color);
}

/* === ИЗМЕНЕНИЕ НАЧАЛО: Стили для кликабельного названия товара и иконок в сводке === */

/* Стиль для кликабельного названия выбранного товара */
.view-details-link {
  cursor: pointer;
  transition: color 0.2s ease;
}
.view-details-link:hover {
  color: var(--up-text-link, #2196f3);
  text-decoration: underline;
}

/* Стили для списка компонентов в сводке с иконками */
#summary-list-components .summary-item-list li {
  display: flex;
  align-items: center;
  gap: 8px; /* Расстояние между иконкой и текстом */
  padding: 5px 0; /* Увеличенный отступ */
}

#summary-list-components .component-icon .svg-icon-wrapper {
  width: 20px;
  height: 20px;
  color: var(--up-text-gray-color);
  flex-shrink: 0;
  margin-right: 0; /* Убираем правый отступ по умолчанию */
}
/* === ИЗМЕНЕНИЕ КОНЕЦ === */

/* --- ИЗМЕНЕНИЕ НАЧАЛО: Улучшенная анимация добавления в сборку --- */
@keyframes fly-to-target {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    left: var(--target-x);
    top: var(--target-y);
    transform: scale(0.1);
    opacity: 0;
  }
}

.fly-to-cart-clone {
  position: fixed;
  z-index: 9999;
  width: 100px;
  height: 100px;
  border-radius: var(--up-border-radius-medium, 12px);
  background-color: var(--color-white, #fff);
  border: 2px solid var(--up-text-link, #2196f3);
  box-shadow: var(--up-box-shadow-large);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 5px;
  transition: left 0.6s cubic-bezier(0.29, 0.53, 0.58, 1),
    top 0.6s cubic-bezier(0.29, 0.53, 0.58, 1);
}

.fly-to-cart-clone.is-flying {
  animation: fly-to-target 0.6s cubic-bezier(0.29, 0.53, 0.58, 1) forwards;
}

.fly-to-cart-clone img,
.fly-to-cart-clone .svg-icon-wrapper {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.fly-to-cart-clone .svg-icon-wrapper {
  width: 50%;
  height: 50%;
  color: var(--up-text-link);
}
/* --- ИЗМЕНЕНИЕ КОНЕЦ --- */

/* === NEW: Power Bar Indicator Styles === */
#summary-power-indicator-container {
  grid-column: 1 / -1; /* Span full width of the grid */
}

.summary-power-indicator {
  background-color: var(--up-bg-wd);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-medium, 12px);
  padding: 15px 20px;
  width: 100%;
}

.power-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: var(--font-size-base);
}

.power-label-title {
  font-weight: 600;
  color: var(--up-text-wd-color);
}

.power-label-value {
  font-weight: 500;
  color: var(--up-text-color);
  font-family: monospace; /* For better number alignment */
}

.power-bar-container {
  height: 16px; /* Slightly taller */
  background-color: var(--up-bg-gray);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.power-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s ease-in-out, background-color 0.5s ease;
}

.power-bar.green {
  background: linear-gradient(to right, #48bb78, #38a169); /* success color */
}

.power-bar.yellow {
  background: linear-gradient(to right, #f6e05e, #ecc94b); /* warning color */
}

.power-bar.red {
  background: linear-gradient(to right, #f56565, #e53e3e); /* danger color */
}

/* Override for the fallback card */
#summary-power-indicator-container .summary-card {
  margin-bottom: 0;
}

/* === NEW START (Task 1): Stock Status Highlight === */
.stock-status-badge {
  font-weight: 600;
  color: var(--up-color-success, #4caf50);
  background-color: rgba(76, 175, 80, 0.1);
  padding: 3px 8px;
  border-radius: var(--up-border-radius-small, 8px);
  font-size: var(--font-size-xs);
}
/* === NEW END === */

/* === FIX START (Task 4): Disabled Button Tooltip on Hover === */
.summary-actions .tooltip-wrapper {
  position: relative;
}
.summary-actions .disabled-tooltip {
  visibility: hidden; /* Hidden by default */
  opacity: 0;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--up-bg-tooltip, #2d3748);
  color: var(--up-text-tooltip-color, #fff);
  padding: 8px 12px;
  border-radius: var(--up-border-radius-small, 8px);
  font-size: var(--font-size-sm);
  font-weight: 500;
  z-index: 10;
  box-shadow: var(--up-box-shadow-large);
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  min-width: 300px;
  max-width: 450px;
  white-space: normal;
  text-align: left;
}

/* Show tooltip on hover of the wrapper *only if* it has the 'has-tooltip' class */
.summary-actions .tooltip-wrapper.has-tooltip:hover .disabled-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Tooltip arrow */
.summary-actions .disabled-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--up-bg-tooltip, #2d3748) transparent transparent
    transparent;
}
/* === FIX END === */

/* === FIX: Product Page Add-to-Cart Tooltip (generic scope) === */
.tooltip-wrapper {
  position: relative;
}
.tooltip-wrapper .disabled-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--up-bg-tooltip, #2d3748);
  color: var(--up-text-tooltip-color, #fff);
  padding: 8px 12px;
  border-radius: var(--up-border-radius-small, 8px);
  font-size: var(--font-size-sm);
  font-weight: 500;
  z-index: 10;
  box-shadow: var(--up-box-shadow-large);
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  min-width: 300px;
  max-width: 450px;
  white-space: normal;
  text-align: left;
}
.tooltip-wrapper.has-tooltip:hover .disabled-tooltip {
  visibility: visible;
  opacity: 1;
}
.tooltip-wrapper .disabled-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--up-bg-tooltip, #2d3748) transparent transparent
    transparent;
}

/* === NEW (Task 2): Case Image in Summary === */
#summary-case-image-container {
  text-align: center;
  margin-bottom: 15px;
}
.summary-case-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--up-text-wd-color);
  margin-top: 0;
  margin-bottom: 15px;
}
.summary-case-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--up-border-radius-medium);
}
/* === END NEW === */

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* --- Main Layout --- */
@media (max-width: 991px) {
  #configurator-app .row > [class*="col-"] {
    width: 100%;
    float: none;
    margin-bottom: 25px;
  }
  #configurator-app .row > [class*="col-"]:last-child {
    margin-bottom: 0;
  }
}

/* --- Stepper --- */
@media (max-width: 768px) {
  .steps-container .list-group {
    margin-left: 5px;
  }
  .list-group-item-wrapper {
    padding-right: 5px;
  }
  .step-main-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }
  .step-visual {
    top: 15px;
  }
  .step-info {
    margin-bottom: 10px;
  }
  .step-action {
    margin-left: 0;
    width: 100%;
  }
  .step-action .choose-product-btn {
    width: 100%;
    font-size: var(--font-size-sm) !important;
  }
  .product-details-row {
    flex-wrap: wrap;
    padding: 10px;
    padding-bottom: 0;
    row-gap: 5px;
    align-items: center;
  }
  .product-details-image {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
  }
  .product-details-name {
    flex-basis: 100%;
    margin-bottom: 0;
  }
  .product-details-price {
    text-align: left;
  }
  .quantity-control {
    flex: 1 1 140px;
    margin-right: 10px;
  }
  .product-details-price {
    flex: 0 1 auto;
    margin-right: 10px;
    font-size: var(--font-size-lg);
    white-space: nowrap;
  }
  .remove-product-btn {
    height: 40px;
    width: 40px;
    margin-left: auto;
  }
}

/* --- Product details row wrap for product page configurator (992px–1439px) --- */
@media (min-width: 992px) and (max-width: 1255px) {
  .product-page-configurator .product-details-row {
    flex-wrap: wrap !important;
    justify-content: space-between;
  }
  .product-page-configurator .product-details-row .quantity-control {
    margin-left: 0;
  }
}

/* --- Modal --- */
@media (max-width: 991px) {
  #product-modal .modal-dialog {
    width: 95%;
    max-width: 900px;
    margin: 15px auto;
  }
  #modal-product-list-container {
    height: calc(100vh - 220px);
  }
  #modal-filters-container {
    height: calc(100vh - 150px);
  }
}

@media (max-width: 768px) {
  #product-modal .modal-dialog {
    margin: 0;
    width: 100%;
  }
  #product-modal .modal-content {
    border-radius: 0;
    min-height: 100vh;
    border: none;
    overflow: hidden;
  }

  #product-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
  }
  #modal-filters-container {
    padding-top: 20px;
    width: 100%;
    max-width: 100%;
    border-right: none;
  }
  #modal-product-list-container {
    width: 100%;
    height: auto;
  }
  .modal-controls-header {
    flex-direction: column;
    gap: 10px;
  }
  .modal-search-bar,
  .modal-view-options,
  .modal-sort-options {
    width: 100%;
  }
}

/* --- Modal Filters --- */
@media (max-width: 768px) {
  .filter-panel .panel-body {
    padding: 15px;
  }
  .price-filter-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }
  .price-filter-inputs .price-filter-separator {
    display: none;
  }
  .price-filter-inputs input {
    width: calc(50% - 5px);
    text-align: center;
  }
}

/* --- Modal Product List --- */
@media (max-width: 575px) {
  #modal-product-list.product-grid-view {
    grid-template-columns: 1fr;
  }

  .list-clickable-area {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .list-image-container {
    width: auto;
    margin-right: 15px;
    margin-bottom: 0;
    flex-shrink: 0;
    order: 1;
  }
  .list-image {
    margin-bottom: 0;
  }
  .list-details {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    order: 2;
  }
  .list-details .list-name {
    order: 1;
  }
  .list-details .list-price.mobile-price {
    text-align: left;
    margin-top: 5px;
    margin-bottom: 0;
    order: 2;
  }
  .list-details .list-attributes {
    order: 3;
    width: 100%;
    margin-top: 10px;
    flex-basis: 100%;
  }
  .list-action {
    margin-top: 10px;
    padding-left: 0;
    width: 100%;
  }
  .list-action .btn {
    width: 100%;
  }
}

/* --- Product Details Modal --- */
@media (max-width: 768px) {
  #product-details-modal .modal-dialog {
    width: 100%;
    margin: 0;
    height: 100%;
  }

  #product-details-modal .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
  }

  #product-details-modal .modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
    padding: 15px;
  }

  #product-details-modal .details-image-column {
    margin-bottom: 20px;
  }

  #product-details-modal .details-info-column {
    margin-top: 0;
  }

  #details-modal-name {
    font-size: var(--font-size-xl);
  }

  .details-price {
    font-size: var(--font-size-xl);
  }
}

/* --- Product Details Modal (Component) — mirror main configurator responsive --- */
@media (max-width: 768px) {
  #component-product-details-modal .modal-dialog {
    width: 100%;
    margin: 0;
    height: 100%;
  }

  #component-product-details-modal .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
  }

  #component-product-details-modal .modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
    padding: 15px;
  }

  #component-product-details-modal .details-image-column {
    margin-bottom: 20px;
  }

  #component-product-details-modal .details-info-column {
    margin-top: 0;
  }

  #component-details-modal-name {
    font-size: var(--font-size-xl);
  }

  #component-product-details-modal .details-price {
    font-size: var(--font-size-xl);
  }
}

/* --- Burger Menu for Filters --- */
.filter-toggle-btn {
  display: none; /* Hidden by default */
  align-items: center;
  gap: 8px;
  font-weight: 600;
  position: relative;
  z-index: 10;
}

@media (max-width: 1439px) {
  .filter-toggle-btn {
    display: flex; /* Показываем кнопку-бургер */
  }

  /* Заставляем тело модалки занимать всю высоту */
  #product-modal .modal-body {
    position: relative;
  }

  #modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: var(--up-bg-wd);
    z-index: 1051; /* Выше чем modal-backdrop (1040) и overlay (1045) */

    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      visibility 0s 0.35s;

    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
  }

  #modal-filters-container.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  }

  /* Продукты занимают всю ширину, т.к. фильтры теперь в отдельном слое */
  #modal-product-list-container {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  #product-modal .modal-body > .row {
    /* Это предотвратит "схлопывание" ряда, если в нем останется один элемент */
    flex-wrap: nowrap;
    margin-left: 0;
    margin-right: 0;
  }
  #modal-filters-content {
    padding-left: 10px !important;
  }
}

@media (max-width: 768px) {
  #modal-filters-container {
    padding-top: 20px;
  }

  .filter-panel .panel-body {
    padding: 15px;
  }

  .price-filter-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }
  .price-filter-inputs .price-filter-separator {
    display: none;
  }
  .price-filter-inputs input {
    width: calc(50% - 5px);
    text-align: center;
  }
}

/* Фильтр-бургер и сайдбар */
#filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1045; /* Ниже панели фильтров, выше остального */
  display: none; /* Скрыто по умолчанию, управляется JS */
}

/* merged base .filter-toggle-btn styles above */

@media (max-width: 1439px) {
  .filter-toggle-btn {
    display: flex;
  }

  #modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-105%);
    width: 350px;
    max-width: 90%;
    background-color: var(--up-bg-wd);
    z-index: 1051; /* Выше чем modal-backdrop (1040) и overlay (1045) */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
  }

  #modal-filters-container.open {
    transform: translateX(0);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  }

  #modal-product-list-container {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 15px; /* Сохраняем отступ */
  }

  #product-modal .modal-body > .row {
    flex-wrap: nowrap; /* Предотвращает перенос, если что-то пойдет не так */
  }
}

@media (max-width: 768px) {
  #modal-filters-container {
    padding-top: 20px;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .modal-controls-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .modal-search-bar {
    flex-basis: 100%;
    order: 1; /* Поиск всегда первый */
  }
  .view-switcher-group {
    order: 2;
  }
  .modal-sort-options {
    flex-grow: 1;
    order: 3;
  }
}

/* === Responsive Filter Panel Fixes === */
@media (min-width: 992px) and (max-width: 1439px) {
  #modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: var(--up-bg-wd);
    z-index: 1051;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      visibility 0s 0.35s;
    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
    padding-top: 20px;
  }
  #modal-filters-container.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  }
  #product-modal .modal-body > .row {
    flex-wrap: nowrap;
  }
  #modal-filters-column {
    width: 0;
    padding: 0;
    flex: 0 0 0;
    border: 0;
  }
  #modal-products-column {
    padding: 0;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 991px) {
  #modal-filters-column {
    height: 0 !important;
  }
  #modal-filters-column,
  #modal-products-column {
    padding: 0;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
  #modal-filters-container {
    border-right: none;
    border-bottom: 1px solid var(--up-border-color);
    margin-bottom: 15px;
  }
  #modal-product-list-container {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  #product-details-modal .modal-body {
    flex-direction: column;
  }
}

#modal-product-list-wrapper {
  height: 100%;
}
#modal-product-list-container {
  height: 100%;
  overflow-y: auto;
  padding: 15px 15px 50px 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--up-border-color) var(--up-bg-main);
}
#modal-filters-container {
  border-right: 1px solid var(--up-border-color);
}

@media (max-width: 768px) {
  /* Sticky controls header for main configurator */
  #product-modal .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--up-bg-wd);
    padding: 4px 8px;
    margin: -15px -15px 4px -15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--up-border-color);
    gap: 6px;
  }
  
  /* Sticky controls header for product page configurator */
  .product-page-configurator #product-modal .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--up-bg-wd);
    padding: 4px 8px;
    margin: -15px -15px 4px -15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--up-border-color);
    gap: 6px;
  }
  
  /* Reduce sizes of elements inside modal-controls-header */
  #product-modal .modal-view-options {
    gap: 8px;
  }
  
  .product-page-configurator #product-modal .modal-view-options {
    gap: 8px;
  }
  
  #product-modal .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .product-page-configurator #product-modal .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #product-modal .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .product-page-configurator #product-modal .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #product-modal .modal-sort-options {
    gap: 4px;
  }
  
  .product-page-configurator #product-modal .modal-sort-options {
    gap: 4px;
  }
  
  #product-modal .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  .product-page-configurator #product-modal .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  #product-modal .modal-search-bar .form-control {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  .product-page-configurator #product-modal .modal-search-bar .form-control {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #product-modal .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }
  
  .product-page-configurator #product-modal .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }
  
  #product-modal .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  .product-page-configurator #product-modal .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #modal-product-list-container {
    padding-top: 0;
  }
  
  /* Ensure sticky works correctly */
  #modal-product-list-container .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 4px 8px;
    margin-bottom: 4px;
    gap: 6px;
    background-color: var(--up-bg-wd);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--up-border-color);
  }
  
  /* Ensure sticky works correctly for product page configurator */
  .product-page-configurator #modal-product-list-container .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 4px 8px;
    margin-bottom: 4px;
    gap: 6px;
    background-color: var(--up-bg-wd);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--up-border-color);
  }
  
  /* Reduce sizes of elements inside modal-product-list-container modal-controls-header */
  #modal-product-list-container .modal-view-options {
    gap: 8px;
  }
  
  .product-page-configurator #modal-product-list-container .modal-view-options {
    gap: 8px;
  }
  
  #modal-product-list-container .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .product-page-configurator #modal-product-list-container .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #modal-product-list-container .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .product-page-configurator #modal-product-list-container .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #modal-product-list-container .modal-sort-options {
    gap: 4px;
  }
  
  .product-page-configurator #modal-product-list-container .modal-sort-options {
    gap: 4px;
  }
  
  #modal-product-list-container .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  .product-page-configurator #modal-product-list-container .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  #modal-product-list-container .modal-search-bar .form-control {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  .product-page-configurator #modal-product-list-container .modal-search-bar .form-control {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #modal-product-list-container .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }
  
  .product-page-configurator #modal-product-list-container .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }
  
  #modal-product-list-container .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  .product-page-configurator #modal-product-list-container .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #modal-product-list.product-list-view .list-group-item {
    flex-direction: column;
    align-items: baseline;
  }
  .list-image {
    margin-right: 0;
    margin-bottom: 0px;
  }
  .list-price {
    text-align: left;
    margin-left: 0;
    margin-top: 10px;
  }
  .list-action {
    margin-left: 0;
    margin-top: 15px;
  }
  .list-action .btn {
    width: 100%;
  }
  #modal-filter-toggle {
    width: -webkit-fill-available;
  }
  .modal-search-bar {
    max-width: 100% !important;
  }
  .modal-sort-options .form-control {
    width: 100% !important;
  }
  #modal-product-list.product-list-view .list-group-item {
    padding: 10px;
  }

  #product-modal .modal-body > .row,
  #product-modal .modal-body > .row > [class*="col-"] {
    padding: 0;
  }

  #modal-product-list-container {
    padding: 15px;
  }

  /* FIX: Скрываем скроллбар в модальном окне на мобильных устройствах */
  #modal-product-list-container,
  #modal-filters-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }

  #modal-product-list-container::-webkit-scrollbar,
  #modal-filters-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
}

/* === FIX: Remove horizontal scroll in mobile modal === */
@media (max-width: 768px) {
  /* Ensure the modal and its key containers don't create horizontal overflow */
  #product-modal,
  #product-modal .modal-dialog,
  #product-modal .modal-content,
  #product-modal .modal-body,
  #modal-product-list-container,
  #modal-filters-container {
    overflow-x: hidden !important;
  }

  /* Neutralise Bootstrap row negative margins that can cause overflow */
  #product-modal .modal-body > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* === Collapsible Filter Options === */
.filter-options.collapsed .checkbox:nth-of-type(n + 7) {
  display: none;
}

/* Ensure collapsed state works in filter sub-groups */
.filter-sub-group .filter-options.collapsed .checkbox:nth-of-type(n + 7) {
  display: none !important;
}

/* Ensure collapsed state works in filter groups (for manufacturer filters) */
.filter-group .filter-options.collapsed .checkbox:nth-of-type(n + 7) {
  display: none !important;
}

.filter-show-more {
  margin-top: 6px;
  font-size: var(--font-size-sm, 14px);
  color: #007bff;
  cursor: pointer;
  user-select: none;
  text-decoration: none !important;
}

.filter-show-more:hover {
  text-decoration: underline !important;
}

/* Stock Status Styles */
.status-in-stock {
  color: #5cb85c;
  font-weight: bold;
}
.status-out-of-stock {
  color: #d9534f;
  font-weight: bold;
}
.status-low-stock {
  color: #f0ad4e;
  font-weight: bold;
}

/* === NEW: Stock status badges === */
.stock-status-badge.out-of-stock {
  color: #a94442 !important;
  background-color: #f2dede !important;
}
.stock-status-badge.delayed {
  color: #8a6d3b !important;
  background-color: #fcf8e3 !important;
}
.stock-status-badge.pre-order {
  color: #31708f !important;
  background-color: #d9edf7 !important;
}
/* === END Stock status badges === */

/* === NEW: Availability row colors === */
.attributes-list li.out-of-stock {
  color: #a94442 !important;
  background-color: #f2dede !important;
}
.attributes-list li.delayed {
  color: #8a6d3b !important;
  background-color: #fcf8e3 !important;
}
.attributes-list li.pre-order {
  color: #31708f !important;
  background-color: #d9edf7 !important;
}
.attributes-list li.state-attribute {
  background-color: #e9a63228 !important;
}
/* === END Availability row colors === */

/* === RESPONSIVE STYLES FOR PRODUCT PAGE CONFIGURATOR === */
/* Duplicate all modal responsive rules for component- prefixed elements */

@media (max-width: 1439px) {
  #component-modal-filter-toggle {
    display: flex; /* Показываем кнопку-бургер */
    width: -webkit-fill-available; /* ширина как у основного конфигуратора */
  }

  /* Заставляем тело модалки занимать всю высоту */
  #component-selection-modal .modal-body {
    position: relative;
  }

  #component-modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: var(--up-bg-wd);
    z-index: 1051; /* Выше чем modal-backdrop (1040) и overlay (1045) */

    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      visibility 0s 0.35s;

    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
  }

  #component-modal-filters-container.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    max-height: 100%;
    padding-left: 10px;
  }

  /* Продукты занимают всю ширину, т.к. фильтры теперь в отдельном слое */
  #component-modal-product-list-container {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  #component-selection-modal .modal-body > .row {
    /* Это предотвратит "схлопывание" ряда, если в нем останется один элемент */
    flex-wrap: nowrap;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  #component-modal-filters-container {
    padding-top: 20px;
  }

  #component-product-details-modal .modal-body {
    flex-direction: column;
  }
}

/* Фильтр-бургер и сайдбар для компонентов */
#component-filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1045; /* Ниже панели фильтров, выше остального */
  display: none; /* Скрыто по умолчанию, управляется JS */
}

#component-modal-filter-toggle {
  display: none;
  position: relative;
  z-index: 10;
}

@media (max-width: 1439px) {
  #component-modal-filter-toggle {
    display: flex;
  }

  #component-modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-105%);
    width: 350px;
    max-width: 90%;
    background-color: var(--up-bg-wd);
    z-index: 1051; /* Выше чем modal-backdrop (1040) и overlay (1045) */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
  }

  #component-modal-filters-container.open {
    transform: translateX(0);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  }

  #component-modal-product-list-container {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 15px; /* Сохраняем отступ */
  }

  #component-selection-modal .modal-body > .row {
    flex-wrap: nowrap; /* Предотвращает перенос, если что-то пойдет не так */
  }
}

@media (max-width: 768px) {
  #component-modal-filters-container {
    padding-top: 20px;
  }
  #component-selection-modal .modal-search-bar {
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  #component-selection-modal .modal-controls-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  #component-selection-modal .modal-search-bar {
    flex-basis: 100%;
    order: 1; /* Поиск всегда первый */
    max-width: none;
    width: 100%;
  }
  #component-selection-modal .view-switcher-group {
    order: 2;
  }
  #component-selection-modal .modal-sort-options {
    flex-grow: 1;
    order: 3;
  }

  #component-selection-modal .modal-view-options {
    max-width: none;
    width: 100%;
  }
}

/* === Responsive Filter Panel Fixes для компонентов === */
@media (min-width: 992px) and (max-width: 1439px) {
  #component-modal-filters-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-width: 90%;
    height: 100%;
    background-color: var(--up-bg-wd);
    z-index: 1051;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      visibility 0s 0.35s;
    box-shadow: none;
    border-right: 1px solid var(--up-border-color);
    padding-top: 20px;
  }
  #component-modal-filters-container.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  }
  #component-selection-modal .modal-body > .row {
    flex-wrap: nowrap;
  }
  #component-modal-filters-column {
    width: 0;
    padding: 0;
    flex: 0 0 0;
    border: 0;
  }
  #component-modal-products-column {
    padding: 0;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 991px) {
  #component-modal-filters-column {
    height: 0 !important;
  }
  #component-modal-filters-column,
  #component-modal-products-column {
    padding: 0;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
  #component-modal-filters-container {
    border-right: none;
    border-bottom: 1px solid var(--up-border-color);
    margin-bottom: 15px;
  }
  #component-modal-product-list-container {
    padding-right: 0;
  }
}

#component-modal-product-list-wrapper {
  height: 100%;
}
#component-modal-product-list-container {
  overflow-y: auto;
  padding: 15px;
  padding-top: 0;
}
#component-modal-filters-container {
  border-right: 1px solid var(--up-border-color);
}

/* Component configurator mobile price styles */
#component-modal-product-list .list-price.mobile-price {
  display: none;
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: 5px;
  text-align: left;
  padding: 0;
}

/* Component configurator modal product list row mobile price base styles */
#component-modal-product-list .modal-product-list-row .mobile-price {
  display: none;
}

/* Component configurator list action styles */
#component-modal-product-list .list-action {
  margin-left: auto;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#component-modal-product-list .list-action .list-price {
  text-align: center;
  margin-bottom: 8px;
  padding: 0;
}

#component-modal-product-list .list-action .btn-add-to-build {
  min-width: 150px;
  font-size: var(--font-size-base);
  font-weight: 600;
}

@media (max-width: 768px) {
  /* Mobile adaptation for modal controls header in component configurator */
  /* Sticky controls header for component configurator */
  #component-selection-modal .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--up-bg-wd);
    padding: 4px 8px;
    margin: -15px -15px 4px -15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--up-border-color);
  }
  
  /* Reduce sizes of elements inside modal-controls-header */
  #component-selection-modal .modal-view-options {
    gap: 8px;
  }
  
  #component-selection-modal .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #component-selection-modal .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #component-selection-modal .modal-sort-options {
    gap: 4px;
  }
  
  #component-selection-modal .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  #component-selection-modal .modal-search-bar input {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #component-selection-modal .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #component-selection-modal .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }
  
  #component-modal-product-list-container {
    padding-top: 0;
  }
  
  /* Ensure sticky works correctly */
  #component-modal-product-list-container .modal-controls-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 4px 8px;
    margin-bottom: 4px;
    gap: 6px;
    background-color: var(--up-bg-wd);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--up-border-color);
  }
  
  /* Reduce sizes of elements inside component-modal-product-list-container modal-controls-header */
  #component-modal-product-list-container .modal-view-options {
    gap: 8px;
  }
  
  #component-modal-product-list-container .view-switcher-btn {
    padding: 3px 6px !important;
    min-height: auto;
    line-height: 1.2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #component-modal-product-list-container .view-switcher-btn .svg-icon-wrapper {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #component-modal-product-list-container .modal-sort-options {
    gap: 4px;
  }
  
  #component-modal-product-list-container .modal-sort-options label {
    font-size: 12px;
    margin: 0;
  }
  
  #component-modal-product-list-container .modal-search-bar input {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #component-modal-product-list-container .modal-sort-options select {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    height: auto;
  }
  
  #component-modal-product-list-container .filter-toggle-btn {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
  }

  #component-modal-product-list.product-list-view .list-group-item {
    padding: 10px;
  }
  #component-modal-product-list.product-list-view .list-action {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #component-modal-product-list.product-list-view .desktop-price {
    display: none;
  }
  #component-modal-product-list.product-list-view .mobile-price {
    display: block;
  }

  /* Component configurator attributes list mobile styles (matching main configurator) */
  #component-modal-product-list .list-image {
    margin-right: 0;
  }

  #component-modal-product-list .list-attributes .attributes-list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #component-modal-product-list .list-attributes .attributes-list li {
    margin-bottom: 4px;
    white-space: normal;
    line-height: 1.4;
  }
  #component-modal-product-list .list-attributes .attributes-list li span {
    color: var(--up-text-gray-color);
    margin-right: 5px;
    flex-shrink: 1;
  }
  #component-modal-product-list .list-attributes .attributes-list li strong {
    color: var(--up-text-wd-color);
  }
  #component-modal-product-list
    .list-attributes
    .attributes-list
    li
    .stock-status-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--up-border-radius-small);
  }

  /* Component configurator price mobile styles */
  #component-modal-product-list .list-price {
    font-size: var(--font-size-xl);
    font-weight: 500;
    min-width: 0px;
    text-align: center;
    padding: 0;
  }
}

@media (max-width: 768px) {
  /* Component configurator modal product list row mobile styles */
  #component-modal-product-list .modal-product-list-row .desktop-price {
    display: none;
  }

  #component-modal-product-list .modal-product-list-row .list-clickable-area {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  /* Mobile grouped block: image, name, and price together */
  #component-modal-product-list .modal-product-list-row .mobile-grouped-block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0px;
  }

  #component-modal-product-list .modal-product-list-row .mobile-grouped-block .list-image-container {
    width: auto;
    margin-right: 15px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  #component-modal-product-list .modal-product-list-row .mobile-grouped-block .list-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  #component-modal-product-list .modal-product-list-row .mobile-grouped-block .list-name {
    font-weight: 600;
    margin-bottom: 0px;
    color: var(--up-text-wd-color);
  }

  #component-modal-product-list .modal-product-list-row .mobile-grouped-block .list-price.mobile-price {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 500;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    color: var(--up-primary-color, #007bff);
  }

  /* Attributes block below grouped block */
  #component-modal-product-list .modal-product-list-row .list-clickable-area > .list-attributes {
    width: 100%;
    margin-top: 0;
  }

  #component-modal-product-list .modal-product-list-row .list-action {
    align-items: center;
    width: 100%;
    margin-top: 10px;
    padding-left: 0;
  }
  #component-modal-product-list.product-list-view .list-group-item {
    flex-direction: column;
  }
}

/* =====================================
   Product page configurator animations
   ===================================== */

/* Fade-and-slide appearance for auto-selected items */
.product-details-row.is-appearing {
  opacity: 0;
  transform: translateY(8px);
  animation: pccomp-fade-slide-in 420ms ease-out var(--appear-delay, 0ms)
    forwards;
}

@keyframes pccomp-fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brief glow highlight for a step just populated automatically */
[data-step].init-glow {
  position: relative;
  z-index: 0;
}
[data-step].init-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
  pointer-events: none;
  z-index: -1;
  animation: pccomp-step-glow 900ms ease-out;
}

@keyframes pccomp-step-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.55);
  }
  60% {
    box-shadow: 0 0 0 8px rgba(39, 174, 96, 0.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
  }
}

.product-page-configurator .alert {
  border-radius: var(--up-border-radius-large, 20px);
}

/* ======================================================================
   Product page native option blocks (unified with configurator styling)
   Scope: only within product page that hosts the configurator
   ====================================================================== */
.options {
  background-color: var(--up-bg-wd) !important;
  border: 1px solid var(--up-border-color) !important;
  border-radius: var(--up-border-radius-medium, 12px) !important;
  padding: 15px !important;
  margin-top: 15px !important;
}

.options .form-group {
  background-color: #f7f8fb !important;
  border: 1px solid #eaedf7 !important;
  border-radius: 12px !important;
  padding: 12px 15px !important;
  margin-bottom: 10px !important;
  transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.options .form-group:last-child {
  margin-bottom: 0 !important;
}

.options .control-label {
  display: block !important;
  margin: 0 0 8px 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #000 !important;
}

.options .form-control {
  background-color: #fff !important;
  color: #000 !important;
  border: 1px solid #eaedf7 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  height: 44px !important;
  line-height: 44px !important;
  padding: 0 12px !important;
  font-size: var(--font-size-base) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.options .form-control:focus {
  border-color: #00a5d4 !important;
  box-shadow: 0 0 0 2px rgba(0, 165, 212, 0.15) !important;
}

.options .form-control[disabled],
.options .form-control:disabled {
  background-color: #f7f8fb !important;
  color: #9aa3ad !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

/* Select enhancements */
.options select.form-control {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3e%3cpath fill='%238e98a3' d='M7 10l5 5 5-5z'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 18px 18px !important;
}

.options select.form-control:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3e%3cpath fill='%2300a5d4' d='M7 10l5 5 5-5z'/%3e%3c/svg%3e") !important;
}

/* Remove legacy Edge/IE default arrow */
.options select.form-control::-ms-expand {
  display: none !important;
}

/* Better text rendering in Firefox when focused */
.options select.form-control:-moz-focusring {
  color: transparent !important;
  text-shadow: 0 0 0 var(--up-text-wd-color) !important;
}

/* Active tweak */
.options select.form-control:active {
  border-color: var(--up-text-link) !important;
}

/* Placeholder-like state: when empty option is selected */
.options select.form-control:has(option[value=""]:checked) {
  color: var(--up-text-gray-color) !important;
}

/* Option list appearance (browser support varies) */
.options select.form-control option {
  background-color: #fff !important;
  color: #000 !important;
}
.options select.form-control option:disabled {
  color: #9aa3ad !important;
}
.options select.form-control optgroup {
  color: #9aa3ad !important;
  font-weight: 600 !important;
  background-color: #f7f8fb !important;
}

/* Multiple select support */
.options select.form-control[multiple],
.options select.form-control[size] {
  height: auto !important;
  min-height: 100px !important;
  line-height: 1.4 !important;
  padding: 8px 10px !important;
  background-image: none !important;
  overflow-y: auto !important;
}
.options select.form-control[multiple] option:checked,
.options select.form-control[size] option:checked {
  background-color: var(--up-text-link) !important;
  color: #fff !important;
}

/* Validation states if theme uses .has-* utility classes */
.options .form-group.has-error .form-control {
  border-color: var(--up-color-danger, #f44336) !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.1) !important;
}
.options .form-group.has-warning .form-control {
  border-color: var(--up-color-warning, #f0ad4e) !important;
  box-shadow: 0 0 0 2px rgba(240, 173, 78, 0.12) !important;
}
.options .form-group.has-success .form-control {
  border-color: var(--up-color-success, #4caf50) !important;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.12) !important;
}

/* Helper texts & validation */
.options .help-block,
.options .text-muted {
  margin-top: 6px !important;
  font-size: var(--font-size-sm) !important;
  color: var(--up-text-gray-color) !important;
}

.options .text-danger {
  margin-top: 6px !important;
  font-size: 13px !important;
  color: #e72121 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  position: static !important;
  border-radius: 0 !important;
}

/* Compact spacing on small screens */
@media (max-width: 768px) {
  .options {
    padding: 12px !important;
    margin-top: 12px !important;
  }
  .options .form-group {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
  }
  .options .form-control {
    height: 42px !important;
    line-height: 42px !important;
    font-size: var(--font-size-sm) !important;
  }
}

/* ======================================================================
   Customizable native <select> for all option blocks (Chrome 135+)
   Synced with global chameleon option select styling.
   ====================================================================== */
@media (hover: hover) and (pointer: fine) {
  @supports (appearance: base-select) {
    .options select.form-control,
    .options select.form-control::picker(select) {
      appearance: base-select !important;
    }

    .options select.form-control {
      background-image: none !important;
      padding-right: 40px !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 10px !important;
      background-color: #fcfcfc !important;
      border: 1px solid #e4e9ef !important;
      border-radius: 6px !important;
      color: #000 !important;
    }

    .options select.form-control::picker-icon {
      color: #8e98a3;
      transition: transform 0.2s ease, color 0.2s ease;
    }
    .options select.form-control:focus::picker-icon {
      color: #00a5d4;
    }
    .options select.form-control:open::picker-icon {
      transform: rotate(180deg);
    }

    .options select.form-control::picker(select) {
      background: #fff;
      color: #000;
      border: 1px solid #e4e9ef;
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(25, 35, 45, 0.12);
      padding: 6px;
      margin-top: 6px;
      min-width: anchor-size(width);
      max-height: 320px;
      overflow-y: auto;
      font-size: 14px;

      opacity: 1;
      translate: 0 0;
      transition: opacity 0.18s ease, translate 0.18s ease,
        display 0.18s allow-discrete;
    }
    @starting-style {
      .options select.form-control:open::picker(select) {
        opacity: 0;
        translate: 0 -4px;
      }
    }

    .options select.form-control option {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 8px;
      cursor: pointer;
      line-height: 1.3;
      color: #000 !important;
      background: transparent !important;
      transition: background-color 0.15s ease, color 0.15s ease;
    }
    .options select.form-control option:hover,
    .options select.form-control option:focus {
      background: #f4f7fb !important;
      outline: none;
    }
    .options select.form-control option:checked {
      background: rgba(0, 165, 212, 0.10) !important;
      color: #00a5d4 !important;
      font-weight: 600;
    }
    .options select.form-control option:disabled {
      color: #9aa3ad !important;
      cursor: not-allowed;
    }

    .options select.form-control option::checkmark {
      content: "\2713";
      color: #00a5d4;
      width: 16px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .options select.form-control option .opt-name {
      flex: 1 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .options select.form-control option .opt-price {
      margin-left: auto;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(0, 165, 212, 0.10);
      color: #00a5d4;
      font-size: 0.85em;
      font-weight: 600;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .options select.form-control option:checked .opt-price {
      background: #00a5d4;
      color: #fff;
    }

    .options select.form-control[multiple],
    .options select.form-control[size] {
      appearance: auto !important;
      display: block !important;
      padding-right: 12px !important;
      background-image: none !important;
    }
  }
}

/* === UX polish: focus accent and subtle background highlight === */
.options .form-group {
  position: relative !important;
  overflow: hidden !important;
}
.options .form-group::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  background: var(--up-text-link) !important;
  transition: width 0.22s ease !important;
}
.options .form-group:focus-within::before {
  width: 3px !important;
}
.options .form-group:focus-within {
  background-color: rgba(0, 165, 212, 0.04) !important;
}

/* === Caret micro-interaction: tint and nudge on focus === */
.options select.form-control:focus {
  background-position: right 8px center !important;
}

/* === Optional label icon example for "Радіатори" === */
.options label.control-label[for="input-option979"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.options label.control-label[for="input-option979"]::before {
  content: "" !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  background: center/contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v18'/%3E%3Cpath d='M10 3v18'/%3E%3Cpath d='M14 3v18'/%3E%3Cpath d='M18 3v18'/%3E%3C/svg%3E") !important;
}

/* === Complex Option-Quantity Tables Styling === */
.options .option-quantity {
  background-color: var(--up-bg-main) !important;
  border: none !important;
  border-radius: var(--up-border-radius-medium, 12px) !important;
  padding: 0 !important;
  margin-bottom: 0px !important;
  position: relative !important;
  overflow: hidden !important;
}

.options .option-quantity .table {
  margin-bottom: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.options .option-quantity .table-bordered {
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  background-color: transparent !important;
}

.options .option-quantity .table-bordered thead {
  background-color: transparent !important;
}

.options .option-quantity .table-bordered thead th,
.options .option-quantity .table-bordered thead td {
  border-bottom: 1px solid var(--up-border-color) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  font-weight: 600 !important;
  color: var(--up-text-wd-color) !important;
  padding: 10px 12px !important;
  font-size: var(--font-size-sm) !important;
  background-color: transparent !important;
}

.options .option-quantity .table-bordered thead td {
  padding-left: 0 !important;
}

.options .option-quantity .table-bordered tbody td {
  border-bottom: 1px solid var(--up-border-color) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  padding: 10px 12px !important;
  padding-left: 0 !important;
  vertical-align: middle !important;
  background-color: transparent !important;
}

.options .option-quantity .table-bordered tbody tr:last-child td {
  border-bottom: none !important;
}

.options .option-quantity .col-quantity {
  min-width: 120px !important;
  text-align: center !important;
  font-weight: 600 !important;
}

.options .option-quantity .text-center {
  text-align: center !important;
}

.options .option-quantity .text-center-flex {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Select within table cells */
.options .option-quantity select.form-control {
  background-color: var(--up-bg-wd) !important;
  color: var(--up-text-wd-color) !important;
  border: 1px solid var(--up-border-color) !important;
  border-radius: var(--up-border-radius-large, 20px);
  box-shadow: none !important;
  outline: none !important;
  height: 40px !important;
  line-height: 40px !important;
  padding: 0 12px !important;
  font-size: var(--font-size-sm) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.options .option-quantity select.form-control:focus {
  border-color: var(--up-text-link) !important;
  box-shadow: 0 0 0 2px rgba(0, 165, 212, 0.15) !important;
}

/* Custom arrow for table selects */
.options .option-quantity select.form-control {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3e%3cpath fill='%23999999' d='M7 10l5 5 5-5z'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 16px 16px !important;
}

.options .option-quantity select.form-control:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3e%3cpath fill='%2300a5d4' d='M7 10l5 5 5-5z'/%3e%3c/svg%3e") !important;
}

/* Customizable select for option-quantity tables (Chrome 135+).
   This block must stay below legacy appearance:none rules above. */
@media (hover: hover) and (pointer: fine) {
  @supports (appearance: base-select) {
    .options .option-quantity select.form-control,
    .options .option-quantity select.form-control::picker(select) {
      appearance: base-select !important;
    }

    .options .option-quantity select.form-control {
      background-image: none !important;
      padding-right: 40px !important;
      display: inline-flex !important;
      width: 100% !important;
      min-width: 0 !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 10px !important;
      overflow: hidden !important;
      white-space: nowrap !important;
      text-overflow: ellipsis !important;
    }

    .options .option-quantity select.form-control::picker-icon {
      color: #8e98a3;
      transition: transform 0.2s ease, color 0.2s ease;
    }
    .options .option-quantity select.form-control:focus::picker-icon {
      color: #00a5d4;
    }
    .options .option-quantity select.form-control:open::picker-icon {
      transform: rotate(180deg);
    }

    .options .option-quantity select.form-control::picker(select) {
      background: #fff;
      color: #000;
      border: 1px solid #e4e9ef;
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(25, 35, 45, 0.12);
      padding: 6px;
      margin-top: 6px;
      min-width: anchor-size(width);
      max-height: 320px;
      overflow-y: auto;
      font-size: 14px;
    }

    .options .option-quantity select.form-control option {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 8px;
    }
    .options .option-quantity select.form-control option .opt-name {
      flex: 1 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .options .option-quantity select.form-control option .opt-price {
      flex: 0 0 auto;
      margin-left: auto;
      white-space: nowrap;
      padding-left: 8px;
    }
  }
}

/* Quantity controls styling */
.options .owq-quantity {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 4px 8px !important;
  background-color: var(--up-bg-wd) !important;
  border: 1px solid var(--up-border-color) !important;
  border-radius: var(--up-border-radius-small, 8px) !important;
}

.options .owq-sub,
.options .owq-add {
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--up-bg-main) !important;
  border: 1px solid var(--up-border-color) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  color: var(--up-text-wd-color) !important;
  transition: all 0.2s ease !important;
  font-size: var(--font-size-base) !important;
}

.options .owq-sub:hover,
.options .owq-add:hover {
  background-color: var(--up-text-link) !important;
  color: #fff !important;
  transform: scale(1.1) !important;
}

.options .owq-input {
  width: 50px !important;
  text-align: center !important;
  height: 28px !important;
  font-size: var(--font-size-sm) !important;
  padding: 2px 4px !important;
  border: 1px solid var(--up-border-color) !important;
  border-radius: var(--up-border-radius-small, 8px) !important;
  background-color: var(--up-bg-wd) !important;
  color: var(--up-text-wd-color) !important;
  outline: none !important;
}

.options .owq-input:focus {
  border-color: var(--up-text-link) !important;
  box-shadow: 0 0 0 2px rgba(0, 165, 212, 0.15) !important;
}

/* Disabled quantity input styling */
.options .owq-input[disabled],
.options .owq-input:disabled {
  background-color: var(--up-bg-gray) !important;
  color: var(--up-text-gray-color) !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

/* Remove spin buttons for quantity inputs */
.options .owq-input::-webkit-outer-spin-button,
.options .owq-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
.options .owq-input[type="number"] {
  -moz-appearance: textfield !important;
  -webkit-appearance: none !important;
  appearance: textfield !important;
}

/* Mobile responsive for option-quantity tables */
@media (max-width: 768px) {
  .options .option-quantity .table-responsive {
    border-radius: var(--up-border-radius-medium, 12px) !important;
    overflow: hidden !important;
  }

  .options .option-quantity .table-bordered thead {
    display: none !important;
  }

  .options .option-quantity .table-bordered tbody tr {
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid var(--up-border-color) !important;
    border-radius: var(--up-border-radius-medium, 12px) !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
  }

  .options .option-quantity .table-bordered tbody td {
    border: none !important;
    padding: 8px 0 !important;
    position: relative !important;
    gap: 5px !important;
  }

  .options .option-quantity .table-bordered tbody td:first-child::before {
    content: "Компонент:" !important;
    font-weight: 600 !important;
    color: var(--up-text-wd-color) !important;
    display: block !important;
    margin-bottom: 5px !important;
  }

  .options .option-quantity .table-bordered tbody td:last-child::before {
    content: "Кількість:" !important;
    font-weight: 600 !important;
    color: var(--up-text-wd-color) !important;
    display: block !important;
    margin-bottom: 5px !important;
  }

  .options .option-quantity select.form-control {
    height: 42px !important;
    line-height: 42px !important;
    font-size: var(--font-size-sm) !important;
  }

  .options .owq-quantity {
    width: 100% !important;
    justify-content: center !important;
  }

  .options .owq-input {
    width: 60px !important;
  }
}

/* === PENDING FILTERS STYLES === */

/* Основной конфигуратор */
#modal-pending-filters-panel,
#component-pending-filters-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-small);
  box-shadow: var(--up-box-shadow-1px);
  z-index: 1051;
  min-width: 300px;
  max-width: 400px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  display: none;
}

#modal-pending-filters-panel.visible,
#component-pending-filters-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

#modal-pending-filters-panel .pending-filters-header,
#component-pending-filters-panel .pending-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--up-border-color);
  background: var(--up-bg-main);
  border-radius: var(--up-border-radius-small) var(--up-border-radius-small) 0 0;
}

#modal-pending-filters-panel .pending-filters-header h5,
#component-pending-filters-panel .pending-filters-header h5 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--up-text-wd-color);
}

#modal-pending-filters-panel .pending-filters-header .btn,
#component-pending-filters-panel .pending-filters-header .btn {
  padding: 5px;
  border: none;
  background: transparent;
  color: var(--up-text-light-color);
  font-size: 14px;
  line-height: 1;
}

#modal-pending-filters-panel .pending-filters-header .btn:hover,
#component-pending-filters-panel .pending-filters-header .btn:hover {
  color: var(--up-color-danger);
  background: rgba(255, 87, 87, 0.1);
}

#modal-pending-filters-panel .pending-filters-list,
#component-pending-filters-panel .pending-filters-list {
  padding: 15px 20px;
  max-height: 200px;
  overflow-y: auto;
}

#modal-pending-filters-panel .pending-filter-item,
#component-pending-filters-panel .pending-filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(234, 237, 247, 0.5);
}

#modal-pending-filters-panel .pending-filter-item:last-child,
#component-pending-filters-panel .pending-filter-item:last-child {
  border-bottom: none;
}

#modal-pending-filters-panel .pending-filter-item.new-filter,
#component-pending-filters-panel .pending-filter-item.new-filter {
  background: rgba(85, 183, 71, 0.05);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 2px 0;
}

#modal-pending-filters-panel .pending-filter-item.removed-filter,
#component-pending-filters-panel .pending-filter-item.removed-filter {
  background: rgba(255, 87, 87, 0.05);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 2px 0;
  opacity: 0.8;
}

#modal-pending-filters-panel .filter-label,
#component-pending-filters-panel .filter-label {
  font-weight: 600;
  color: var(--up-text-wd-color);
  font-size: var(--font-size-xs);
}

#modal-pending-filters-panel .filter-value,
#component-pending-filters-panel .filter-value {
  color: var(--up-text-color);
  font-size: var(--font-size-xs);
  text-align: right;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modal-pending-filters-panel .filter-status,
#component-pending-filters-panel .filter-status {
  font-size: 10px;
  color: var(--up-color-danger);
  font-style: italic;
  margin-left: 8px;
  font-weight: 500;
}

#modal-pending-filters-panel .pending-filters-actions,
#component-pending-filters-panel .pending-filters-actions {
  padding: 15px 20px;
  border-top: 1px solid var(--up-border-color);
  background: var(--up-bg-main);
  border-radius: 0 0 var(--up-border-radius-small) var(--up-border-radius-small);
  text-align: center;
}

#modal-pending-filters-panel .pending-filters-actions .btn,
#component-pending-filters-panel .pending-filters-actions .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  padding: 10px 15px;
}

#modal-pending-filters-panel .pending-filters-actions .btn svg,
#component-pending-filters-panel .pending-filters-actions .btn svg {
  width: 16px;
  height: 16px;
}

/* Product Component List (страница товара) */
#component-pending-filters-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1051;
  min-width: 300px;
  max-width: 400px;
}

/* Адаптивность */
@media (max-width: 1200px) {
  #modal-pending-filters-panel,
  #component-pending-filters-panel {
    min-width: 280px;
    max-width: 350px;
    right: 15px;
  }
}

@media (max-width: 992px) {
  #modal-pending-filters-panel,
  #component-pending-filters-panel {
    min-width: 250px;
    max-width: 300px;
    right: 10px;
    top: 15px;
  }

  #modal-pending-filters-panel .pending-filters-header,
  #component-pending-filters-panel .pending-filters-header {
    padding: 12px 15px;
  }

  #modal-pending-filters-panel .pending-filters-list,
  #component-pending-filters-panel .pending-filters-list {
    padding: 12px 15px;
  }

  #modal-pending-filters-panel .pending-filters-actions,
  #component-pending-filters-panel .pending-filters-actions {
    padding: 12px 15px;
  }
}

@media (max-width: 768px) {
  #modal-pending-filters-panel,
  #component-pending-filters-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    min-width: auto;
    z-index: 1052;
    border-radius: var(--up-border-radius-medium);
  }

  #modal-pending-filters-panel .pending-filters-list,
  #component-pending-filters-panel .pending-filters-list {
    max-height: 150px;
  }

  #modal-pending-filters-panel .pending-filter-item,
  #component-pending-filters-panel .pending-filter-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #modal-pending-filters-panel .filter-value,
  #component-pending-filters-panel .filter-value {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 480px) {
  #modal-pending-filters-panel,
  #component-pending-filters-panel {
    top: 5px;
    left: 5px;
    right: 5px;
    max-height: 80vh;
  }

  #modal-pending-filters-panel .pending-filters-list,
  #component-pending-filters-panel .pending-filters-list {
    max-height: 120px;
    padding: 10px;
  }

  #modal-pending-filters-panel .pending-filters-actions,
  #component-pending-filters-panel .pending-filters-actions {
    padding: 10px;
  }

  #modal-pending-filters-panel .pending-filters-actions .btn,
  #component-pending-filters-panel .pending-filters-actions .btn {
    padding: 8px 12px;
    font-size: var(--font-size-xs);
  }
}

/* Анимация появления */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#modal-pending-filters-panel.visible,
#component-pending-filters-panel.visible {
  animation: slideInFromTop 0.3s ease forwards;
}

/* === DISABLED FILTER OPTIONS STYLES === */
/* Для конфигуратора на странице товара */
#component-modal-filters-content .disabled-option {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}

/* Для основного конфигуратора */
#modal-filters-content .disabled-option {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}

#component-modal-filters-content .disabled-option label,
#modal-filters-content .disabled-option label {
  color: #999 !important;
  cursor: not-allowed;
}

#component-modal-filters-content .disabled-option input[type="checkbox"],
#modal-filters-content .disabled-option input[type="checkbox"] {
  cursor: not-allowed;
}

/* === CLEAR ALL FILTERS BUTTON STYLES === */
/* Filters header layout */
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--up-border-color);
}

.filters-header h5 {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--up-text-wd-color);
}

.filters-header .filter-clear-all-container {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.filters-header .filter-clear-all-container button {
  width: auto;
  background: transparent;
  border: 1px solid var(--up-color-danger);
  color: var(--up-color-danger);
  padding: 10px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  text-decoration: none;
}

.filters-header .filter-clear-all-container button:hover {
  background: rgba(255, 87, 87, 0.1);
  color: var(--up-color-danger);
  text-decoration: none;
}

/* Old filter clear all container styles for backward compatibility */
.filter-clear-all-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--up-border-color);
}

.filter-clear-all-container button {
  width: 100%;
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.filter-clear-all-container button:hover {
  background: #f8f9fa;
  border-color: #bbb;
  color: #333;
}

.filter-clear-all-container .svg-icon-wrapper {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

.product-page-configurator .add-more-components-btn {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

#product-modal .modal-content .svg-icon-wrapper,
#product-details-modal .modal-content .svg-icon-wrapper,
#component-selection-modal .modal-content .svg-icon-wrapper,
#component-product-details-modal .modal-content .svg-icon-wrapper {
  margin-right: 0;
}

.add-more-components-row {
  display: flex;
  justify-content: center;
}

.product-page-configurator #component-compatibility-notes {
  position: fixed;
  bottom: 5%;
  left: 10%;
  width: 35%;
  z-index: 1000;
  pointer-events: none;
}

/* --- Mobile layout for product details rows --- */
@media (max-width: 768px) {
  /* First row: image + name/link only */
  .product-details-row {
    flex-wrap: wrap;
    row-gap: 5px;
    column-gap: 10px;
    align-items: center;
    margin-bottom: 5px;
  }
  .product-details-image {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    text-align: left;
    order: 1;
  }
  .product-details-name {
    order: 2;
    flex: 0 0 calc(100% - 50px - 10px);
    min-width: 0;
    margin-bottom: 0;
  }

  /* Second row: qty/display + price + remove */
  .product-details-row .quantity-control,
  .product-details-row .quantity-display {
    order: 3;
    flex: 1 1 auto;
    min-width: 0;
  }
  .product-details-row .product-details-price {
    order: 4;
    flex: 0 1 auto;
    white-space: nowrap;
    text-align: left;
  }
  .product-details-row .remove-product-btn {
    order: 5;
    margin-left: auto;
  }
  .product-page-configurator #component-compatibility-notes {
    position: fixed;
    top: 10%;
    left: 0;
    right: 0;
    margin: auto;
    width: 95%;
    z-index: 1000;
    pointer-events: none;
    font-size: 13px;
    line-height: 18px;
  }
}

.btn-general:hover {
  background-color: none;
}

.btn[disabled] {
  background: rgba(244, 67, 54, 0.1) !important;
  background-color: rgba(244, 67, 54, 0.1) !important;
  border-color: rgba(244, 67, 54, 0.25) !important;
  color: var(--up-color-danger, #f44336) !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn[disabled] .icon-cart-add {
  background-color: inherit !important;
}

.cart .btn-warning {
  text-shadow: none !important;
}

/* === Storage Slots Visualization === */
.storage-slots-container {
  background: var(--up-bg-wd);
  border-radius: var(--up-border-radius-small);
  margin-top: 8px;
}

.storage-slots-placeholder {
  background: var(--up-bg-wd);
  border-radius: var(--up-border-radius-small);
  padding: 8px 0px;
  margin-top: 8px;
  color: var(--up-text-light-color);
  font-size: var(--font-size-xs);
  line-height: 16px;
  text-align: center;
}

.storage-slots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--up-border-color);
}

.storage-slots-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--up-text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-slots-title .svg-icon-wrapper {
  color: var(--up-text-link);
  display: none;
}

.storage-slots-summary {
  font-size: var(--font-size-xs);
  color: var(--up-text-light-color);
}

.storage-total-info {
  background: var(--up-bg-gray);
  padding: 4px 8px;
  border-radius: var(--up-border-radius-small);
  font-weight: 500;
}

.storage-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.storage-slot-group {
  background: var(--up-bg-gray);
  border: 1px solid var(--up-border-color);
  border-radius: var(--up-border-radius-small);
  padding: 8px;
  transition: all 0.2s ease;
}

.storage-slot-group:hover {
  border-color: var(--up-text-link);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 165, 212, 0.1);
}

.storage-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.storage-slot-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.storage-slot-svg-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
}

.svg-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
  vertical-align: middle;
}

.storage-slot-name {
  flex: 1;
  color: var(--up-text-color);
}

.storage-slot-count {
  background: var(--up-bg-wd);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--up-text-light-color);
  border: 1px solid var(--up-border-color);
}

.storage-slot-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 18px;
}

.storage-slot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--up-border-color);
  transition: all 0.2s ease;
  position: relative;
}

.storage-slot.used {
  background: var(--up-color-success);
  border-color: var(--up-color-success);
  box-shadow: 0 0 0 2px rgba(85, 183, 71, 0.2);
}

.storage-slot.used::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.storage-slot.available {
  background: var(--up-bg-wd);
  border-color: var(--up-border-color);
}

/* === M.2 Tip Styles === */
.storage-m2-tip {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(
    135deg,
    rgba(0, 165, 212, 0.05) 0%,
    rgba(0, 165, 212, 0.02) 100%
  );
  border: 1px solid rgba(0, 165, 212, 0.2);
  border-left: 4px solid var(--up-text-link, #00a5d4);
  border-radius: var(--up-border-radius-small);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.3s ease;
}

.storage-m2-tip:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 165, 212, 0.08) 0%,
    rgba(0, 165, 212, 0.04) 100%
  );
  border-color: var(--up-text-link, #00a5d4);
  box-shadow: 0 2px 8px rgba(0, 165, 212, 0.15);
  transform: translateY(-1px);
}

.storage-m2-tip.success {
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.05) 0%,
    rgba(76, 175, 80, 0.02) 100%
  );
  border-color: rgba(76, 175, 80, 0.2);
  border-left-color: var(--up-color-success, #4caf50);
}

.storage-m2-tip.success:hover {
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.08) 0%,
    rgba(76, 175, 80, 0.04) 100%
  );
  border-color: var(--up-color-success, #4caf50);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.storage-m2-tip-icon {
  display: none !important;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--up-text-link, #00a5d4);
  margin-top: 2px;
}

.storage-m2-tip.success .storage-m2-tip-icon {
  color: var(--up-color-success, #4caf50);
}

.storage-m2-tip-content {
  flex: 1;
}

.storage-m2-tip-content strong {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--up-text-wd-color, #000);
  margin-bottom: 4px;
}

.storage-m2-tip-content p {
  margin: 0;
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--up-text-color, #333);
}

.storage-m2-tip-button {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  line-height: 1.4;
  border-radius: var(--up-border-radius-small);
  transition: all 0.2s ease;
}

.storage-m2-tip-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.storage-m2-tip-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 165, 212, 0.3);
}

.storage-m2-tip-button:focus {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  line-height: 1.4;
  border-radius: var(--up-border-radius-small);
  transition: all 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .storage-m2-tip {
    padding: 10px 12px;
    gap: 10px;
  }

  .storage-m2-tip-icon {
    width: 20px;
    height: 20px;
  }

  .storage-m2-tip-content strong {
    font-size: var(--font-size-xs);
  }

  .storage-m2-tip-content p {
    font-size: 12px;
  }

  .storage-slots-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .storage-slots-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .storage-slot-visual {
    justify-content: center;
  }

  #modal-product-list-container {
    padding-left: 15px !important;
    padding-top: 0px !important;
  }

  #component-modal-product-list-container {
    padding-left: 15px !important;
  }
}

@media (max-width: 480px) {
  .storage-slots-container {
    padding: 12px;
    margin-top: 8px;
  }

  .storage-slot {
    width: 14px;
    height: 14px;
  }

  .storage-slot.used::after {
    font-size: 7px;
  }
}

.ram-slots-container {
  margin-top: 8px;
}
/* Animation for newly added drives */
.storage-slot.just-occupied {
  animation: slotOccupied 0.6s ease-out;
}

@keyframes slotOccupied {
  0% {
    transform: scale(1);
    background: var(--up-bg-wd);
    border-color: var(--up-border-color);
  }
  50% {
    transform: scale(1.2);
    background: var(--up-color-warning);
    border-color: var(--up-color-warning);
  }
  100% {
    transform: scale(1);
    background: var(--up-color-success);
    border-color: var(--up-color-success);
  }
}

/* === End: Storage Slots Visualization === */

#component-modal-filters-column {
  padding-left: 0px;
}

#modal-product-list-container {
  padding-left: 0px;
}

#modal-products-column {
  padding-right: 0px;
}

#component-modal-product-list-container {
  padding-left: 0px;
}

#component-modal-products-column {
  padding-right: 0px;
}

/* === Визуальный индикатор мощности блока питания === */
.power-supply-indicator {
  margin: 10px 0;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
  font-size: var(--font-size-base);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.power-supply-indicator.power-indicator-danger {
  border-color: #dc3545;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.2);
}

.power-supply-indicator.power-indicator-warning {
  border-color: #f0ad4e;
  background: linear-gradient(135deg, #fffbf0 0%, #fff5e6 100%);
  box-shadow: 0 4px 16px rgba(240, 173, 78, 0.2);
}

.power-supply-indicator.power-indicator-ok {
  border-color: #55b747;
  background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%);
  box-shadow: 0 4px 16px rgba(85, 183, 71, 0.15);
}

.power-indicator-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.power-supply-indicator.power-indicator-danger .power-indicator-header {
  border-bottom-color: #dc3545;
}

.power-supply-indicator.power-indicator-warning .power-indicator-header {
  border-bottom-color: #f0ad4e;
}

.power-supply-indicator.power-indicator-ok .power-indicator-header {
  border-bottom-color: #55b747;
}

.power-indicator-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #f8f9fa;
  flex-shrink: 0;
}

.power-supply-indicator.power-indicator-danger .power-indicator-icon {
  background: #ffe8e8;
  color: #dc3545;
}

.power-supply-indicator.power-indicator-warning .power-indicator-icon {
  background: #fff5e6;
  color: #f0ad4e;
}

.power-supply-indicator.power-indicator-ok .power-indicator-icon {
  background: #e8f5e9;
  color: #55b747;
}

.power-indicator-icon svg {
  width: 16px;
  height: 16px;
}

.power-indicator-title {
  flex: 1;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #333;
}

.power-indicator-body {
  margin-top: 8px;
}

.power-indicator-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.power-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.power-stat-label {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.power-stat-value {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: #333;
}

.power-stat-value.power-consumption {
  color: #495057;
}

.power-stat-value.power-available {
  color: #007bff;
}

.power-stat-value.power-percentage.power-indicator-danger {
  color: #dc3545;
}

.power-stat-value.power-percentage.power-indicator-warning {
  color: #f0ad4e;
}

.power-stat-value.power-percentage.power-indicator-ok {
  color: #55b747;
}

/* Progress Bar */
.power-bar-container {
  position: relative;
  width: 100%;
  height: 24px;
  background: #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.power-bar {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease, background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.power-bar.green {
  background: linear-gradient(90deg, #55b747 0%, #4da53f 100%);
}

.power-bar.yellow {
  background: linear-gradient(90deg, #f0ad4e 0%, #e89e3d 100%);
}

.power-bar.red {
  background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.power-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.power-warning-message {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff3cd;
  border-left: 3px solid #f0ad4e;
  border-radius: 6px;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: #856404;
}

.power-supply-indicator.power-indicator-danger .power-warning-message {
  background: #f8d7da;
  border-left-color: #dc3545;
  color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
  .power-indicator-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .power-stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .power-stat-label {
    font-size: 10px;
  }

  .power-stat-value {
    font-size: var(--font-size-base);
  }

  .power-indicator-title {
    font-size: var(--font-size-sm);
  }

  .power-supply-indicator {
    padding: 10px;
    margin: 8px 0;
  }
}

/* Блок отображения мощности на странице товара (когда включена категория БП) */
.power-display-block {
  margin-top: 12px;
  margin-bottom: 8px;
}
.power-display-block .power-block-placeholder .power-psu-hint {
  margin: 8px 0 0;
  font-size: 0.95em;
  color: #666;
}