
:root{
  --bg:#eae7dd;
  --ink:#2f2a1f;
  --sage:#8d8f74;
  --cream:#f8f5ef;
  --accent:#b08e6a;
}
*{box-sizing:border-box}
body{margin:0;font-family: ui-serif, Georgia, 'Times New Roman', serif; color:var(--ink); background:var(--bg)}
a{color:inherit}
img{max-width:100%; display:block}

.site-header.compact{background:var(--cream); border-bottom:1px solid #e6dfd3}
.hero{max-width:1200px; margin:0 auto; padding:1rem; display:flex; align-items:center; gap:1rem}
.hero-text{flex:1 1 110px}
.hero-text h1{margin:.25rem 0; font-size:clamp(28px,4vw,44px)}
.hero-text .tagline{margin:.25rem 0 0; color:#5a584d; font-size:clamp(14px,1.8vw,18px)}
.hero-media{flex:0 1 50vw; display:flex; justify-content:flex-end}
.hero-img{max-width:min(50vw,640px); height:auto; border-radius:14px; border:3px double var(--accent); box-shadow:0 4px 24px rgba(0,0,0,.06)}

.content{padding:clamp(12px,2vw,24px)}

/* Link tiles */
.home-links{padding:clamp(8px,2vw,16px); max-width:900px; margin:0 auto}
.link-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.6rem}
.link-tile{display:flex; align-items:center; gap:.8rem; text-decoration:none; background:#fff; border:1px solid #e1ddd3; border-radius:16px; padding:.9rem 1rem; box-shadow:0 1px 8px rgba(0,0,0,.02); transition:transform .06s ease, box-shadow .12s ease}
.link-tile:hover{transform:translateY(-1px); box-shadow:0 6px 22px rgba(0,0,0,.06)}
.link-tile .icon{width:40px; height:40px; background:url('../img/yarn.svg') center/contain no-repeat; flex:0 0 40px}
.link-tile .text{display:flex; flex-direction:column}
.link-tile small{color:#666}

.about-blurb{max-width:800px; margin:1rem auto 2rem; text-align:center; color:#3d3a31}

/* Cards and grids (catalog/admin) */
.grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr)); gap:1rem}
.card{background:#fff; border:1px solid #e1ddd3; border-radius:12px; overflow:hidden; display:flex; flex-direction:column}
.card-body{padding:1rem; display:flex; flex-direction:column; gap:.5rem}
.price{font-weight:700}
.card form{display:flex; gap:.5rem; align-items:center; flex-wrap:wrap}
.card input[type=number]{width:90px}

.btn{background:var(--accent); color:#fff; border:0; padding:.65rem 1rem; border-radius:999px; cursor:pointer; text-decoration:none; display:inline-block}
.btn:hover{filter:brightness(.95)}
.btn.outline{background:transparent; color:var(--ink); border:1px solid var(--ink)}
.btn.big{font-size:1.1rem; padding:.8rem 1.2rem}

/* Forms */
.form-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; margin:1rem 0}
.form-grid label{display:flex; flex-direction:column; gap:.25rem; font-weight:600}
.form-grid input, .form-grid select, .form-grid textarea{padding:.6rem .7rem; border:1px solid #cfc8b9; border-radius:10px; font:inherit; background:#fff}
.form-grid .full{grid-column:1 / -1}

.alert{padding:.75rem 1rem; border-radius:12px; margin:1rem 0}
.alert.error{background:#ffecec; border:1px solid #f5b5b5}
.alert.success{background:#edffef; border:1px solid #b5f5c9}

/* Cart */
.cart-table{width:100%; border-collapse:collapse; background:#fff; border:1px solid #e1ddd3}
.cart-table th, .cart-table td{padding:.6rem .7rem; border-bottom:1px solid #eee}
.cart-table tfoot td{font-weight:700}
.cart-table .right{text-align:right}
.cart-table .total{font-size:1.1rem}
.cart .cart-actions{display:flex; gap:.5rem; margin-top:1rem; flex-wrap:wrap}

/* Checkout */
.checkout{display:grid; grid-template-columns: 1fr 320px; gap:1rem; align-items:start}
.checkout .order-summary{background:#fff; border:1px solid #e1ddd3; border-radius:12px; padding:1rem}
.checkout .order-summary ul{list-style:none; padding:0; margin:0}
.checkout .order-summary li{display:flex; justify-content:space-between; padding:.3rem 0; border-bottom:1px dashed #eee}
.checkout .order-summary p{display:flex; justify-content:space-between; margin:.4rem 0}
.checkout .order-summary p.total{font-size:1.1rem; font-weight:700}

/* Footer */
.site-footer{padding:1rem; background:var(--cream); border-top:1px solid #e6dfd3}
.footer-inner{max-width:1000px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap}

/* Responsive */
@media (max-width: 880px){
  .checkout{grid-template-columns:1fr}
}


/* Phone / narrow screens: reset the hero’s flex basis so no vertical gap is reserved */
@media (max-width: 600px) {
  .hero {
    flex-direction: column-reverse;  /* text above image */
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;         /* tighter padding */
    align-items: stretch;
  }

  /* CRITICAL: remove the 50vw flex-basis that becomes vertical on column layout */
  .hero-media {
    flex: 0 0 auto;                  /* no reserved height */
    width: 100%;
    align-self: stretch;
    justify-content: center;
  }

  /* Make the image truly fill width on portrait */
  .hero-img {
    width: 100% !important;          /* override desktop rule */
    max-width: none !important;
    height: auto;
    border-radius: 12px;
  }

  /* Trim heading spacing a bit for balance */
  .hero-text h1 { margin: 0.15rem 0; }
  .hero-text .tagline { margin: 0.15rem 0 0; }
}

/* Shared product grid for public + admin */

.products-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;      /* center cards when there are just 1–2 */
  gap: 1.5rem;
  margin: 1rem auto 2rem;
  max-width: 1200px;            /* prevent stretching super wide on large screens */
}

/* Standard card size */
.product-card {
  flex: 0 0 260px;              /* "column" width */
  max-width: 260px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Keep images consistent height */
.product-card img {
  display: block;
  width: 100%;
  height: 220px;                /* fixed visual height */
  object-fit: cover;            /* crop nicely */
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Titles / price tidy */
.product-card h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.product-card .price {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

/* Admin-specific tweaks (optional) */
.product-card--admin {
  background: #f8fafc;
  border-style: dashed;
}