/* Interactive components for v2 site: catalog menu, search, cart panel, breadcrumbs helpers */

.v2-breadcrumbs {
  padding: 20px 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.v2-breadcrumbs a { color: var(--color-text-muted); }
.v2-breadcrumbs a:hover { color: var(--color-accent); }

.v2-page-head {
  padding: 32px 0 16px;
}

.v2-page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.v2-page-head p {
  margin: 0;
  color: var(--color-text-muted);
}

.v2-content-page {
  padding: 16px 0 64px;
}

.v2-content {
  max-width: 820px;
  line-height: 1.7;
}

.v2-content--product {
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v2-content--product table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.v2-content--product table[width],
.v2-content--product td[width],
.v2-content--product th[width] {
  width: auto !important;
  max-width: none;
}

.v2-content--product td,
.v2-content--product th {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
}

.v2-content-page .v2-content {
  max-width: none;
}

.v2-empty {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
}

/* Catalog mega menu */
.v2-catalog-menu {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 24px;
}

.v2-catalog-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.v2-catalog-menu__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 140px);
  overflow: auto;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.v2-catalog-menu__col h3 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
}

.v2-catalog-menu__col h3 a {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.v2-catalog-menu__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.v2-catalog-menu__col ul li {
  margin-bottom: 4px;
}

.v2-catalog-menu__col ul a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.v2-catalog-menu__col ul a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.v2-menu-icon {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
}

.v2-menu-icon--lg {
  width: 48px;
  height: 48px;
}

.v2-menu-icon--sm {
  width: 40px;
  height: 40px;
}

.v2-menu-icon--placeholder {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.35);
}

/* Search modal */
.v2-search-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px;
}

