/* ========================================
   CATALOG - Spare Parts
   Pixel-perfect match to Figma mockups
   ======================================== */

/* --- Search Bar --- */
.catalog-search {
  margin-bottom: 3.2rem;
}

.catalog-search-wrap {
  position: relative;
}

.catalog-search-input {
  width: 100%;
  height: 5.6rem;
  background: #fff;
  border: 1px solid #c9d8e0;
  border-radius: 4px;
  padding: 0 5.6rem 0 2rem;
  font-family: Open Sans, sans-serif;
  font-size: 1.6rem;
  line-height: 5.6rem;
  color: #36365b;
  box-sizing: border-box;
  transition: border-color .3s;
  border-color: #5AC5F2 !important;
}

.catalog-search-input::placeholder {
  color: #9aa5b1;
}

.catalog-search-input:focus {
  border-color: #2e2382;
  outline: none;
}

.catalog-search-icon {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  opacity: .5;
  transition: opacity .3s;
}

.catalog-search-icon:hover {
  opacity: 1;
}

/* --- Main Layout: Sidebar + Content --- */
.catalog-layout {
  display: flex;
  gap: 3.2rem;
  align-items: flex-start;
}

@media (max-width: 959px) {
  .catalog-layout {
    flex-direction: column;
  }
}

/* --- Sidebar --- */
.catalog-sidebar {
  width: 28rem;
  min-width: 28rem;
  flex-shrink: 0;
}

@media (max-width: 959px) {
  .catalog-sidebar {
    width: 100%;
    min-width: 100%;
  }
}

.catalog-manufacturer {
  margin-bottom: 0.8rem;
}

.catalog-manufacturer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2e2382;
  color: #fff;
  padding: 1.2rem 1.6rem;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-family: Open Sans, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 2.4rem;
  user-select: none;
  transition: background .3s;
}

.catalog-manufacturer-header:hover {
  background: #3a2f9e;
}

.catalog-manufacturer-header.collapsed {
  border-radius: 4px;
}

.catalog-manufacturer-chevron {
  width: 1.2rem;
  height: 1.2rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  transition: transform .3s;
  margin-top: -4px;
}

.catalog-manufacturer-header.collapsed .catalog-manufacturer-chevron {
  transform: rotate(-45deg);
  margin-top: 4px;
}

.catalog-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e1e1e1;
  border-top: none;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.catalog-categories.hidden {
  display: none;
}

.catalog-category-item {
  padding: 1rem 1.6rem;
  font-size: 1.5rem;
  line-height: 2.2rem;
  color: #36365b;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background .2s;
  position: relative;
}

.catalog-category-item:last-child {
  border-bottom: none;
}

.catalog-category-item:hover {
  background: #f5f7fa;
}

.catalog-category-item.active {
  background: #eef9fd;
  color: #2e2382;
  font-weight: 600;
  border-left: 3px solid #44c8f5;
  padding-left: calc(1.6rem - 3px);
}

/* Other manufacturers */
.catalog-manufacturer-inactive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.6rem;
  font-size: 1.5rem;
  line-height: 2.2rem;
  color: #36365b;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: background .2s;
}

.catalog-manufacturer-inactive:hover {
  background: #f5f7fa;
}

.catalog-manufacturer-inactive-arrow {
  font-size: 1.8rem;
  color: #9aa5b1;
}

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

.catalog-main-title {
  font-family: Raleway, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.3;
  color: #36365b;
  margin: 0 0 2.4rem;
}

@media (min-width: 960px) {
  .catalog-main-title {
    font-size: 3.6rem;
  }
}

/* =============================================
   SPLIT PANEL: Article list (left) + Detail (right)
   ============================================= */
.catalog-panel {
  display: flex !important;
  border: 1px solid #e1e1e1;
  border-radius: 0 0 4px 4px;
  overflow: visible;
  margin-bottom: 2.4rem;
  min-height: 40rem !important;
  height: auto;
}

@media (max-width: 959px) {
  .catalog-panel {
    flex-direction: column;
    min-height: auto !important;
  }
}

/* --- Panel Header (Артикул | Наименование) --- */
.catalog-panel-header {
  display: flex !important;
  background: #2e2382;
  color: #fff;
  font-family: Open Sans, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2.4rem;
  border-radius: 4px 4px 0 0;
}

