/* =========================================================
   Shared components: buttons, header, mobile menu, footer,
   product card. Page-specific styles go in their own file.
   ========================================================= */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6);
  font-size: var(--fs-small); font-weight: 500; letter-spacing: .02em;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent); color: var(--on-accent); }
.btn--light { background: var(--cream); color: var(--brown); }
.btn--light:hover { background: var(--sage); }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* Text link with underline that grows on hover */
.link {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-small); font-weight: 500;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur) var(--ease);
}
.link:hover { background-size: 0% 1px; background-position: right bottom; }
.link svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.link:hover svg { transform: translateX(3px); }

/* Icon button (header icons, close buttons) */
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  transition: background var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--sand); }
.icon-btn svg { width: 22px; height: 22px; }

/* Announcement bar, header and mobile menu: see css/header.css */

/* ---------- Footer ---------- */
.site-footer { background: var(--brown); color: var(--cream); padding-top: var(--s-9); }
.site-footer a { color: rgba(246, 243, 236, .78); transition: color var(--dur) var(--ease); }
.site-footer a:hover { color: var(--cream); }

.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s-7);
  padding-bottom: var(--s-8); border-bottom: 1px solid rgba(246, 243, 236, .2);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.footer-brand img { width: 32px; height: 32px; }
.footer-about { margin-top: var(--s-4); color: var(--sage); font-size: var(--fs-small); max-width: 34ch; }

.newsletter { margin-top: var(--s-6); max-width: 420px; }
.newsletter label { display: block; font-size: var(--fs-small); font-weight: 500; margin-bottom: var(--s-3); }
.newsletter-row {
  display: flex; border-bottom: 1px solid rgba(246, 243, 236, .5);
  transition: border-color var(--dur) var(--ease);
}
.newsletter-row:focus-within { border-color: var(--cream); }
.newsletter input {
  flex: 1; min-width: 0; background: transparent; border: 0; padding: var(--s-3) 0;
  color: var(--cream); font-size: var(--fs-body); outline: none;
}
.newsletter input::placeholder { color: rgba(246, 243, 236, .55); }
.newsletter button { padding: 0 var(--s-2); color: var(--cream); }
.newsletter button svg { width: 18px; height: 18px; }
.newsletter-msg { margin-top: var(--s-2); font-size: var(--fs-caption); color: var(--sage); min-height: 1.5em; }

.footer-col h3 {
  font-size: var(--fs-caption); font-weight: 500; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--sage); margin-bottom: var(--s-4);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: var(--s-3); }
.footer-col a, .footer-col p { font-size: var(--fs-small); }
.footer-col p { color: rgba(246, 243, 236, .78); }
.footer-col p + p { margin-top: var(--s-3); }

/* Plain icons, no circle; they brighten on hover */
.socials { display: flex; gap: var(--s-5); margin-top: var(--s-5); }
.socials a { display: inline-flex; opacity: .75; transition: opacity var(--dur) var(--ease); }
.socials a:hover, .socials a:focus-visible { opacity: 1; }
.socials svg { width: 18px; height: 18px; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding-block: var(--s-5); font-size: var(--fs-caption); color: var(--sage);
}
.footer-bottom ul { display: flex; gap: var(--s-5); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }

/* ---------- Product card ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-7) var(--s-5); }

.product-card { position: relative; display: flex; flex-direction: column; }
.product-card__media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--sand); border-radius: var(--radius-sm);
}
.product-card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.product-card__media img.alt { opacity: 0; }
.product-card:hover .product-card__media img:not(.alt) { transform: scale(1.03); }
.product-card:hover .product-card__media img.alt { opacity: 1; }

.badge {
  position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2;
  background: var(--surface); color: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.badge--dark { background: var(--brown); color: var(--cream); }

.quick-add {
  position: absolute; left: var(--s-3); right: var(--s-3); bottom: var(--s-3); z-index: 2;
  min-height: 44px; border-radius: var(--radius-btn);
  background: var(--surface); color: var(--text); font-size: var(--fs-small); font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur);
}
.quick-add:hover { background: var(--brown); color: var(--cream); }
.product-card:hover .quick-add, .quick-add:focus-visible { opacity: 1; transform: none; }

.product-card__body { padding-top: var(--s-4); display: grid; gap: 2px; }
.product-card__title { font-size: var(--fs-body); font-weight: 500; letter-spacing: -.01em; }
.product-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.product-card__meta { font-size: var(--fs-small); color: var(--text-subtle); }
.product-card__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.price { font-size: var(--fs-small); font-weight: 500; font-variant-numeric: tabular-nums; }
.price s { color: var(--text-subtle); font-weight: 400; margin-left: var(--s-2); }
.price--sale { color: var(--sale); }

/* Wood finish swatches */
.swatches { display: flex; gap: 6px; position: relative; z-index: 2; }
.swatch {
  width: 16px; height: 16px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  outline: 1px solid transparent; outline-offset: 2px;
}
.swatch[aria-pressed="true"], .swatch:hover { outline-color: var(--brown); }
.swatch--walnut { background: #5A3B26; }
.swatch--teak { background: #A0703F; }
.swatch--oak { background: #CDAE84; }
.swatch--ash { background: #E3D3B8; }
.swatch--black { background: #2B2622; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .footer-top > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hide-mobile { display: none !important; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-6) var(--s-3); }
  .quick-add { display: none; } /* no hover on touch: tap the card instead */
}

@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto 1fr; gap: var(--s-6); }
  /* AT DISPLAY on the left; HELP with CONTACT right under it on the right.
     The spare 1fr row soaks up AT DISPLAY's extra height, so HELP and CONTACT stay close together. */
  .footer-top > :nth-child(2) { grid-column: 1; grid-row: 2 / 5; }
  .footer-top > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .footer-top > :nth-child(4) { grid-column: 2; grid-row: 3; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