.v2-search-modal__backdrop,
.v2-cart-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.v2-search-modal__box {
  position: relative;
  width: min(640px, 100%);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.v2-search-modal__head,
.v2-cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.v2-search-modal__head h2,
.v2-cart-panel__head h2 {
  margin: 0;
  font-size: 22px;
}

.v2-search-modal__head button,
.v2-cart-panel__head button {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v2-search-modal__form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.v2-search-modal__form input,
.v2-search-modal__form select,
.v2-checkout-form input,
.v2-checkout-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
}

.v2-search-results {
  margin-top: 16px;
  max-height: 360px;
  overflow: auto;
}

.v2-search-result {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  color: inherit;
}

.v2-search-result:hover {
  color: var(--color-accent);
}

.v2-search-result img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Cart panel */
.v2-cart-panel {
  position: fixed;
  inset: 0;
  z-index: 255;
}

.v2-cart-panel__drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.v2-cart-panel__body {
  flex: 1;
  overflow: auto;
  padding: 0 20px;
}

.v2-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.v2-cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.v2-cart-item__title {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 14px;
}

.v2-cart-item__price {
  color: var(--color-accent);
  font-weight: 700;
}

.v2-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.v2-cart-item__qty button {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.v2-cart-panel__foot {
  padding: 20px;
  border-top: 1px solid var(--color-border);
}

.v2-cart-panel__total {
  margin-bottom: 12px;
  font-size: 18px;
}

.v2-btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

.v2-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.v2-cart-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Catalog page */
.v2-catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.v2-filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-size: 14px;
}

.v2-filter-chip:hover {
  background: var(--color-accent);
  color: #fff;
}

.v2-catalog-page {
  padding: 0 0 64px;
}

/* Product page */
.v2-product-page {
  padding: 16px 0 64px;
}

.v2-product-page__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.v2-product-gallery__main {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.v2-product-gallery__main img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin: 0 auto;
}

.v2-product-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.v2-product-gallery__thumb {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.v2-product-gallery__thumb.active {
  border-color: var(--color-accent);
}

.v2-product-gallery__thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.v2-product__price--lg {
  font-size: 28px;
  margin: 16px 0;
}

.v2-product-page__desc h2 {
  margin-top: 32px;
}

.v2-product-page__desc {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v2-attrs-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.v2-attrs-table th,
.v2-attrs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.v2-attrs-table th {
  width: 40%;
  color: var(--color-text-muted);
}

/* Cart / checkout pages */
.v2-cart-page,
.v2-checkout-page {
  padding: 0 0 64px;
}

.v2-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.v2-cart-table th,
.v2-cart-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.v2-cart-summary {
  margin-top: 24px;
  max-width: 360px;
  margin-left: auto;
}

.v2-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.v2-checkout-form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}

.v2-checkout-order {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.v2-checkout-order ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.v2-checkout-order li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.v2-article-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.v2-blog--page {
  padding-bottom: 64px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .v2-catalog-menu {
    padding: 100px 12px 16px;
  }

  .v2-catalog-menu__panel {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 20px;
  }

  .v2-search-modal__form {
    grid-template-columns: 1fr;
  }

  .v2-product-page__grid,
  .v2-checkout-grid {
    grid-template-columns: 1fr;
  }

  .v2-cart-table thead {
    display: none;
  }

  .v2-cart-table tbody tr {
    display: block;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .v2-cart-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border: none;
    text-align: right;
  }

  .v2-cart-table tbody td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    text-align: left;
  }

  .v2-cart-table tbody td:first-child {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4px;
  }

  .v2-cart-table tbody td:first-child::before,
  .v2-cart-table tbody td:last-child::before {
    display: none;
  }

  .v2-cart-table tbody td:last-child {
    justify-content: center;
    padding-top: 12px;
  }

  .v2-cart-table tbody td button {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    font: inherit;
  }

  .v2-cart-table tbody td input[type="number"] {
    min-height: 44px;
    min-width: 72px;
    font-size: 16px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
  }

  .v2-cart-summary {
    max-width: none;
    margin-left: 0;
    padding-bottom: max(80px, calc(56px + env(safe-area-inset-bottom, 0px) + 24px));
  }

  .v2-cart-page,
  .v2-checkout-page {
    padding-bottom: max(96px, calc(56px + env(safe-area-inset-bottom, 0px) + 32px));
  }
}

/* B2B services layout */
.v2-services-preview {
  padding: 64px 0;
}

.v2-services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.v2-service-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.v2-service-card__img,
.v2-service-card__icon {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: block;
}

.v2-service-card__icon {
  object-fit: contain;
  background: #fff;
  padding: 12px;
  height: 96px;
}

.v2-service-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.v2-service-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.v2-service-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.v2-service-links li {
  margin-bottom: 8px;
}

.v2-service-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.v2-img-placeholder {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-border) 100%);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}

.v2-service-hero {
  padding: 0 0 24px;
}

.v2-service-hero__img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.v2-service-hero .v2-img-placeholder {
  width: 100%;
  min-height: 240px;
  max-height: 420px;
}

.v2-service-page img.v2-service-hero__img,
.v2-service-page img.v2-service-gallery__img {
  cursor: pointer;
}

.v2-service-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.v2-service-gallery__cell {
  margin: 0;
}

.v2-service-gallery__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.v2-service-gallery .v2-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* Service photo lightbox */
.v2-lightbox {
  position: fixed;
  inset: 0;
  z-index: 270;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-lightbox[hidden] {
  display: none !important;
}

.v2-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  cursor: pointer;
}

.v2-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(100vw - 24px, 1200px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 56px 24px;
  box-sizing: border-box;
  pointer-events: none;
}

.v2-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  pointer-events: none;
  user-select: none;
}

.v2-lightbox__caption {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  text-align: center;
  max-width: 100%;
  pointer-events: none;
}

.v2-lightbox__close,
.v2-lightbox__prev,
.v2-lightbox__next {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: background var(--transition);
}

.v2-lightbox__close:hover,
.v2-lightbox__prev:hover,
.v2-lightbox__next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.v2-lightbox__close {
  top: 8px;
  right: 8px;
  font-size: 20px;
}

