
/* ==============================================
   STATISTICAL SCIENCES APPAREL CATALOGUE
   University of Toronto
   Version 4 — Catalogue and Image Gallery
   ============================================== */

:root {
  --blue: #002a5c;
  --blue-dark: #001b40;
  --yellow: #ffd433;
  --ink: #172b4d;
  --muted: #596779;
  --light: #f6f8fb;
  --soft: #edf2f8;
  --border: #dce3eb;
  --radius: 10px;
  --container: 1200px;
  --header-height: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 16px/1.6 Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.cart-open,
body.gallery-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #d29b00;
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* ==============================================
   SPLASH SCREEN
   Original blue transparent logo on pure white
   ============================================== */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  opacity: 1;
  animation: splash-exit .5s ease 2s forwards;
}

.splash-logo {
  width: clamp(160px, 24vw, 270px);
  height: auto;
  object-fit: contain;
  opacity: 0;
  animation: splash-enter .65s ease forwards;
}

@keyframes splash-enter {
  from {
    opacity: 0;
    transform: scale(.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splash-exit {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* ==============================================
   HEADER
   ============================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: .64rem;
  letter-spacing: .09em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a,
.cart-toggle {
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
}

.site-nav a:hover,
.cart-toggle:hover {
  color: var(--yellow);
}

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 50%;
  color: var(--blue);
  background: var(--yellow);
  font-size: .75rem;
  font-weight: 700;
}

/* ==============================================
   BUTTONS
   ============================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  transition: background .2s, transform .2s;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-outline {
  color: var(--blue);
  border-color: var(--blue);
  background: #fff;
}

.button-outline:hover {
  background: var(--soft);
}

/* ==============================================
   HERO
   ============================================== */

.hero {
  overflow: hidden;
  background: linear-gradient(
    115deg,
    #fff 0%,
    #f4f7fb 58%,
    #e4eaf3 100%
  );
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 50px;
  min-height: 430px;
  padding-block: 70px;
}

.hero-text {
  max-width: 620px;
}

.hero h1 {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.hero-description {
  max-width: 560px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 300px;
  padding: 20px;

  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.hero-department-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
}

.hero-visual-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 250px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  color: #fff;
  text-align: center;
}

.hero-visual-label {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: .08em;
}

.hero-visual-caption {
  margin-top: 8px;
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ==============================================
   INFORMATION NOTICE
   ============================================== */

.notice-section {
  padding: 30px 0 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 23px 27px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--light);
}

.notice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: .9rem;
  font-weight: 700;
}

.notice-content h2 {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 1rem;
}

.notice-content p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .9rem;
}

.notice-content p:last-child {
  margin-bottom: 0;
}

/* ==============================================
   CATALOGUE SECTION
   ============================================== */

.products-section {
  padding: 70px 0 95px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.2;
}

.section-description {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.catalogue-introduction {
  max-width: 850px;
  margin-bottom: 35px;
}

.catalogue-introduction p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .94rem;
}

.catalogue-category {
  grid-column: 1 / -1;
  margin: 30px 0 3px;
  padding-bottom: 13px;
  border-bottom: 2px solid var(--blue);
  color: var(--blue);
  font-size: 1.55rem;
  font-weight: 700;
}

.catalogue-category:first-child {
  margin-top: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  align-items: stretch;
  gap: 25px;
}

.loading-products {
  grid-column: 1 / -1;
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

/* ==============================================
   PRODUCT CARDS
   ============================================== */

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 3px 12px rgba(0,31,70,.05);
  transition: transform .2s, box-shadow .2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,31,70,.09);
}

.product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 290px;
  padding: 18px;
  background: var(--light);
}

.product-image-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 250px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}

.product-image-button img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  transition: transform .3s ease;
}

.product-image-button:hover img {
  transform: scale(1.035);
}

.product-zoom-label {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--blue);
  background: rgba(255,255,255,.96);
  font-size: .75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.product-image-button:hover .product-zoom-label {
  background: var(--blue);
  color: #fff;
}

.product-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 260px;
  padding: 24px;
  border: 1px dashed #c4cfdd;
  border-radius: 6px;
  color: var(--blue);
  background: #e9eef5;
  font-weight: 700;
  text-align: center;
}

.product-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 23px;
}

.product-title {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 1.13rem;
  line-height: 1.35;
}

.product-sku {
  margin: 0 0 12px;
  color: #718096;
  font-size: .76rem;
}

.product-description {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.55;
}

.product-price {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: 1.2rem;
  font-weight: 700;
}

.product-price-note {
  margin: 0 0 20px;
  color: #718096;
  font-size: .75rem;
  line-height: 1.45;
}

.product-options {
  display: grid;
  gap: 15px;
  margin-top: auto;
}

.option-group {
  display: grid;
  gap: 7px;
}

.option-group label {
  font-size: .82rem;
  font-weight: 700;
}

.option-group select,
.option-group input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d3e0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: .9rem;
}

.product-swatch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.product-colour-swatch {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
}

.product-colour-name {
  font-size: .82rem;
}

.product-card .button {
  width: 100%;
  margin-top: 21px;
}

/* ==============================================
   FULL-SCREEN IMAGE GALLERY
   ============================================== */

.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,20,45,.86);
  animation: gallery-appear .2s ease;
}

