/* Tinygrad Brutalist Minimalist — coastal palette */
@font-face {
  font-family: 'Share Tech Mono';
  src: url('Fonts/ShareTechMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #F2F2F2;           /* Sea Salt White */
  --text: #3E4A59;        /* Deep Tide */
  --text-secondary: #706E69;  /* Driftwood Grey */
  --link: #967BB6;         /* Wild Lavender */
  --link-hover: #7B5F96;
  --border: #706E69;      /* Driftwood Grey */
  --accent: #A3A580;      /* Dune Grass */
  --header-bg: #E8E6EB;   /* very light lavender tint */
  --row-border: #DEDBD4;
  --font-main: 'Share Tech Mono', ui-monospace, monospace;
  --buy-green: #008000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.buy-page .container {
  max-width: 1380px;
  padding-left: 10px;
  padding-right: 10px;
  height: 100svh;
  display: flex;
  flex-direction: column;
}

.buy-page {
  height: 100svh;
  overflow: hidden;
}

.buy-page main {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

/* Front page: INSTAGRAIN title + centered nav */
.front-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.front-page-inner {
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.site-title {
  font-family: var(--font-main);
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: bold;
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.site-subtitle {
  margin: -0.75rem 0 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.contact-section {
  margin-top: 2rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}

.contact-section h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  text-decoration: none;
  text-transform: uppercase;
}

.contact-section p {
  margin: 0;
}

.contact-section-home {
  margin-top: 1.5rem;
}

.nav-centered {
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0;
}

.nav {
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.nav a {
  color: var(--link);
  text-decoration: underline;
  background: transparent;
  border: none;
}

.nav a:hover {
  color: var(--link-hover);
}

.nav .sep {
  color: var(--text-secondary);
  margin: 0 0.5em;
}

.nav-current {
  color: var(--text);
  text-decoration: none;
  cursor: default;
}

.nav-current:hover {
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text);
}

h2 {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-decoration: underline;
  color: var(--text);
}

.lead {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:hover {
  color: var(--link-hover);
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

thead {
  background: var(--header-bg);
}

th {
  font-weight: bold;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
}

td {
  padding: 8px 12px;
  border: 1px solid var(--row-border);
}

tbody tr:nth-child(even) {
  background: rgba(242, 242, 242, 0.8);
}

code {
  font-family: var(--font-main);
  font-size: 0.95em;
  color: var(--text);
}

.tinybox .price {
  font-weight: bold;
  text-transform: uppercase;
}

.tinybox .status {
  font-weight: bold;
  text-transform: uppercase;
  color: var(--accent);
}

main {
  margin-bottom: 40px;
}

.buy-product {
  max-width: 760px;
  margin: 0 auto;
}

.buy-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.2rem;
  align-items: start;
  height: 100%;
  min-height: 0;
}

.buy-left {
  width: 100%;
}

.buy-right {
  width: 100%;
  min-width: 0;
}

.camera-slot {
  margin-bottom: 1.25rem;
}

.camera-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  background: #fff;
}

.camera-note {
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

.price-tag {
  color: var(--buy-green);
  font-size: 1.35rem;
  font-weight: bold;
  margin-top: 0.75rem;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 100%;
  width: 100%;
  margin-top: 0.4rem;
}

.buy-now-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 48px;
  color: var(--buy-green);
  border: 2px dashed var(--buy-green);
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  font-weight: bold;
  font-family: var(--font-main);
  font-size: 1rem;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.buy-now-cta:hover {
  color: var(--bg);
  background: var(--buy-green);
  border-color: var(--buy-green);
}

.price-tag {
  min-height: 48px;
  margin: 0;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  border: 2px dashed var(--buy-green);
}

.buy-toggle-menu {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 0.45rem;
}

.buy-tab {
  font-family: var(--font-main);
  font-size: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--link);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  text-decoration: underline;
  text-transform: uppercase;
}

.buy-tab:hover {
  color: var(--link-hover);
}

.buy-tab.is-active {
  color: #FFFFFF;
  background: var(--link);
  border-color: var(--link);
  text-decoration: none;
}

.buy-panel {
  border: 1px solid var(--border);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.6);
}

.buy-panel table {
  margin-bottom: 0;
}

.details-shell {
  border: 1px solid var(--border);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
  margin-bottom: 0;
}

.buy-panel h2 {
  margin-top: 0;
}

.buy-panel h3 {
  font-size: 1.15rem;
  margin: 0.6rem 0 0.2rem;
}

.buy-panel {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  min-width: 0;
}

.buy-panel p,
.buy-panel ul {
  margin-top: 0.2rem;
  margin-bottom: 0.55rem;
}

.gui-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.6rem;
}

.gui-figure {
  margin: 0;
}

.gui-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  background: #fff;
}

.gui-figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

@media (max-width: 768px) {
  .gui-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(62, 74, 89, 0.45);
}

.purchase-modal[hidden] {
  display: none;
}

.purchase-dialog {
  position: relative;
  width: min(100%, 520px);
  border: 2px dashed var(--border);
  background: var(--bg);
  padding: 1rem;
  color: var(--text);
}

.purchase-dialog h2 {
  margin-top: 0;
}

.purchase-dialog label {
  display: block;
  margin: 0.75rem 0 0.25rem;
}

.purchase-dialog input,
.purchase-dialog textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.45rem;
}

.purchase-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-main);
  cursor: pointer;
}

.purchase-submit {
  margin-top: 1rem;
  width: 100%;
  border: 2px dashed var(--buy-green);
  background: transparent;
  color: var(--buy-green);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: bold;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.purchase-submit:hover {
  background: var(--buy-green);
  color: var(--bg);
}

/* Large desktop layout tuning */
@media (min-width: 1181px) {
  .buy-layout {
    gap: 1.5rem;
  }

  .camera-image,
  .price-row {
    width: 100%;
    max-width: 100%;
  }
}

/* Tablet / intermediate layout: 3/5 left, 2/5 right */
@media (min-width: 769px) and (max-width: 1180px) {
  .buy-page .container {
    max-width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .buy-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1rem;
  }

  .camera-image,
  .price-row {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 16px 24px;
  }

  .front-page {
    min-height: 100svh;
    padding: 16px 24px;
  }

  .site-title {
    font-size: clamp(2rem, 14vw, 3rem);
    margin-bottom: 1rem;
  }

  .site-subtitle {
    margin-top: -0.35rem;
    font-size: 0.8rem;
  }

  .nav,
  .nav-centered {
    gap: 0.1rem;
    margin-bottom: 24px;
  }

  .nav .sep {
    margin: 0 0.35em;
  }

  .camera-image {
    max-width: 100%;
  }

  .buy-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 0.4rem;
  }

  .price-row {
    max-width: 100%;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .buy-toggle-menu {
    flex-wrap: nowrap;
  }

  .buy-tab {
    width: 50%;
    text-align: center;
  }

  .buy-page {
    height: auto;
    min-height: 100svh;
    overflow-y: auto;
  }

  .buy-page .container {
    height: auto;
    min-height: 100svh;
  }

  .buy-page .nav,
  .buy-page .nav-centered {
    margin-bottom: 0.4rem;
  }

  .buy-page main {
    flex: initial;
    min-height: auto;
  }

  .details-shell,
  .buy-panel {
    min-height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .price-tag {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .buy-now-cta {
    width: auto;
    flex: 1 1 auto;
  }
}