.v2-lightbox__prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.v2-lightbox__next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 640px) {
  .v2-lightbox__panel {
    padding: 48px 12px 16px;
  }

  .v2-lightbox__prev {
    left: 4px;
  }

  .v2-lightbox__next {
    right: 4px;
  }

  .v2-lightbox__img {
    max-height: calc(100vh - 120px);
  }
}

.v2-hero__bg--placeholder {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
}

.v2-service-page .v2-content h2:first-child {
  margin-top: 0;
}

.v2-service-layout {
  padding: 0 0 48px;
}

.v2-service-layout__grid {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.v2-service-layout__main {
  min-width: 0;
}

.v2-service-page__body {
  padding-top: 8px;
}

.v2-service-sidebar {
  min-width: 0;
}

.v2-service-sidebar__summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  padding: 12px 16px;
  margin: 0 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-heading);
}

.v2-service-sidebar__summary::-webkit-details-marker {
  display: none;
}

.v2-service-sidebar__summary::after {
  content: "▼";
  float: right;
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

.v2-service-sidebar__details[open] .v2-service-sidebar__summary::after {
  transform: rotate(180deg);
}

.v2-service-sidebar__nav {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
}

.v2-service-sidebar__nav--desk {
  display: none;
}

.v2-service-sidebar__group + .v2-service-sidebar__group {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.v2-service-sidebar__hub,
.v2-service-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-heading);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  min-height: 44px;
  transition: background var(--transition), color var(--transition);
}

.v2-service-sidebar__hub {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.v2-service-sidebar__hub:hover,
.v2-service-sidebar__link:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--color-accent);
}

.v2-service-sidebar__hub.is-active,
.v2-service-sidebar__link.is-active {
  background: rgba(196, 30, 58, 0.08);
  color: var(--color-accent);
  font-weight: 600;
}

.v2-service-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}

.v2-service-sidebar__list li {
  margin: 2px 0;
}

.v2-service-sidebar__link {
  font-weight: 500;
  color: var(--color-text-muted);
}

.v2-service-sidebar__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
}

.v2-service-sidebar__icon--lg {
  width: 36px;
  height: 36px;
}

.v2-service-sidebar__icon--placeholder {
  display: inline-block;
  background: var(--color-border);
  border: 1px dashed rgba(15, 23, 42, 0.15);
}

@media (min-width: 901px) {
  .v2-service-sidebar {
    position: sticky;
    top: 168px;
    align-self: start;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }

  .v2-service-sidebar__details {
    display: none;
  }

  .v2-service-sidebar__nav--desk {
    display: block;
  }
}

@media (max-width: 900px) {
  .v2-service-layout__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .v2-service-sidebar__nav--desk {
    display: none;
  }

  .v2-service-sidebar__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .v2-service-sidebar__details:not([open]) .v2-service-sidebar__nav--mob {
    display: none;
  }
}

.v2-faq h2 {
  margin-top: 28px;
  font-size: 20px;
}

.v2-faq h2:first-child {
  margin-top: 0;
}

.v2-search-modal__form--single {
  grid-template-columns: 1fr;
}

.v2-search-result--text {
  padding: 14px 0;
}

.v2-search-hit {
  border-bottom: 1px solid var(--color-border);
  padding: 8px 0 12px;
}

.v2-search-hit__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  min-height: 44px;
}

.v2-search-hit__title {
  font-weight: 700;
  color: var(--color-heading);
}

.v2-search-hit__chevron {
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

.v2-search-hit__toggle.is-open .v2-search-hit__chevron {
  transform: rotate(180deg);
}

.v2-search-hit__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.55;
  padding: 0 0 8px;
}

.v2-search-hit__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}

.v2-checkout-grid--single {
  grid-template-columns: 1fr;
  max-width: 640px;
}

.v2-pillars__grid {
  grid-template-columns: repeat(2, 1fr);
}

.v2-pillar-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--color-heading);
}

@media (max-width: 640px) {
  .v2-services__grid,
  .v2-pillars__grid,
  .v2-service-gallery {
    grid-template-columns: 1fr;
  }

  .v2-service-cta .v2-btn {
    flex: 1 1 100%;
    text-align: center;
  }
}
