:root {
  --page-width: 760px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 18px;
  --border-color: #999;
  --link-blue: #0000bb;
  --link-hover: #bb0000;
  --text-color: #000;
  --muted-text: #555;
  --cart-blue: #0066cc;
}

/* RESET */
html {
  box-sizing: border-box;
  overflow-y: scroll;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.35;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a img {
  border: 0;
}

a {
  color: var(--link-blue);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

/* PAGE LAYOUT */
.page-container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--space-sm);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 70%) minmax(220px, 30%);
  gap: var(--space-lg);
}

/* HEADER */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-md);
}

.site-header__left {
  flex: 0 1 65%;
  min-width: 0;
}

.site-header__left a {
  display: block;
  max-width: 100%;
}

.site-logo {
  width: 100%;
  max-width: 420px;
}

.site-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.header-top-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.header-search-form {
  width: 100%;
}

.header-search-row {
  display: flex;
  gap: 6px;
}

.header-search-row input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #999;
  border-radius: 6px;
}

.header-search-button {
  width: 32px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #eee;
  cursor: pointer;
}

/* STANDARD LEFT PANEL */
.home-results {
  min-width: 0;
}

.home-header {
  font-size: 20px;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
}

.home-header-left {
  color: #000;
}

.home-header-right {
  color: #000;
}

.home-header-right-red {
  color: #bb0000;
}

.home-card {
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
}

.home-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.home-image {
  width: 120px;
  max-width: 120px;
  min-width: 120px;
  height: 90px;
  min-height: 90px;
  max-height: 90px;
  object-fit: cover;
  object-position: center;
  border: 1px solid #000;
  flex: 0 0 120px;
  display: block;
}

.home-title {
  font-size: 16px;
  margin: 0;
  font-weight: normal;
}

.home-title a {
  color: var(--link-blue);
}

.home-title a:hover {
  color: var(--link-hover);
}

.home-text {
  margin-top: 5px;
  font-size: 14px;
  color: #333;
}

/* GENERIC */
.column-header {
  font-size: 20px;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ccc;
}

.card {
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
}

/* SIDEBAR */
.sidebar {
  text-align: right;
}

.sidebar .home-card,
.sidebar .card {
  text-align: right;
}

/* ITEM PAGE ONLY */
.item-page .item-gallery {
  margin-bottom: 16px;
}

.item-page .item-primary-image-wrap {
  display: inline-block;
  width: auto;
  max-width: 100%;
  border: 1px solid #999;
  background: #fff;
}

.item-page .item-main-image {
  display: block;
  width: auto;
  max-width: 420px;
  height: auto;
  cursor: pointer;
}

.item-page .item-thumbnail-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 8px;
  margin-top: 8px;
  border-top: 1px solid #ddd;
  min-height: 108px;
}

.item-page .item-thumbnail {
  height: 92px;
  width: auto;
  flex: 0 0 auto;
  border: 1px solid #999;
  padding: 3px;
  background: #fff;
  cursor: pointer;
}

.item-page .item-thumbnail:hover,
.item-page .item-thumbnail.is-active {
  border-color: var(--link-hover);
}

.item-page .item-description {
  margin-top: 10px;
}

.item-page .item-title {
  font-size: 22px;
  margin: 0 0 10px;
  font-weight: bold;
}

.item-page .item-text {
  margin-top: 0;
  font-size: 15px;
  color: #333;
}

.item-page .item-actions {
  margin-top: 16px;
}

.item-page .add-to-cart-link {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--cart-blue);
  color: var(--cart-blue);
  font-weight: bold;
  background: #fff;
}

.item-page .add-to-cart-link:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

/* ITEM PAGE LIGHTBOX ONLY */
.item-page .image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  padding: 24px;
}

.item-page .image-lightbox.is-open {
  display: block;
}

.item-page .image-lightbox-inner {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.item-page .image-lightbox img {
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 90vh;
  background: #fff;
  border: 2px solid #fff;
}

.item-page .lightbox-close {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 10000;
  font-size: 36px;
  line-height: 1;
  color: #fff;
  border: 0;
  background: none;
  cursor: pointer;
}

.item-page .lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 10000;
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 1;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
}

.item-page .lightbox-nav:hover {
  background: rgba(0,0,0,0.7);
}

.item-page .lightbox-prev {
  left: 10px;
}

.item-page .lightbox-next {
  right: 10px;
}

/* FOOTER */
.site-footer {
  font-size: 11px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* MOBILE */
@media (max-width: 560px) {
  .page-layout {
    display: block;
  }

  .site-header {
    display: block;
  }

  .site-header__right {
    align-items: flex-start;
    margin-top: 10px;
  }

  .sidebar {
    text-align: left;
    margin-top: 20px;
  }

  .sidebar .home-card,
  .sidebar .card {
    text-align: left;
  }

  .home-row {
    display: block;
  }

  .home-image {
    margin-bottom: 8px;
  }

  .item-page .item-main-image {
    max-width: 100%;
  }

  .item-page .image-lightbox {
    padding: 12px;
  }

  .item-page .lightbox-nav {
    font-size: 34px;
    padding: 8px 10px;
  }
}