@keyframes gallery-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gallery-panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 1100px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.gallery-title {
  margin: 0;
  color: var(--blue);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.35;
}

.gallery-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--blue);
  background: #fff;
  font-size: 1.8rem;
  line-height: 1;
}

.gallery-close:hover {
  background: var(--soft);
}

.gallery-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 18px 70px;
  overflow: hidden;
  background: #fff;
}

.gallery-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 850px);
  max-height: min(70dvh, 850px);
  object-fit: contain;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--blue);
  background: rgba(255,255,255,.96);
  font-size: 2rem;
  transform: translateY(-50%);
}

.gallery-arrow:hover {
  background: var(--soft);
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}

.gallery-caption {
  margin: 0;
}

.gallery-counter {
  white-space: nowrap;
}

/* ==============================================
   HOW IT WORKS
   ============================================== */

.how-section {
  padding: 75px 0 90px;
  background: var(--light);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 20px;
}

.step-card {
  padding: 27px 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.step-number {
  display: block;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 1.7rem;
  font-weight: 800;
}

.step-card h3 {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 1rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

/* ==============================================
   CART OVERLAY AND PANEL
   ============================================== */

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,17,42,.58);
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(100%, 540px);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  box-shadow: -12px 0 35px rgba(0,0,0,.16);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .3s ease, visibility .3s;
}

.cart-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.cart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 29px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  margin: 0;
  color: var(--blue);
  font-size: 1.5rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 1.7rem;
}

.icon-button:hover {
  background: var(--light);
}

.cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 25px 29px 38px;
}

.cart-items {
  display: grid;
  gap: 16px;
}

.empty-cart {
  padding: 25px 12px;
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.cart-item-title {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: .95rem;
  font-weight: 700;
}

.cart-item-meta {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .82rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.quantity-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
}

.quantity-button:hover {
  background: var(--soft);
}

.cart-item-quantity {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.remove-item {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #9c2938;
  font-size: .78rem;
  text-decoration: underline;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cart-price-summary {
  margin-bottom: 25px;
  padding: 14px 16px;
  border-radius: 6px;
  background: var(--light);
  color: var(--blue);
  font-size: .9rem;
  font-weight: 700;
}

/* ==============================================
   CUSTOMER FORM
   ============================================== */

.form-section {
  padding-top: 8px;
}

.form-section h3,
.submit-section h3 {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 17px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: .82rem;
  font-weight: 700;
}

.required {
  color: #a12435;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #c8d3e0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: .9rem;
}

.form-field textarea {
  min-height: 95px;
  resize: vertical;
}

.submit-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}

.submit-section p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .88rem;
}

.submission-note {
  padding: 13px 15px;
  border-radius: 6px;
  background: var(--light);
}

.submit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 21px;
}

.request-feedback {
  min-height: 20px;
  margin-top: 15px !important;
  color: var(--blue) !important;
  font-weight: 700;
}

/* ==============================================
   FOOTER
   ============================================== */

.site-footer {
  padding: 38px 0;
  color: #fff;
  background: var(--blue);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand strong {
  font-size: .95rem;
}

.footer-brand span {
  font-size: .82rem;
  opacity: .8;
}

.footer-information {
  max-width: 550px;
}

.footer-information p {
  margin: 0 0 8px;
  font-size: .78rem;
  opacity: .85;
}

/* ==============================================
   TABLET
   ============================================== */

@media (max-width: 950px) {
  .hero-content {
    gap: 28px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .steps-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

/* ==============================================
   MOBILE
   ============================================== */

@media (max-width: 650px) {
  :root {
    --header-height: 70px;
  }

  .container {
    width: min(calc(100% - 32px), var(--container));
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: .55rem;
  }

  .site-nav {
    gap: 15px;
  }

  .site-nav a,
  .cart-label {
    display: none;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 45px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-visual {
    min-height: 205px;
  }

  .hero-visual-inner {
    min-height: 165px;
  }

  .notice {
    padding: 19px;
  }

  .products-section {
    padding: 50px 0 65px;
  }

  .section-heading {
    display: block;
  }

  .section-description {
    margin-top: 12px;
  }

  .catalogue-category {
    font-size: 1.35rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .product-image {
    min-height: 230px;
  }

  .product-image-button img,
  .product-placeholder {
    height: 225px;
  }

  .how-section {
    padding: 50px 0;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .cart-header,
  .cart-content {
    padding: 20px;
  }

  .form-grid,
  .submit-actions {
    grid-template-columns: 1fr;
  }

  .gallery-overlay {
    padding: 8px;
  }

  .gallery-panel {
    max-height: calc(100dvh - 16px);
  }

  .gallery-header {
    padding: 12px 15px;
  }

  .gallery-stage {
    padding: 12px 42px;
  }

  .gallery-image {
    max-height: 72dvh;
  }

  .gallery-arrow {
    width: 34px;
    height: 44px;
    font-size: 1.6rem;
  }

  .gallery-prev {
    left: 4px;
  }

  .gallery-next {
    right: 4px;
  }

  .gallery-footer {
    padding: 12px 15px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 22px;
  }
}

/* ==============================================
   REDUCED MOTION
   ============================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }

  .splash-screen {
    animation-duration: .01ms;
    animation-delay: .2s;
  }

  .splash-logo {
    animation: none;
    opacity: 1;
  }

  .gallery-overlay {
    animation: none;
  }
}
