/* 페이지 헤더 스타일 */
.container.my-5 h1 {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-primary-hover)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container.my-5 h2.text-center {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 2rem;
}

.gift-card-selection {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.gift-card-item {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.gift-card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  pointer-events: none;
  border-radius: 16px;
}

.gift-card-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(var(--theme-primary-rgb), 0.3);
  z-index: 5;
}

.gift-card-image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f8f9ff, #e8efff);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.gift-card-image img {
  max-height: 140px;
  max-width: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gift-card-item:hover .gift-card-image img {
  transform: scale(1.05);
}

.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  gap: 8px;
}

/* Order Progress Styles */
.order-progress {
  margin-bottom: 2rem;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 20px;
}

.progress-steps::before {
  content: '';
  position: absolute;
  height: 2px;
  background-color: #dee2e6;
  top: 15px;
  left: 5%;
  right: 5%;
  z-index: 1;
}

.progress-step {
  position: relative;
  text-align: center;
  z-index: 2;
  flex: 1;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f8f9fa;
  border: 2px solid #dee2e6;
  color: #6c757d;
  margin-bottom: 8px;
  font-weight: bold;
}

.step-text {
  font-size: 0.85rem;
  color: #6c757d;
  display: block;
}

.progress-step.active .step-icon {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  color: white;
}

.progress-step.active .step-text {
  color: var(--theme-primary);
  font-weight: bold;
}

.quantity-control .btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-control input {
  width: 60px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0 8px;
}

.summary-section {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 120px;
  z-index: 10;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 0;
  font-size: 0.95rem;
}

.summary-row.total {
  font-size: 1.3rem;
  font-weight: bold;
  border-top: 2px solid rgba(var(--theme-primary-rgb), 0.2);
  padding-top: 20px;
  margin-top: 15px;
  color: var(--theme-primary);
}

