:root {
  --primary: #E8721C;
  --secondary: #1a1512;
  --bg: #f6f1ec;
  --card: #ffffff;
  --line: #e0d6cc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--secondary); }

.sf-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--secondary); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.sf-brand { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.sf-cart {
  background: var(--primary); color: #fff; padding: 8px 18px;
  border-radius: 999px; font-weight: 700; cursor: pointer;
}

.sf-hero {
  padding: 48px 24px; text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.sf-hero h1 { font-size: 34px; margin-bottom: 8px; }
.sf-hero p { opacity: 0.9; }

.sf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px; padding: 24px; max-width: 1200px; margin: 0 auto;
}
.sf-loading { grid-column: 1/-1; text-align: center; padding: 40px; color: #999; }

.sf-card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08); display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.14); }
.sf-card img { width: 100%; height: 200px; object-fit: contain; background: #faf7f4; padding: 12px; }
.sf-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sf-card-name { font-weight: 800; font-size: 16px; }
.sf-card-spec { font-size: 12px; color: #8a7d72; }
.sf-badge {
  align-self: flex-start; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; margin-top: 4px;
}
.badge-in { background: #e3f6e8; color: #2e7d43; }
.badge-avail { background: #fff3e0; color: #b8661a; }
.badge-pre { background: #e8eefc; color: #3a5bbf; }
.badge-out { background: #f2e6e6; color: #9a3b3b; }
.sf-price { font-size: 20px; font-weight: 800; color: var(--primary); margin-top: auto; }
.sf-add {
  background: var(--secondary); color: #fff; border: none;
  padding: 10px; border-radius: 8px; font-weight: 700; cursor: pointer; margin-top: 8px;
}
.sf-add:hover { background: var(--primary); }
.sf-add:disabled { background: #ccc; cursor: not-allowed; }

.sf-footer { text-align: center; padding: 24px; color: #8a7d72; font-size: 13px; }

.sf-modal-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.sf-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.sf-modal { position: relative; background: #fff; border-radius: 16px; width: min(480px, 92vw); max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.sf-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--secondary); color: #fff; font-size: 18px; font-weight: 800; border-radius: 16px 16px 0 0; }
.sf-x { background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; }
.sf-modal-body { padding: 20px; }
.sf-modal-body label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 4px; }
.sf-modal-body input[type=text] { width: 100%; padding: 10px; border: 1.5px solid #bbb; border-radius: 8px; }
.sf-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sf-cart-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sf-total { font-weight: 800; font-size: 18px; text-align: right; margin: 12px 0; color: var(--primary); }
.sf-modal-foot { padding: 0 20px 20px; }
.sf-place { width: 100%; background: var(--primary); color: #fff; border: none; padding: 14px; border-radius: 999px; font-size: 16px; font-weight: 800; cursor: pointer; }
.sf-place:active { background: #c85f10; }
.sf-result { padding: 0 20px 20px; text-align: center; font-weight: 700; }
.sf-result.ok { color: #2e7d43; }
.sf-result.err { color: #9a3b3b; }

.sf-logo { height: 40px; width: auto; }
