/* Shared header and catalog behavior for every Kubota page. */
.catalog-card-photo img {
  object-fit: cover !important;
  padding: 0 !important;
}

.gallery-main[data-gallery-main] {
  cursor: zoom-in;
}

.gallery-main img {
  object-fit: cover !important;
}

.component-image.has-component-photo {
  overflow: hidden;
  padding: clamp(18px, 4vw, 34px);
}

.component-image.has-component-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 20px 32px rgba(26, 22, 18, 0.16));
}

.catalog-card[hidden],
#catalogShowAll[hidden] {
  display: none !important;
}

.header .container {
  max-width: 1440px;
  padding-left: 24px;
  padding-right: 24px;
}

.header-row {
  position: relative;
  flex-wrap: nowrap;
  gap: 20px;
}

.header .brand,
.header-phone {
  flex: 0 0 auto;
}

.header .nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.header .nav a,
.header-phone {
  white-space: nowrap;
}

.header-menu-toggle {
  display: none;
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink, #1a1612);
  background: transparent;
  cursor: pointer;
}

.header-menu-toggle span {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 200ms ease, opacity 200ms ease, top 200ms ease;
}

.header-menu-toggle span:nth-child(1) { top: 13px; }
.header-menu-toggle span:nth-child(2) { top: 21px; }
.header-menu-toggle span:nth-child(3) { top: 29px; }

.header-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.header-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

@media (max-width: 1180px) {
  .header-row {
    height: 68px;
    min-height: 68px;
  }

  .header .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: -24px;
    right: -24px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(245, 241, 232, 0.98);
    border-top: 1px solid var(--line, #dcd4c0);
    border-bottom: 1px solid var(--line, #dcd4c0);
    box-shadow: 0 16px 32px rgba(26, 22, 18, 0.12);
  }

  .header.is-menu-open .nav {
    display: flex !important;
  }

  .header .nav a {
    display: block;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line, #dcd4c0);
    font-size: 14px;
  }

  .header .nav a:last-child {
    border-bottom: 0;
  }

  .header-phone {
    margin-left: auto;
  }

  .header-menu-toggle {
    display: inline-flex;
  }

  body.header-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .header .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header .nav {
    left: -16px;
    right: -16px;
  }

  .header-phone {
    display: none !important;
  }

  .header-menu-toggle {
    margin-left: auto;
  }
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  background: rgba(18, 14, 10, 0.94);
}

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

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  width: min(1180px, 100%);
  max-height: 100%;
}

.gallery-lightbox-main {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-main img {
  width: 100%;
  height: min(78vh, calc(100vh - 170px));
  object-fit: contain;
  background: rgba(245, 241, 232, 0.04);
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 241, 232, 0.28);
  color: #f5f1e8;
  background: rgba(18, 14, 10, 0.72);
  transition: background 180ms ease, border-color 180ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
  border-color: rgba(245, 241, 232, 0.68);
  background: rgba(18, 14, 10, 0.92);
}

.gallery-lightbox-close {
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.gallery-lightbox-arrow {
  top: 50%;
  width: 46px;
  height: 58px;
  font-size: 34px;
  transform: translateY(-50%);
}

.gallery-lightbox-arrow.is-prev {
  left: 0;
}

.gallery-lightbox-arrow.is-next {
  right: 0;
}

.gallery-lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  cursor: grab;
  touch-action: pan-y;
}

.gallery-lightbox-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-lightbox-thumbs.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.gallery-lightbox-thumb {
  flex: 0 0 clamp(68px, 9vw, 92px);
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 232, 0.24);
  background: rgba(245, 241, 232, 0.08);
  scroll-snap-align: start;
}

.gallery-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-lightbox-thumb.is-active {
  border-color: #f5f1e8;
  box-shadow: inset 0 0 0 1px #f5f1e8;
}

@media (max-width: 720px) {
  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox-main img {
    height: min(72vh, calc(100vh - 140px));
  }

  .gallery-lightbox-close {
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-arrow {
    width: 40px;
    height: 52px;
  }
}