.bank-account-section {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.customer-info-section {
  background: rgba(248, 253, 255, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(13, 202, 240, 0.2);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 6px 24px rgba(13, 202, 240, 0.1);
}

.customer-info-section .alert {
  border-left: 4px solid #0dcaf0;
  background: rgba(240, 248, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
}

.bank-account-info {
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 12px;
  margin-top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 주문 완료 페이지 스타일 */
.recipient-info {
  background-color: #f0f7ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.recipient-info .alert {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* 브랜드 탭 스타일 */
.nav-tabs {
  border: none;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 12px;
  color: #6c757d;
  font-weight: 500;
  margin: 0 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  background: transparent;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  border-color: transparent;
  background: rgba(var(--theme-primary-rgb), 0.1);
  color: var(--theme-primary);
  transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-primary-hover)
  );
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), 0.3);
  transform: translateY(-2px);
}

.brand-logo {
  height: 22px;
  width: auto;
  margin-right: 8px;
  vertical-align: text-bottom;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 브랜드별 스타일 */
.tab-pane[id^='brand-'] .gift-card-item {
  position: relative;
}

/* 신세계 상품권 스타일 */
.tab-pane[id='brand-2'] .gift-card-item {
  border-color: #2d8c3c;
}

/* 롯데 상품권 스타일 */
.tab-pane[id='brand-3'] .gift-card-item {
  border-color: #d12121;
}

/* 컬쳐랜드 상품권 스타일 */
.tab-pane[id='brand-4'] .gift-card-item {
  border-color: #1d31b4;
}

/* 상품권 선택 버튼 및 입력 스타일 */
.quantity-control .btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 1px solid rgba(108, 117, 125, 0.3);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quantity-control .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.quantity-control .quantity-input {
  width: 70px !important;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.quantity-control .quantity-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.btn-reset {
  background: rgba(220, 53, 69, 0.1) !important;
  border: 1px solid rgba(220, 53, 69, 0.3) !important;
  color: #dc3545 !important;
  backdrop-filter: blur(10px);
  border-radius: 10px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-reset:hover {
  background: rgba(220, 53, 69, 0.2) !important;
  border-color: #dc3545 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Alert 스타일 개선 */
.alert {
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
}

.alert-info {
  background: rgba(209, 236, 241, 0.8);
  border-left: 4px solid #0dcaf0;
}

.alert-warning {
  background: rgba(255, 243, 205, 0.8);
  border-left: 4px solid #ffc107;
}

/* 주문 요약 개선 */
.summary-section h2.h4 {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 20px;
}

.summary-row:not(.total) {
  color: #6c757d;
}

.summary-row:not(.total) span:last-child {
  font-weight: 600;
  color: #343a40;
}

/* 반응형 디자인 */
@media (max-width: 991.98px) {
  .summary-section {
    position: relative;
    top: auto;
    z-index: auto;
    max-height: none;
    overflow-y: visible;
  }

  .gift-card-item {
    z-index: auto;
  }

  .gift-card-item:hover {
    z-index: auto;
  }
}

/* 태블릿 이하에서 hover 효과 전역 제거 */
@media (max-width: 768px) {
  /* 모든 hover 효과 제거 */
  * {
    transition: background-color 0.2s ease, border-color 0.2s ease,
      color 0.2s ease !important;
  }

  *:hover {
    transform: none !important;
    box-shadow: inherit !important;
  }

  .btn:hover:not([class*='btn-outline']) {
    transform: none !important;
    box-shadow: none !important;
  }

  .card:hover,
  .gift-card-item:hover,
  .container:hover,
  .row:hover {
    transform: none !important;
    box-shadow: inherit !important;
  }

  /* 네비게이션 hover도 제거 */
  .navbar-nav .nav-link:hover {
    transform: none !important;
    background: rgba(var(--theme-primary-rgb), 0.05);
  }

  .footer-links a:hover {
    transform: none !important;
  }

  .contact-item:hover {
    transform: none !important;
  }

  .social-links .btn:hover {
    transform: none !important;
    box-shadow: inherit !important;
  }
}

@media (max-width: 575.98px) {
  .container.my-5 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .gift-card-selection {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding: 15px 8px;
    border-radius: 12px;
  }

  .summary-section {
    margin-bottom: 20px;
    padding: 15px 8px;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 12px;
  }

  .row {
    margin-left: -3px;
    margin-right: -3px;
  }

  .row > [class*='col-'] {
    padding-left: 3px;
    padding-right: 3px;
  }

  .gift-card-item {
    padding: 15px 8px;
    margin-bottom: 10px;
    border-radius: 12px;
    /* 모바일에서 hover 효과 제거 */
    transform: none !important;
    transition: none;
  }

  .gift-card-item:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
  }

  /* 모바일에서 2개씩 배치를 위한 최적화 */
  .gift-card-item .fw-bold {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .gift-card-item small.text-muted {
    font-size: 0.8rem;
  }

  .gift-card-item .badge {
    font-size: 0.7rem;
    padding: 0.2em 0.4em;
  }

  .quantity-control {
    margin-top: 12px !important;
    gap: 4px;
  }

  .quantity-control .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.9rem;
    /* 모바일에서 버튼 hover 효과 제거 */
    transform: none !important;
    transition: background-color 0.2s ease;
  }

  .quantity-control .btn:hover {
    transform: none !important;
    box-shadow: none;
  }

  .quantity-control .quantity-input {
    width: 50px !important;
    height: 30px;
    padding: 0.2rem 0.25rem;
    font-size: 0.9rem;
    /* 모바일에서 input hover 효과 제거 */
    transition: border-color 0.2s ease;
  }

  .quantity-control .quantity-input:focus {
    border-color: var(--theme-primary);
    box-shadow: none;
    background: white;
  }

  .btn-reset {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    margin-top: 10px !important;
    /* 모바일에서 reset 버튼 hover 효과 제거 */
    transform: none !important;
    transition: background-color 0.2s ease;
  }

  .btn-reset:hover {
    transform: none !important;
    box-shadow: none;
  }

  /* 상품권 이미지 최적화 - 가로 잘림 방지 */
  .gift-card-image {
    height: 110px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
  }

  .gift-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* 모바일에서 이미지 hover 효과 제거 */
    transform: none !important;
    transition: none;
  }

  .gift-card-item:hover .gift-card-image img {
    transform: none !important;
  }

  /* 텍스트 간격 조정 */
  .gift-card-item .mt-2 {
    margin-top: 10px !important;
  }

  /* 컨테이너와 카드 hover 효과 모바일에서 제거 */
  .container:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.03);
  }

  .card:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .row:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: none !important;
  }
}

/* 초소형 모바일 (아이폰 SE 등) */
@media (max-width: 380px) {
  .container.my-5 {
    padding-left: 0.125rem;
    padding-right: 0.125rem;
  }

  .gift-card-selection,
  .summary-section {
    margin-left: -0.875rem;
    margin-right: -0.875rem;
    padding: 12px 6px;
  }

  .row {
    margin-left: -2px;
    margin-right: -2px;
  }

  .row > [class*='col-'] {
    padding-left: 2px;
    padding-right: 2px;
  }

  .gift-card-item {
    padding: 12px 6px;
    /* 초소형 모바일에서도 hover 효과 제거 */
    transform: none !important;
    transition: none;
  }

  .gift-card-item:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .gift-card-item .fw-bold {
    font-size: 0.9rem;
  }

  .quantity-control {
    gap: 3px;
  }

  .quantity-control .btn {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    /* 초소형에서도 버튼 hover 효과 제거 */
    transform: none !important;
    transition: background-color 0.2s ease;
  }

  .quantity-control .btn:hover {
    transform: none !important;
    box-shadow: none;
  }

  .quantity-control .quantity-input {
    width: 45px !important;
    height: 28px;
  }

  .btn-reset {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
    /* 초소형에서도 reset 버튼 hover 효과 제거 */
    transform: none !important;
    transition: background-color 0.2s ease;
  }

  .btn-reset:hover {
    transform: none !important;
    box-shadow: none;
  }

  .gift-card-image {
    height: 100px;
  }
}
