/**
 * Prescott Bio Canada - Responsive Styles
 * Mobile-first responsive design.
 * Breakpoints: mobile (< 768px), tablet (768-1024px), desktop (> 1024px)
 */

/* ==========================================================================
   Base (Mobile First - < 768px)
   ========================================================================== */

/* Layout */
.pbc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pbc-space-2);
  padding: 0 var(--pbc-space-2);
}

.pbc-container {
  width: 100%;
  max-width: var(--pbc-wide-width);
  margin: 0 auto;
  padding: 0 var(--pbc-space-2);
  box-sizing: border-box;
}

/* Typography scaling - mobile */
.pbc-h1 {
  font-size: 28px;
  line-height: 36px;
}

.pbc-h2 {
  font-size: 22px;
  line-height: 28px;
}

/* Navigation - mobile: show hamburger, hide links */
.nav-primary__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.nav-primary__links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background-color: var(--pbc-deep-navy);
  padding: var(--pbc-space-2) var(--pbc-space-3);
  gap: 0;
  z-index: 100;
}

.nav-primary__links--open {
  display: flex;
}

.nav-primary__links li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-primary__links li:last-child {
  border-bottom: none;
}

.nav-primary__link {
  display: block;
  padding: var(--pbc-space-2) 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-primary__inner {
  position: relative;
}

/* Touch targets */
.btn-primary,
.btn-secondary,
.btn-destructive,
.checkout-submit__button {
  min-height: 44px;
}

/* Forms - full width on mobile */
.form-field__input,
.form-field__textarea,
.form-field__select,
.lot-selector__select {
  max-width: 100%;
}

/* Product specs table - stacked on mobile */
.product-specs__table,
.product-specs__table thead,
.product-specs__table tbody,
.product-specs__table tr,
.product-specs__table th,
.product-specs__table td {
  display: block;
}

.product-specs__table tr {
  padding: var(--pbc-space-1) 0;
  border-bottom: 1px solid var(--pbc-gray-1);
}

.product-specs__table tr:last-child {
  border-bottom: none;
}

.product-specs__table th {
  width: auto;
  white-space: normal;
  padding-bottom: 2px;
  border-bottom: none;
  background-color: transparent;
  color: var(--pbc-graphite);
  font-size: var(--pbc-text-small);
}

.product-specs__table td {
  padding-top: 0;
  border-bottom: none;
}

/* COA module - stack on mobile */
.coa-module__header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--pbc-space-1);
}

.coa-module__details {
  grid-template-columns: 1fr;
  gap: var(--pbc-space-1);
}

.coa-module__label {
  margin-bottom: 0;
}

.coa-module__actions {
  flex-direction: column;
  align-items: stretch;
}

/* Checkout - full width forms on mobile */
.checkout-page {
  padding: var(--pbc-space-3) var(--pbc-space-2);
}

.checkout-page__title {
  font-size: 28px;
  line-height: 36px;
}

.certification-step__header {
  flex-wrap: wrap;
}

.checkout-submit__button {
  width: 100%;
}

.payment-option {
  min-height: 44px;
}

/* Order review table - responsive */
.order-review__table th:first-child,
.order-review__table td:first-child {
  max-width: 60%;
}

/* Gate prompt */
.gate-prompt {
  margin: var(--pbc-space-4) var(--pbc-space-2);
  padding: var(--pbc-space-3);
}

/* ==========================================================================
   Tablet (768px - 1024px)
   ========================================================================== */

@media (min-width: 768px) {
  /* Grid */
  .pbc-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: var(--pbc-space-3);
    padding: 0 var(--pbc-space-3);
  }

  .pbc-container {
    padding: 0 var(--pbc-space-3);
  }

  /* Typography */
  .pbc-h1 {
    font-size: 36px;
    line-height: 44px;
  }

  .pbc-h2 {
    font-size: 26px;
    line-height: 32px;
  }

  /* Product specs - restore table layout on tablet */
  .product-specs__table,
  .product-specs__table thead,
  .product-specs__table tbody,
  .product-specs__table tr,
  .product-specs__table th,
  .product-specs__table td {
    display: revert;
  }

  .product-specs__table tr {
    padding: 0;
  }

  .product-specs__table th {
    width: 200px;
    white-space: nowrap;
    background-color: var(--pbc-off-white);
  }

  .product-specs__table th,
  .product-specs__table td {
    border-bottom: 1px solid var(--pbc-gray-1);
  }

  .product-specs__table tr:last-child th,
  .product-specs__table tr:last-child td {
    border-bottom: none;
  }

  /* COA module - restore row layout */
  .coa-module__header {
    flex-direction: row;
    align-items: center;
  }

  .coa-module__details {
    grid-template-columns: auto 1fr;
    gap: var(--pbc-space-1) var(--pbc-space-2);
  }

  .coa-module__actions {
    flex-direction: row;
    align-items: center;
  }

  /* Checkout */
  .checkout-page {
    padding: var(--pbc-space-4) var(--pbc-space-3);
  }

  .checkout-submit__button {
    width: auto;
    min-width: 240px;
  }

  /* Gate prompt */
  .gate-prompt {
    margin: var(--pbc-space-7) auto;
  }

  /* Forms */
  .lot-selector__select {
    max-width: 320px;
  }
}

/* ==========================================================================
   Desktop (> 1024px)
   ========================================================================== */

@media (min-width: 1024px) {
  /* Grid */
  .pbc-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--pbc-space-3);
    padding: 0 var(--pbc-space-4);
  }

  .pbc-container {
    padding: 0 var(--pbc-space-4);
  }

  /* Typography - full scale */
  .pbc-h1 {
    font-size: var(--pbc-text-h1);
    line-height: var(--pbc-lh-h1);
  }

  .pbc-h2 {
    font-size: var(--pbc-text-h2);
    line-height: var(--pbc-lh-h2);
  }

  /* Navigation - show links, hide hamburger */
  .nav-primary__toggle {
    display: none;
  }

  .nav-primary__links {
    display: flex;
    position: static;
    flex-direction: row;
    background-color: transparent;
    padding: 0;
    gap: var(--pbc-space-4);
  }

  .nav-primary__links li {
    border-bottom: none;
  }

  .nav-primary__link {
    display: inline;
    padding: 0;
    min-height: auto;
  }

  /* Checkout layout - 2 column */
  .checkout-columns {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--pbc-space-4);
    align-items: start;
  }

  .checkout-columns__main {
    order: 1;
  }

  .checkout-columns__sidebar {
    order: 2;
    position: sticky;
    top: var(--pbc-space-3);
  }
}

/* ==========================================================================
   Wide Desktop (> 1200px)
   ========================================================================== */

@media (min-width: 1200px) {
  .pbc-container {
    padding: 0;
  }
}
