/* ===================================================
   FABRICCREW SHOP — style.css
   =================================================== */
:root {
  --primary:      #0f5c9a;
  --secondary:    #142f57;
  --accent:       #c79a2d;
  --accent-light: #f8efd9;
  --bg-light:     #f6f8fc;
  --bg-white:     #ffffff;
  --border:       #d9e1ec;
  --text:         #1a2540;
  --text-muted:   #5a6a82;
  --shadow-sm:    0 2px 8px rgba(15,92,154,0.08);
  --shadow-md:    0 4px 20px rgba(15,92,154,0.12);
  --shadow-lg:    0 8px 40px rgba(15,92,154,0.16);
  --radius:       12px;
  --radius-sm:    8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== TOPBAR ===== */
.topbar {
  background: var(--secondary);
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 7px 5%;
}
.topbar a { color: rgba(255,255,255,0.8); }
.topbar a:hover { color: var(--accent); }

/* ===== HEADER ===== */
.shop-header {
  background: var(--secondary);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.shop-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-logo img { height: 38px; width: auto; }
.shop-logo-text {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}
.shop-logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.shop-header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.shop-header-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  transition: color 0.2s;
}
.shop-header-nav a:hover { color: #fff; }
.shop-header-nav .btn-quote {
  background: var(--accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}
.shop-header-nav .btn-quote:hover { background: #a87b1a; color: #fff; }

/* ===== HERO BANNER ===== */
.shop-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  padding: 56px 5% 48px;
  text-align: center;
}
.shop-hero h1 {
  color: #fff;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  margin-bottom: 10px;
}
.shop-hero p {
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ===== FILTER TABS ===== */
.filter-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.filter-tab:hover { color: var(--primary); }
.filter-tab.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.filter-count {
  display: inline-block;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 5px;
}
.filter-tab.active .filter-count {
  background: var(--accent-light);
  color: var(--accent);
}

/* ===== DESIGN GRID ===== */
.shop-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 5% 60px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* ===== DESIGN CARD ===== */
.design-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.design-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.design-card-img {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-light);
}
.design-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.design-card:hover .design-card-img img { transform: scale(1.04); }
.design-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-available   { background: #16a34a; color: #fff; }
.badge-preorder    { background: var(--accent); color: #fff; }
.badge-soldout     { background: #94a3b8; color: #fff; }
.design-card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.design-event-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.design-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.design-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 14px;
}
.design-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.design-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.design-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.btn-card-view {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-card-view:hover { background: var(--secondary); }

/* soldout card */
.design-card.soldout { opacity: 0.65; pointer-events: none; }

/* empty state */
.shop-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.shop-empty svg { margin: 0 auto 20px; opacity: 0.3; }
.shop-empty h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }

/* ===== PRODUCT PAGE ===== */
.product-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 5% 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }

/* Image viewer */
.img-viewer { position: sticky; top: 80px; }
.img-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.img-tab {
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-light);
  color: var(--text-muted);
  border: 2px solid var(--border);
  font-family: inherit;
  transition: all 0.2s;
}
.img-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.img-frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f0f4fa;
  aspect-ratio: 4/5;
  position: relative;
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 0.3s;
}
.img-frame img.hidden { opacity: 0; pointer-events: none; }

/* Product info */
.product-event-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.product-name {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.2;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}
.product-price {
  font-size: 30px;
  font-weight: 900;
  color: var(--primary);
}
.product-price-note {
  font-size: 13px;
  color: var(--text-muted);
}
.product-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Status banner */
.product-status-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
}
.status-available  { background: #dcfce7; color: #15803d; }
.status-preorder   { background: var(--accent-light); color: #7a4d00; }
.status-soldout    { background: #f1f5f9; color: #64748b; }

/* Size chart */
.size-chart-toggle {
  width: 100%;
  text-align: left;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  margin-bottom: 4px;
  transition: background 0.2s;
}
.size-chart-toggle:hover { background: #eaf0f9; }
.size-chart-toggle .chevron {
  transition: transform 0.25s;
  font-size: 16px;
}
.size-chart-toggle.open .chevron { transform: rotate(180deg); }
.size-chart-body {
  display: none;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}
.size-chart-body.open { display: block; }
.size-chart-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.size-chart-body th {
  background: var(--secondary);
  color: #fff;
  padding: 8px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}
.size-chart-body td {
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.size-chart-body tr:last-child td { border-bottom: none; }
.size-chart-body tr:nth-child(even) td { background: var(--bg-light); }

/* Order form */
.order-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}
.order-box h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.size-btn {
  width: 52px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.size-btn:hover { border-color: var(--primary); color: var(--primary); }
.size-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.qty-ctrl {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 38px; height: 40px;
  background: var(--bg-light);
  border: none;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: background 0.15s;
}
.qty-btn:hover { background: var(--border); }
.qty-input {
  width: 56px;
  height: 40px;
  border: none;
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
}
.qty-input:focus { outline: none; }
.subtotal-row {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.subtotal-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.customer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
}
.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-pay {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #a87b1a 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 4px 16px rgba(199,154,45,0.35);
  transition: opacity 0.2s, transform 0.15s;
}
.btn-pay:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-pay:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-wa:hover { background: #1aa850; }
.btn-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}
.btn-divider::before, .btn-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.btn-divider::before { left: 0; }
.btn-divider::after { right: 0; }

/* ===== SUCCESS PAGE ===== */
.success-wrap {
  max-width: 560px;
  margin: 60px auto;
  padding: 0 5%;
  text-align: center;
}
.success-icon {
  width: 72px; height: 72px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}
.success-wrap h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 10px;
}
.success-wrap p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 24px;
}
.order-summary-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 28px;
}
.order-summary-box table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.order-summary-box td { padding: 7px 0; border-bottom: 1px solid var(--border); }
.order-summary-box td:last-child { font-weight: 600; text-align: right; }
.order-summary-box tr:last-child td { border-bottom: none; }
.success-actions { display: flex; flex-direction: column; gap: 10px; }

/* ===== ADMIN PAGE ===== */
.admin-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 5%;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header h1 { font-size: 24px; font-weight: 800; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}
.admin-table th {
  background: var(--secondary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-light); }
.admin-thumb { width: 48px; height: 56px; object-fit: cover; border-radius: 4px; }
.badge-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.pill-available { background: #dcfce7; color: #15803d; }
.pill-preorder  { background: var(--accent-light); color: #7a4d00; }
.pill-soldout   { background: #f1f5f9; color: #64748b; }
.btn-sm {
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-edit   { background: var(--primary); color: #fff; }
.btn-delete { background: #ef4444; color: #fff; }
.btn-toggle { background: var(--bg-light); color: var(--text); border: 1px solid var(--border); }

/* Admin form card */
.admin-form-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}
.admin-form-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 22px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.size-chart-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.size-chart-inputs .sc-row {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.size-chart-inputs .sc-row label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}
.size-chart-inputs .sc-row input {
  width: 100%;
  padding: 5px 8px;
  font-size: 13px;
}

/* Login box */
.login-wrap {
  max-width: 380px;
  margin: 100px auto;
  padding: 0 20px;
}
.login-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-card p { color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; }
.login-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, #a87b1a 100%);
  color: #fff;
  border-radius: 7px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(199,154,45,0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }
.btn-secondary {
  display: inline-block;
  padding: 11px 24px;
  background: transparent;
  color: var(--primary);
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

/* ===== FOOTER ===== */
.shop-footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 24px 5%;
  font-size: 13px;
  margin-top: 60px;
}
.shop-footer a { color: var(--accent); }
.shop-footer a:hover { color: #fff; }

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; gap: 32px; }
  .img-viewer { position: static; }
}
@media (max-width: 640px) {
  .shop-header { padding: 0 4%; }
  .shop-logo-text { font-size: 15px; }
  .customer-fields { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .size-chart-inputs { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 12px; }
  .admin-table td, .admin-table th { padding: 9px 10px; }
}
