/*
Theme Name: ship-parts
Theme URI: https://example.com/ship-parts
Author: Ship Parts
Description: Custom theme for ship parts catalog.
Version: 1.0.0
Text Domain: ship-parts
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1a1a1a;
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

.sp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.sp-hero {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
}

.sp-hero__inner {
  position: relative;
  overflow: hidden;
}

.sp-hero__track {
  position: relative;
  height: 500px;
}

.sp-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.sp-hero__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.sp-hero__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.sp-hero__image {
  position: absolute;
  inset: 0;
}

.sp-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sp-hero__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sp-hero__content .sp-container {
  text-align: left;
}

.sp-hero__content h2 {
  margin: 0 0 12px;
  font-size: 44px;
}

.sp-hero__content p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.5;
}

.sp-hero__btn {
  background: #ffffff;
  color: #232649;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-self: flex-start;
}

.sp-hero__progress {
  position: absolute;
  inset: auto 16px 16px 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.sp-hero__progress-btn {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.sp-hero__progress-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left;
}

.sp-hero__progress-btn.is-animating::after {
  animation: spHeroProgress 5s linear forwards;
}

@keyframes spHeroProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.sp-site-logo img {
  height: 100px;
  width: auto;
  display: block;
}

.sp-header {
  background: #ffffff;
  transition: box-shadow 0.2s ease;
}

.sp-header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 10px 24px rgba(35, 38, 73, 0.18);
}

.sp-contact-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(35, 38, 73, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 2000;
}

.sp-contact-popup__panel {
  width: min(860px, calc(100% - 32px));
  margin-top: 24px;
  background: #ffffff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(35, 38, 73, 0.2);
  transform: translateY(-40px);
  transition: transform 0.5s ease;
}

.sp-contact-popup.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sp-contact-popup.is-open .sp-contact-popup__panel {
  transform: translateY(0);
}

.sp-contact-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f8;
  color: #232649;
  font-size: 20px;
  cursor: pointer;
}

.sp-contact-popup__title {
  margin: 0 0 4px;
  color: #232649;
}

.sp-contact-popup__city {
  margin: 0;
  color: #666;
  font-size: 15px;
}

.sp-contact-popup__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
}

.sp-contact-popup__col--contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-contact-popup__col--requisites {
  border-left: 1px solid #e1e1e1;
  padding-left: 24px;
}

.sp-contact-popup__items {
  display: grid;
  gap: 10px;
}

.sp-contact-popup__items a {
  color: #232649;
  font-weight: 600;
}

.sp-contact-popup__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sp-contact-popup__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.sp-contact-popup__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sp-contact-popup__requisites-title {
  margin: 0 0 10px;
  font-size: 15px;
  color: #232649;
}

.sp-contact-popup__requisites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}

.sp-contact-popup__requisites-table th,
.sp-contact-popup__requisites-table td {
  padding: 6px 10px;
  border: 1px solid #e1e1e1;
  text-align: left;
}

.sp-contact-popup__requisites-table th {
  color: #666;
  font-weight: 600;
  white-space: nowrap;
}

.sp-contact-popup__requisites-table td {
  color: #1a1a1a;
}

.sp-contact-popup__panel {
  position: relative;
}

.sp-order-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(35, 38, 73, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 2000;
}

.sp-order-popup__panel {
  width: min(520px, calc(100% - 32px));
  margin-top: 24px;
  background: #ffffff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(35, 38, 73, 0.2);
  transform: translateY(-40px);
  transition: transform 0.5s ease;
  position: relative;
}

.sp-order-popup.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sp-order-popup.is-open .sp-order-popup__panel {
  transform: translateY(0);
}

.sp-order-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f8;
  color: #232649;
  font-size: 20px;
  cursor: pointer;
}

.sp-order-popup__title {
  margin: 0 0 12px;
  color: #232649;
}

.sp-order-popup__form {
  display: grid;
  gap: 10px;
}

.sp-order-popup__form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.sp-order-popup__form input {
  padding: 8px 10px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
}

.sp-order-popup__form button {
  padding: 10px 12px;
  border: none;
  background: #232649;
  color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
}

.sp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-header-contacts {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.sp-header-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #232649;
}

.sp-header-phone__icon {
  display: inline-flex;
  font-size: 18px;
  line-height: 1;
}

.sp-header-telegram,
.sp-header-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #232649;
}

.sp-header-telegram__icon,
.sp-header-email__icon {
  display: inline-flex;
  font-size: 16px;
  line-height: 1;
}

.sp-header-telegram__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sp-contact-popup__media {
  display: grid;
  justify-items: center;
}

.sp-contact-popup__media img {
  max-width: 180px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(35, 38, 73, 0.15);
}

.sp-site-logo,
.sp-site-title {
  padding: 12px 0;
}

.sp-main-nav__list {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-main-nav__list a {
  font-weight: 600;
}

.sp-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 8px;
  cursor: pointer;
}

.sp-burger span {
  width: 24px;
  height: 2px;
  background: #232649;
  display: block;
}


.sp-products-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
  padding-top: 64px;
}

.sp-filters {
  display: grid;
  gap: 16px;
}

.sp-filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-filter-tree {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-filter-item {
  display: grid;
  gap: 8px;
}

.sp-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-filter-toggle {
  border: 1px solid #c9c9c9;
  background: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sp-filter-toggle__icon {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.sp-filter-item.is-open > .sp-filter-row .sp-filter-toggle__icon {
  transform: rotate(90deg);
}

.sp-filter-children {
  display: none;
  padding-left: 14px;
}

.sp-filter-item.is-open > .sp-filter-children {
  display: grid;
  gap: 10px;
}

.sp-filter-btn {
  border: 1px solid #c9c9c9;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.sp-filter-btn.is-active {
  background: #232649;
  color: #ffffff;
  border-color: #232649;
}

.sp-search form {
  display: grid;
  gap: 8px;
}

.sp-search input[type="search"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
}

.sp-search button {
  padding: 8px 12px;
  border: none;
  background: #232649;
  color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
}

.sp-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
  justify-content: start;
}

.sp-products > .sp-product-card {
  width: 100%;
  max-width: 320px;
}

.sp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  grid-column: 1 / -1;
}

.sp-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #c9c9c9;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #232649;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sp-pagination__btn:hover:not(:disabled) {
  background: #232649;
  border-color: #232649;
  color: #ffffff;
}

.sp-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sp-pagination__btn--num {
  font-size: 15px;
  font-weight: 600;
}

.sp-pagination__btn--num.is-active {
  background: #232649;
  border-color: #232649;
  color: #ffffff;
  cursor: default;
}

.sp-pagination__ellipsis {
  color: #232649;
  font-weight: 600;
  padding: 0 4px;
  user-select: none;
}

.sp-product-card {
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.sp-product-card__image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #f3f4f8;
}

.sp-product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sp-product-card__title {
  font-weight: 600;
}

.sp-product-card__price {
  font-weight: 600;
  color: #232649;
  font-size: 20px;
}

.sp-product-card__stock {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
}

.sp-product-card__stock.is-in-stock {
  color: #1c7a3a;
}

.sp-product-card__stock.is-out-of-stock {
  color: #888;
}

.sp-product-hero {
  margin: 24px 0;
  padding: 24px;
  background: #f3f4f8;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
}

.sp-product-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
}

.sp-product-hero__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.sp-product-hero__media-placeholder {
  width: 100%;
  height: 260px;
  border-radius: 8px;
  background: #dfe3ee;
}

.sp-product-hero__title {
  margin: 0 0 12px;
  font-size: 32px;
  color: #232649;
}

.sp-product-hero__price {
  margin-bottom: 12px;
  font-size: 26px;
  font-weight: 600;
  color: #232649;
}

.sp-product-hero__excerpt {
  margin: 0 0 16px;
  color: #4a4a4a;
}

.sp-product-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 4px;
  background: #232649;
  color: #ffffff;
  font-weight: 600;
}

.sp-entry-content {
  margin: 24px 0 48px;
  color: #1a1a1a;
}

.sp-entry-content p {
  margin: 0 0 16px;
  line-height: 1.6;
}

.sp-entry-content h2,
.sp-entry-content h3,
.sp-entry-content h4 {
  margin: 24px 0 12px;
  color: #232649;
}

.sp-entry-content ul,
.sp-entry-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.sp-entry-content li {
  margin: 6px 0;
}

.sp-entry-content ul li::marker {
  color: #232649;
}

.sp-entry-content a {
  color: #232649;
  text-decoration: underline;
}

.sp-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  border: 1px solid #d9d9d9;
}

.sp-entry-content th,
.sp-entry-content td {
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  text-align: left;
}

.sp-entry-content thead th {
  background: #232649;
  color: #ffffff;
}

.sp-entry-content tbody tr:nth-child(even) {
  background: #f5f6fb;
}

.sp-related-products {
  margin: 32px 0 48px;
}

.sp-related-products__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.sp-related-products__title {
  margin: 0;
  color: #232649;
}

.sp-related-products__controls {
  display: flex;
  gap: 10px;
}

.sp-related-products__btn {
  border: 1px solid #c9c9c9;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: #232649;
  font-weight: 600;
}

.sp-related-products__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sp-related-products__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.sp-related-products__track::-webkit-scrollbar {
  height: 8px;
}

.sp-related-products__track::-webkit-scrollbar-thumb {
  background: rgba(35, 38, 73, 0.2);
  border-radius: 999px;
}

.sp-related-products__track .sp-product-card {
  scroll-snap-align: start;
}

.sp-product-single__price {
  font-size: 20px;
  font-weight: 600;
  color: #232649;
  margin-bottom: 12px;
}

.sp-product-hero__stock {
  margin-bottom: 12px;
  font-weight: 600;
}

.sp-product-hero__stock.is-in-stock {
  color: #1c7a3a;
}

.sp-product-hero__stock.is-out-of-stock {
  color: #1a1a1a;
}

.sp-footer {
  padding: 24px 0;
  background: #232649;
  color: #ffffff;
  text-align: center;
}

.sp-footer__line {
  margin: 6px 0;
}

.sp-footer a {
  color: #ffffff;
}

.sp-footer__sep {
  margin: 0 8px;
  opacity: 0.7;
}

.sp-request {
  padding: 40px 0;
  background: #f3f4f8;
}

.sp-request__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.sp-request__title {
  margin: 0;
}

.sp-request__form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
}

.sp-request__form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
}

.sp-request__form button {
  padding: 10px 14px;
  border: none;
  background: #232649;
  color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
}

.sp-request__message {
  margin: 8px 0 16px;
}

.sp-order-message {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
}

.sp-order-message--success {
  background: #e8f5ee;
  color: #1c7a3a;
}

.sp-order-message--error {
  background: #fdecec;
  color: #a11a1a;
}

.sp-request__message--success {
  color: #1c7a3a;
}

.sp-request__message--error {
  color: #a11a1a;
}

@media (max-width: 768px) {
  .sp-header__inner {
    flex-wrap: wrap;
  }

  .sp-burger {
    display: flex;
  }

  .sp-header-phone__label {
    display: none;
  }

  .sp-header-telegram__label,
  .sp-header-email__label {
    display: none;
  }

  .sp-main-nav {
    width: 100%;
    display: none;
  }

  .sp-main-nav.is-open {
    display: block;
  }

  .sp-main-nav__list {
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }

  .sp-request__inner {
    grid-template-columns: 1fr;
  }

  .sp-request__form {
    margin-left: 0;
  }

  .sp-products-layout {
    grid-template-columns: 1fr;
  }

  .sp-filters {
    width: 100%;
  }

  .sp-products {
    grid-template-columns: 1fr;
  }

  .sp-product-hero {
    padding: 18px;
  }

  .sp-product-hero__inner {
    grid-template-columns: 1fr;
  }

  .sp-product-hero__title {
    font-size: 26px;
  }

  .sp-hero__content h2 {
    font-size: 32px;
  }

  .sp-related-products__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sp-related-products__track {
    grid-auto-columns: calc((100% - 20px) / 2);
  }

  .sp-contact-popup__body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sp-contact-popup__col--requisites {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e1e1e1;
    padding-top: 16px;
  }

  .sp-contact-popup__requisites-table th {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .sp-related-products__track {
    grid-auto-columns: 100%;
  }
}