.catalog-panel-header-left {
  width: 16rem;
  min-width: 16rem;
  padding: 1rem 1.6rem;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.catalog-panel-header-right {
  flex: 1;
  padding: 1rem 1.6rem;
}

@media (max-width: 959px) {
  .catalog-panel-header-left {
    width: 40%;
    min-width: auto;
  }
}

/* --- Panel Body --- */
.catalog-panel-body {
  display: flex;
  flex: 1;
}

@media (max-width: 959px) {
  .catalog-panel-body {
    flex-direction: column;
  }
}

/* --- Article List (left column) --- */
.catalog-articles {
  width: 16rem;
  min-width: 16rem;
  border-right: 1px solid #e1e1e1;
  overflow-y: auto;
  max-height: 60rem;
  min-height: 40rem;
}

@media (max-width: 959px) {
  .catalog-articles {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #e1e1e1;
    max-height: 20rem;
  }
}

.catalog-article-item {
  display: block !important;
  padding: 0.8rem 1.6rem;
  font-size: 1.5rem;
  line-height: 2.2rem;
  color: #36365b;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s, color .15s;
  visibility: visible !important;
  opacity: 1 !important;
}

.catalog-article-item:last-child {
  border-bottom: none;
}

.catalog-article-item:hover {
  background: #f5f7fa;
}

.catalog-article-item.active {
  background: #44c8f5;
  color: #fff;
}

/* --- Detail Panel (right column) --- */
.catalog-detail {
  flex: 1;
  padding: 2rem 2.4rem;
  overflow-y: auto;
  max-height: 60rem;
}

@media (max-width: 959px) {
  .catalog-detail {
    max-height: none;
    padding: 2rem 1.6rem;
  }
}

.catalog-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 20rem;
  color: #9aa5b1;
  font-size: 1.6rem;
}

.catalog-detail-article {
  font-size: 1.5rem;
  line-height: 2.2rem;
  color: #9aa5b1;
  margin-bottom: 0.4rem;
}

.catalog-detail-title {
  font-family: Raleway, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.35;
  color: #36365b;
  margin: 0 0 2rem;
}

@media (min-width: 960px) {
  .catalog-detail-title {
    font-size: 2.8rem;
  }
}

.catalog-detail-images {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.catalog-detail-image {
  width: calc(33.333% - 0.8rem);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: #f0f0f0;
}

.catalog-detail-images[data-count="2"] .catalog-detail-image {
  width: calc(50% - 0.6rem);
}

.catalog-detail-images[data-count="1"] .catalog-detail-image {
  width: 60%;
}

.catalog-detail-image-hidden {
  display: none !important;
}

.catalog-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: #f0f4f8;
  border-radius: 4px;
  padding: 3.2rem 2rem;
  min-height: 18rem;
  width: 100%;
}

.catalog-detail-placeholder span {
  font-size: 1.5rem;
  color: #9aa5b1;
  font-weight: 600;
}

.catalog-detail-images:empty {
  display: none;
}

.catalog-detail-description {
  font-size: 1.5rem;
  line-height: 2.4rem;
  color: #36365b;
  margin-bottom: 2rem;
}

.catalog-detail-description p {
  margin-bottom: 1.2rem;
}

.catalog-detail-description p:last-child {
  margin-bottom: 0;
}

/* --- Action buttons row --- */
.catalog-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.catalog-btn {
  height: 4.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 2rem;
  border-radius: 4px;
  font-family: Open Sans, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 4.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: all .3s;
  white-space: nowrap;
  box-sizing: border-box;
  text-transform: none;
}

.catalog-btn-primary {
  background: #2e2382;
  color: #fff;
  border: 2px solid #2e2382;
}

.catalog-btn-primary:hover {
  background: #3a2f9e;
  border-color: #3a2f9e;
}

.catalog-btn-outline {
  background: transparent;
  color: #36365b;
  border: 2px solid #36365b;
}

.catalog-btn-outline:hover {
  background: #f5f7fa;
}

.catalog-btn-submit {
  background: #44c8f5;
  color: #fff;
  border: 2px solid #44c8f5;
}

.catalog-btn-submit:hover {
  background: #5ac5f2;
  border-color: #5ac5f2;
}

/* --- Order Section --- */
.catalog-order {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  padding: 2.4rem;
}

