/* ============================================
   공동구매 팝업 모달 – 전용 스타일
   group-buy-modal.css
   ============================================ */

/* ── 오버레이 ── */
.gb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 20, 50, 0.72);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: gbOverlayIn .2s ease;
}
.gb-modal-overlay.open {
  display: flex;
}
@keyframes gbOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 모달 박스 ── */
.gb-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  animation: gbModalIn .25s cubic-bezier(.34,1.56,.64,1);
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.gb-modal::-webkit-scrollbar { width: 4px; }
.gb-modal::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
@keyframes gbModalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 닫기 버튼 ── */
.gb-close-btn {
  position: sticky;
  float: right;
  top: 16px;
  right: 16px;
  margin: 16px 16px -16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all .15s;
  z-index: 10;
  flex-shrink: 0;
}
.gb-close-btn:hover { background: #fee2e2; color: #dc2626; }

/* ── 헤더 ── */
.gb-modal-header {
  padding: 28px 32px 20px;
  background: linear-gradient(135deg, #1A3A6B 0%, #2F6DE0 60%, #5589E8 100%);
  color: #fff;
  border-radius: 20px 20px 0 0;
  text-align: center;
  margin-top: -50px;
  padding-top: 56px;
}
.gb-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 14px;
}
.gb-modal-title {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.gb-modal-desc {
  font-size: 14px;
  opacity: .88;
  line-height: 1.6;
}
.gb-modal-desc strong { color: #fde68a; }

/* ── 회차 탭 ── */
.gb-round-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 24px 0;
  flex-wrap: wrap;
}
.gb-round-tab-skeleton {
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gb-round-tab {
  padding: 8px 18px;
  border-radius: 30px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  font-family: inherit;
}
.gb-round-tab:hover { border-color: #2F6DE0; color: #2F6DE0; background: #eff6ff; }
.gb-round-tab.active {
  background: #2F6DE0;
  border-color: #2F6DE0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(47,109,224,.3);
}
.gb-round-tab.upcoming {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}
.gb-round-tab.upcoming.active {
  background: #64748b;
  border-color: #64748b;
  color: #fff;
}

/* ── 회차 정보 박스 ── */
.gb-round-info {
  margin: 14px 24px 0;
  border-radius: 14px;
  overflow: hidden;
}
.gb-round-info-inner {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1.5px solid #bfdbfe;
  border-radius: 14px;
  padding: 16px 20px;
}
.gb-round-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.gb-round-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
}
.gb-round-status-badge.ongoing  { background: #dcfce7; color: #15803d; }
.gb-round-status-badge.upcoming { background: #fef9c3; color: #a16207; }
.gb-round-status-badge.closed   { background: #f1f5f9; color: #64748b; }
.gb-round-period { font-size: 12px; color: #64748b; }
.gb-round-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gb-original-price {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
}
.gb-sale-price {
  font-size: 18px;
  font-weight: 900;
  color: #2F6DE0;
}
.gb-progress-wrap {}
.gb-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}
.gb-progress-labels strong { color: #111; }
.gb-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.gb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2F6DE0, #5589E8);
  border-radius: 99px;
  transition: width .6s ease;
}
.gb-urgency {
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
}

/* ── 신청 폼 ── */
.gb-form {
  padding: 20px 24px 24px;
}
.gb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.gb-field { display: flex; flex-direction: column; gap: 5px; }
.gb-field-full { grid-column: 1/-1; margin-bottom: 12px; }
.gb-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.gb-req { color: #dc2626; }
.gb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.gb-input-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.gb-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.gb-input:focus {
  border-color: #2F6DE0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47,109,224,.12);
}
.gb-input.error { border-color: #dc2626; background: #fff5f5; }
.gb-select { appearance: none; cursor: pointer; }
.gb-textarea {
  min-height: 80px;
  resize: vertical;
  padding: 10px 12px 10px 34px;
  line-height: 1.6;
}

/* ── 개인정보 동의 ── */
.gb-agree-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.gb-agree-wrap:hover { border-color: #2F6DE0; }
.gb-agree-chk { display: none; }
.gb-agree-box {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: all .15s;
  margin-top: 1px;
}
.gb-agree-chk:checked + .gb-agree-box {
  background: #2F6DE0;
  border-color: #2F6DE0;
}
.gb-agree-ico { color: #fff; font-size: 10px; display: none; }
.gb-agree-chk:checked + .gb-agree-box .gb-agree-ico { display: block; }
.gb-agree-text { font-size: 13px; color: #475569; line-height: 1.5; }
.gb-agree-text strong { color: #111; }
.gb-agree-text small { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }

/* ── 에러 메시지 ── */
.gb-error-msg {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 제출 버튼 ── */
.gb-submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #1A3A6B, #2F6DE0);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -.3px;
  box-shadow: 0 6px 20px rgba(47,109,224,.35);
  font-family: inherit;
}
.gb-submit-btn:hover {
  background: linear-gradient(135deg, #143060, #1e5bcc);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(47,109,224,.45);
}
.gb-submit-btn:active { transform: translateY(0); }
.gb-submit-btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.gb-submit-note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ── 완료 화면 ── */
.gb-success {
  padding: 48px 32px;
  text-align: center;
}
.gb-success-ico {
  font-size: 56px;
  color: #22c55e;
  margin-bottom: 20px;
  animation: gbSuccessIco .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes gbSuccessIco {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.gb-success h3 {
  font-size: 22px;
  font-weight: 900;
  color: #111;
  margin-bottom: 12px;
  letter-spacing: -.4px;
}
.gb-success p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 20px;
}
.gb-success-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 13px;
  color: #374151;
  line-height: 1.9;
  margin-bottom: 24px;
  text-align: left;
}
.gb-success-close-btn {
  padding: 13px 40px;
  background: linear-gradient(135deg, #1A3A6B, #2F6DE0);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.gb-success-close-btn:hover { opacity: .88; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .gb-modal { border-radius: 16px 16px 0 0; max-height: 94vh; }
  .gb-modal-overlay { align-items: flex-end; padding: 0; }
  .gb-form-grid { grid-template-columns: 1fr; }
  .gb-modal-header { padding: 20px 20px 16px; padding-top: 46px; }
  .gb-form { padding: 16px 16px 20px; }
  .gb-round-tabs { padding: 16px 16px 0; }
  .gb-round-info { margin: 12px 16px 0; }
}

/* ── 플로팅 공동구매 배너 ── */
.gb-float-banner {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 9000;
  background: linear-gradient(135deg, #1A3A6B, #2F6DE0);
  color: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 8px 28px rgba(47,109,224,.45);
  cursor: pointer;
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .2s, box-shadow .2s;
  max-width: 220px;
  text-align: left;
  animation: gbFloatPulse 2.5s ease-in-out infinite;
}
.gb-float-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(47,109,224,.55);
}
@keyframes gbFloatPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(47,109,224,.45); }
  50%       { box-shadow: 0 8px 36px rgba(47,109,224,.7); }
}
.gb-float-ico {
  font-size: 22px;
  flex-shrink: 0;
}
.gb-float-text {}
.gb-float-label {
  font-size: 11px;
  font-weight: 700;
  opacity: .8;
  letter-spacing: .04em;
  display: block;
}
.gb-float-cta {
  font-size: 13px;
  font-weight: 900;
  display: block;
  letter-spacing: -.2px;
}
.gb-float-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #64748b;
  border: none;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.gb-float-close:hover { background: #dc2626; }

@media (max-width: 480px) {
  .gb-float-banner { left: 12px; bottom: 80px; max-width: 190px; }
}

/* ── 오늘 하루 안 보기 ── */
.gb-today-close-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafbff;
  border-radius: 0 0 20px 20px;
}
.gb-today-close-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  user-select: none;
}
.gb-today-close-label input[type="checkbox"] {
  display: none;
}
.gb-today-close-box {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
  background: #fff;
}
.gb-today-close-ico {
  font-size: 10px;
  color: #fff;
  display: none;
}
.gb-today-close-label input:checked + .gb-today-close-box {
  background: #2F6DE0;
  border-color: #2F6DE0;
}
.gb-today-close-label input:checked + .gb-today-close-box .gb-today-close-ico {
  display: block;
}
.gb-dismiss-btn {
  padding: 7px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.gb-dismiss-btn:hover {
  border-color: #2F6DE0;
  color: #2F6DE0;
  background: #eff6ff;
}
