body {
  font-family: "Manrope", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Error pages */
.error-page {
  max-width: 32rem;
  margin: 0 auto;
}

.error-page-code {
  font-size: clamp(4rem, 15vw, 6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--bs-primary);
  opacity: 0.85;
}

.error-page-lead {
  max-width: 26rem;
}

.navbar-brand-logo {
  display: block;
  height: 1.5rem;
  width: auto;
  flex-shrink: 0;
}

.navbar-brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.catalog-export-excel-icon {
  width: 1.125rem;
  height: 1.125rem;
  vertical-align: -0.2em;
}

.product-thumb {
  height: 200px;
  object-fit: cover;
}

.product-thumb-sm {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.product-detail-img {
  max-height: 480px;
  object-fit: contain;
  background: #f8f9fa;
}

.placeholder-img {
  height: 400px;
  background: #e9ecef;
}

.product-card .card-title {
  min-height: 2.5rem;
}

.product-description {
  line-height: 1.6;
}

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

form .form-control,
form .form-select {
  width: 100%;
}

/* Catalog toolbar */
.catalog-toolbar .btn-group .btn.active {
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
  color: #fff;
}

/* List view */
.catalog-view-list .catalog-grid-view {
  display: none;
}

.catalog-view-grid .catalog-list-view {
  display: none;
}

.product-list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 20px;
  border-bottom: 1px solid var(--bs-border-color);
  transition: background-color 0.15s ease;
}

.product-list-row:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.product-list-row-img {
  flex-shrink: 0;
}

.product-list-row-info {
  min-width: 0;
}

.product-list-row-price {
  flex-shrink: 0;
  min-width: 140px;
}

/* Cart stepper */
.cart-stepper .input-group-text {
  min-width: 2.5rem;
  justify-content: center;
  font-weight: 600;
}

.cart-stepper .cart-stepper-qty-input {
  max-width: 4.5rem;
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}

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

.product-grid-item .cart-stepper {
  max-width: 140px;
}

.product-thumb-sm.placeholder-img {
  height: 64px;
  width: 64px;
}

/* Product cards in grid */
.product-card {
  transition: box-shadow 0.15s ease;
}

.product-card:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

/* Mobile cart FAB */
.cart-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-fab:hover {
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.3);
}

.cart-fab .bi-cart3 {
  font-size: 1.5rem;
}

.cart-fab .cart-count-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(25%, -25%);
  min-width: 1.25rem;
  font-size: 0.7rem;
}

@media (max-width: 991.98px) {
  .product-list-row {
    padding: 1rem 5px;
  }

  main.has-cart-fab {
    padding-bottom: 5.5rem;
  }
}

.filter-in-stock-check .form-check-label {
  white-space: nowrap;
}

.catalog-sort-form {
  width: 100%;
  max-width: 280px;
}

.catalog-sort-form .form-select {
  width: 100%;
}

.quick-view-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1060;
}

.quick-view-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(640px, 92vw);
  height: 100vh;
  background: #fff;
  z-index: 1061;
  box-shadow: -0.25rem 0 1rem rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.quick-view-panel.is-open {
  transform: translateX(0);
}

.quick-view-body {
  overflow-y: auto;
}

.quick-view-image {
  max-height: 280px;
  object-fit: contain;
  background: #f8f9fa;
}

.quick-view-description {
  max-height: 180px;
  overflow: auto;
}

body.quick-view-open {
  overflow: hidden;
}

/* Cart page */
.cart-items {
  border-top: 1px solid var(--bs-border-color);
}

.cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.cart-item-media {
  flex-shrink: 0;
}

.cart-item-body {
  flex: 1;
  min-width: 0;
}

.cart-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cart-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.cart-item-qty {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.cart-item-qty .form-control {
  width: 5rem;
}

.cart-item-total {
  margin-left: auto;
  white-space: nowrap;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.cart-summary-total {
  font-size: 1.25rem;
}

@media (max-width: 991.98px) {
  .cart-item-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-item-price {
    order: 1;
  }

  .cart-item-qty {
    order: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cart-item-qty .form-control {
    width: 5.5rem;
  }

  .cart-item-total {
    order: 3;
    margin-left: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--bs-border-color);
  }

  .cart-item-total::before {
    content: "Сумма";
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
  }
}

@media (min-width: 992px) {
  .cart-item-meta {
    flex-wrap: nowrap;
  }

  .cart-item-price {
    min-width: 7rem;
  }

  .cart-item-total {
    min-width: 6rem;
    text-align: right;
  }
}