.catalog-order-title {
  font-family: Raleway, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.35;
  color: #36365b;
  margin: 0 0 2rem;
}

.catalog-order-items {
  margin-bottom: 2rem;
}

.catalog-order-item {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.catalog-order-item:last-child {
  border-bottom: none;
}

.catalog-order-item-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #36365b;
  min-width: 2.4rem;
}

.catalog-order-item-info {
  flex: 1;
  min-width: 0;
}

.catalog-order-item-name {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2.2rem;
  color: #36365b;
}

.catalog-order-item-article {
  font-size: 1.3rem;
  line-height: 1.8rem;
  color: #9aa5b1;
}

.catalog-order-item-qty {
  display: flex;
  align-items: center;
}

.catalog-order-qty-btn {
  width: 3.6rem;
  height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #c9d8e0;
  color: #36365b;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background .2s;
  padding: 0;
  line-height: 1;
  text-transform: none;
}

.catalog-order-qty-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.catalog-order-qty-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.catalog-order-qty-btn:hover {
  background: #f5f7fa;
}

.catalog-order-qty-input {
  width: 5rem;
  height: 3.6rem;
  text-align: center;
  border: 1px solid #c9d8e0;
  border-left: none;
  border-right: none;
  border-radius: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #36365b;
  padding: 0;
  line-height: 3.6rem;
  background: #fff;
  -moz-appearance: textfield;
}

.catalog-order-qty-input::-webkit-outer-spin-button,
.catalog-order-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.catalog-order-item-remove {
  width: 3.2rem;
  height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #c9d8e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  padding: 0;
  color: #9aa5b1;
  font-size: 1.4rem;
  text-transform: none;
}

.catalog-order-item-remove:hover {
  background: #fee;
  border-color: #e55;
  color: #e55;
}

.catalog-order-form {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

@media (max-width: 599px) {
  .catalog-order-form {
    flex-direction: column;
    align-items: stretch;
  }
}

.catalog-order-email {
  flex: 1;
  height: 4.4rem;
  border: 1px solid #c9d8e0;
  border-radius: 4px;
  padding: 0 1.6rem;
  font-family: Open Sans, sans-serif;
  font-size: 1.5rem;
  line-height: 4.4rem;
  color: #36365b;
  background: #fff;
  box-sizing: border-box;
}

.catalog-order-email::placeholder {
  color: #9aa5b1;
}

.catalog-order-email:focus {
  border-color: #2e2382;
  outline: none;
}

.catalog-order-empty {
  font-size: 1.5rem;
  color: #9aa5b1;
  text-align: center;
  padding: 2rem;
}

/* --- Success Modal --- */
.catalog-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(46, 35, 130, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.catalog-modal-overlay.visible {
  display: flex;
}

.catalog-modal {
  background: #fff;
  border-radius: 4px;
  padding: 3.2rem;
  max-width: 56rem;
  width: 90%;
  position: relative;
  box-shadow: 0 2px 10px rgba(46, 35, 130, 0.5);
}

.catalog-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 3.2rem;
  height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .5;
  transition: opacity .3s;
  background: none;
  border: none;
  font-size: 2rem;
  color: #36365b;
  padding: 0;
}

.catalog-modal-close:hover {
  opacity: 1;
}

.catalog-modal-title {
  font-family: Raleway, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.35;
  color: #36365b;
  margin: 0 0 1.6rem;
}

.catalog-modal-text {
  font-size: 1.6rem;
  line-height: 2.6rem;
  color: #36365b;
  margin-bottom: 2.4rem;
}

.catalog-modal-text a {
  color: #44c8f5;
  text-decoration: underline;
}

.catalog-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  height: 4.8rem;
  padding: 0 3.2rem;
  background: #2e2382;
  color: #fff;
  border: 2px solid #2e2382;
  border-radius: 4px;
  font-family: Open Sans, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
  text-transform: none;
}

.catalog-modal-btn:hover {
  background: #3a2f9e;
  border-color: #3a2f9e;
}

/* --- Responsive --- */
@media (max-width: 959px) {
  .catalog-order-item {
    flex-wrap: wrap;
  }

  .catalog-order-item-info {
    width: 100%;
    flex: none;
  }

  .catalog-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-detail-actions .catalog-btn {
    text-align: center;
  }
}
