/* ═══════════════════════════════════════════
   한국카케어전문학원 — Store (수강생·졸업생 전용)
   ═══════════════════════════════════════════ */

.store-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 80px 0 60px;
  text-align: center;
}
.store-hero h1 {
  font-size: var(--fs-h1);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.store-hero p {
  font-size: 17px;
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
.store-hero .store-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

/* 카테고리 탭 */
.store-tabs {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 10;
}
.store-tabs-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.store-tabs-left { display: flex; gap: 4px; }
.store-tab {
  background: none;
  border: none;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.store-tab:hover { color: var(--primary); }
.store-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.store-cart-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-light);
  transition: background 0.15s;
}
.store-cart-link:hover { background: var(--bg); }
.store-cart-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

/* 상품 그리드 */
.store-section { padding: 56px 0 80px; background: var(--bg-light); }
.store-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.product-img {
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-img-placeholder {
  font-size: 48px;
  color: var(--text-light);
  opacity: 0.4;
}
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.product-badge--out {
  background: #94a3b8;
}
.product-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 4px;
}
.product-spec {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 12px;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  margin-bottom: 14px;
}
.product-price {
  font-size: 20px;
  font-weight: 900;
  color: var(--dark);
}
.product-price-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  margin-left: 2px;
}
.product-stock {
  font-size: 12px;
  color: var(--text-light);
}
.product-stock--low { color: #ef4444; font-weight: 600; }
.btn-add {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add:hover { background: var(--primary-dark); }
.btn-add:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* 빈 상태 */
.store-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-light);
}
.store-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.store-empty h3 { font-size: 18px; color: var(--dark); margin-bottom: 8px; }

/* 안내 박스 */
.store-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.store-notice-icon { font-size: 22px; flex-shrink: 0; }
.store-notice-body { flex: 1; font-size: 14px; line-height: 1.6; color: #78350f; }
.store-notice-body strong { color: #92400e; }

/* 장바구니 페이지 */
.cart-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.cart-wrap h1 {
  font-size: var(--fs-h2);
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 8px;
}
.cart-wrap > p.lead {
  color: var(--text-sub);
  margin-bottom: 32px;
}
.cart-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 80px;
  height: 80px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-light);
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info-name { font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.cart-item-info-spec { font-size: 13px; color: var(--text-sub); }
.cart-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cart-qty button {
  width: 32px; height: 32px;
  background: var(--bg-light);
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
}
.cart-qty button:hover { background: var(--bg); }
.cart-qty input {
  width: 44px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
}
.cart-item-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  min-width: 90px;
  text-align: right;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}
.cart-item-remove:hover { color: #ef4444; }

.cart-summary {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.cart-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-sub);
  padding: 6px 0;
}
.cart-sum-total {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
}
.cart-sum-total strong { color: var(--primary); font-size: 22px; }

.cart-form {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.cart-form h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 20px;
}
.cart-form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.cart-form-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.cart-form-row input,
.cart-form-row select,
.cart-form-row textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.cart-form-row textarea { min-height: 80px; resize: vertical; }

.cart-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-secondary,
.btn-primary {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.05s;
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-light); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* ─── 인증 가드 ─── */
#store-guard {
  min-height: calc(100vh - 64px - 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--bg-light);
}
.guard-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.guard-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.guard-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 14px;
}
.guard-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
  margin-bottom: 24px;
}
.guard-card strong { color: var(--dark); font-weight: 700; }
.guard-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: guard-spin 0.7s linear infinite;
}
@keyframes guard-spin { to { transform: rotate(360deg); } }
.guard-btn-primary,
.guard-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  margin-bottom: 8px;
}
.guard-btn-primary {
  background: var(--primary);
  color: #fff;
}
.guard-btn-primary:hover { background: var(--primary-dark); }
.guard-btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.guard-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.guard-btn-secondary:hover { background: var(--border); }
.guard-note {
  font-size: 12px !important;
  color: var(--text-light) !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}
.guard-form {
  text-align: left;
  margin-top: 8px;
}
.guard-form label {
  display: block;
  margin-bottom: 14px;
}
.guard-form label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.guard-form input,
.guard-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.guard-form button { margin-top: 8px; }
.guard-info {
  text-align: left;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}
.guard-info strong { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-light); }

/* 반응형 */
@media (max-width: 1024px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .store-hero { padding: 56px 0 40px; }
  .store-tabs-inner { padding: 0 16px; }
  .store-tab { padding: 14px 14px; font-size: 14px; }
  .store-section { padding: 32px 0 60px; }
  .store-inner { padding: 0 16px; }
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-body { padding: 12px 14px 14px; }
  .product-name { font-size: 14px; }
  .product-price { font-size: 17px; }
  .btn-add { padding: 10px; font-size: 13px; }
  .cart-wrap { padding: 32px 16px 60px; }
  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 16px;
  }
  .cart-item-img { width: 60px; height: 60px; }
  .cart-qty { grid-column: 2; }
  .cart-item-price { grid-column: 2; text-align: left; min-width: 0; }
  .cart-item-remove { position: absolute; right: 16px; top: 16px; }
  .cart-form-row { grid-template-columns: 1fr; gap: 6px; }
  .cart-form { padding: 20px; }
  .cart-actions { flex-direction: column-reverse; }
  .cart-actions a, .cart-actions button { width: 100%; }
}
