/* product.css */

:root {
  --pd-line: #e7e2dd;
  --pd-ink: #151515;
  --pd-muted: #6e6962;
  --pd-page-top: 126px;
  --pd-sidebar-top: 126px;
}

.pd-product-main {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding-top: var(--pd-page-top);
  background: #fff;
  color: var(--pd-ink);
  border-left: 1px solid var(--pd-line);
  border-right: 1px solid var(--pd-line);
}

.pd-product-sidebar {
  position: sticky;
  top: var(--pd-sidebar-top);
  align-self: start;
  height: calc(100vh - var(--pd-sidebar-top));
  display: block;
  border-right: 1px solid var(--pd-line);
  background: #fbfaf8;
  z-index: 5;
  transition: top 0.28s ease, height 0.28s ease;
  overflow-y: auto;
}

.pd-brand-column {
  min-width: 0;
  width: 100%;
}

.pd-brand-item {
  border-bottom: 1px solid var(--pd-line);
}

.pd-brand-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pd-ink);
  text-align: left;
  padding: 18px 24px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pd-brand-btn:hover {
  background: #f4f1ed;
}

.pd-brand-btn.is-active {
  color: var(--primary-color);
  background: #fff;
  font-weight: 800;
}

.pd-brand-btn.is-brand-active {
  color: var(--accent-color) !important;
  background: rgba(184, 137, 107, 0.05);
  font-weight: 800;
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
}

.pd-brand-btn.is-brand-active:hover {
  background: rgba(184, 137, 107, 0.1);
}

.pd-brand-btn.is-brand-active.is-active {
  background: #fff;
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
}

.pd-brand-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: var(--pd-muted);
}

.pd-brand-btn.is-active .pd-brand-arrow {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.pd-sidebar-mobile-header {
  display: none;
}

.pd-sidebar-product-list {
  display: none;
  background: #faf9f6;
  border-top: 1px solid rgba(0,0,0,0.03);
}

.pd-sidebar-product-link {
  display: block;
  padding: 14px 36px;
  font-size: 13px;
  color: var(--pd-muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.pd-sidebar-product-link:hover {
  background: #f4f1ed;
  color: var(--pd-ink);
}

.pd-sidebar-product-link.is-active {
  color: var(--primary-color);
  background: #fff;
  font-weight: 700;
  border-left: 3px solid var(--primary-color);
  padding-left: 33px;
}

.pd-product-content {
  min-width: 0;
  background: #fff;
}

.pd-hero {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, 0.95fr);
  min-height: calc(100vh - var(--pd-page-top));
  border-bottom: 1px solid var(--pd-line);
}

.pd-hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 620px;
  padding: 0;
  background: #f6f4f1;
  overflow: hidden;
  position: relative;
}

.pd-main-img {
  display: block;
  width: auto;
  height: 75%;
  max-width: 100%;
  max-height: 75%;
  object-fit: contain;
}

.pd-hero-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px clamp(36px, 7vw, 112px) 72px clamp(36px, 5vw, 88px);
  background: #fbfaf8;
}

.pd-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: #383530;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-product-name {
  margin: 0;
  color: var(--pd-ink);
  font-size: clamp(40px, 2vw, 68px);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0;
}

.pd-product-desc {
  margin: 32px 0 0;
  padding-top: 34px;
  border-top: 1px solid var(--pd-line);
  color: var(--pd-muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
}

.pd-meta-list {
  display: grid;
  gap: 0;
  margin: 30px 0 0;
  border-top: 1px solid var(--pd-line);
}

.pd-meta-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--pd-line);
}

.pd-meta-label,
.pd-meta-value {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.pd-meta-label {
  color: #383530;
  font-weight: 800;
}

.pd-meta-value {
  color: var(--pd-muted);
}

.pd-inquiry-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 28px;
  border: 1px solid var(--pd-ink);
  border-radius: 0;
  background: var(--pd-ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pd-inquiry-btn:hover {
  background: #fff;
  color: var(--pd-ink);
  transform: translateY(-1px);
}

.pd-store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  border: 1px solid #03C75A;
  border-radius: 0;
  background: #03C75A;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pd-store-btn:hover {
  background: #02b350;
  border-color: #02b350;
  color: #fff;
  transform: translateY(-1px);
}

.pd-store-icon {
  width: 16px;
  height: 16px;
}

.pd-detail-area {
  background: #fff;
  padding-bottom: 86px;
}

.pd-detail-toggle {
  width: 100%;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(28px, 7vw, 108px);
  border-bottom: 1px solid var(--pd-line);
  background: #fff;
  color: var(--pd-ink);
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 800;
  text-align: center;
}

.pd-gallery-list {
  display: flex;
  flex-direction: column;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 48px 24px 84px;
}

.pd-bottom-inquiry {
  width: min(100% - 48px, 520px);
  margin: 0 auto;
  background: #fff;
}

.pd-gallery-item {
  width: 100%;
}

.pd-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.pd-gallery-empty {
  padding: 80px 20px;
  color: var(--pd-muted);
  text-align: center;
  border: 1px solid var(--pd-line);
  background: #fbfaf8;
}

.top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
}

.top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-btn:hover {
  background: var(--accent-color-dark);
}

#inquiryModal .modal-content {
  border-radius: 24px;
  background: #ffffff;
  border: none;
  box-shadow: 0 20px 40px rgba(45, 36, 32, 0.15);
}

#inquiryModal .form-label {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

#inquiryModal .form-control,
#inquiryModal .form-select {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  background-color: #faf9f8;
  color: var(--text-main);
  transition: all 0.3s ease;
}

#inquiryModal .form-control:focus,
#inquiryModal .form-select:focus {
  border-color: var(--accent-color);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(184, 137, 107, 0.15);
  outline: none;
}

#inquiryModal .btn-close {
  background-color: #faf7f5;
  padding: 0.75rem;
  border-radius: 50%;
  z-index: 5;
  transition: all 0.2s ease;
}

#inquiryModal .btn-close:hover {
  background-color: #f0ece8;
  transform: rotate(90deg);
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --pd-page-top: 96px;
    --pd-sidebar-top: 72px;
  }

  .pd-product-main {
    display: block;
  }

  .pd-product-sidebar {
    position: sticky;
    top: var(--pd-sidebar-top);
    height: auto;
    max-height: 360px;
    overflow-y: auto;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--pd-line);
    background: #fbfaf8;
    z-index: 99;
    transition: top 0.4s ease-in-out, max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .pd-product-sidebar.is-mobile-collapsed {
    height: 30px !important;
    max-height: 30px !important;
    overflow: hidden !important;
    border-bottom: 1px solid var(--pd-line);
    background: #fbfaf8;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-item {
    display: none !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-item.has-active-brand {
    display: block !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-btn {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #fbfaf8 !important;
    border: none !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-arrow {
    transform: none !important;
    color: var(--accent-color) !important;
  }

  .pd-sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pd-line);
    background: #fff;
  }

  .pd-sidebar-mobile-header span {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
  }

  .pd-sidebar-close-btn {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: var(--pd-muted);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
  }

  .pd-sidebar-close-btn:hover {
    color: var(--primary-color);
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-sidebar-mobile-header {
    display: none !important;
  }

  .pd-brand-column {
    display: block;
    width: 100%;
    border: 0;
  }

  .pd-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .pd-hero-media {
    min-height: 460px;
    padding: 0;
  }

  .pd-main-img {
    width: auto;
    height: 75%;
    max-width: 100%;
    max-height: 75%;
    object-fit: contain;
  }

  .pd-hero-summary {
    padding: 42px 22px 52px;
  }

  .pd-product-name {
    font-size: clamp(40px, 2vw, 68px);
  }
}

@media (max-width: 767px) {
  :root {
    --pd-page-top: 96px;
    --pd-sidebar-top: 72px;
  }

  .pd-product-main {
    display: block;
  }

  .pd-product-sidebar {
    position: sticky;
    top: var(--pd-sidebar-top);
    height: auto;
    max-height: 360px;
    overflow-y: auto;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--pd-line);
    background: #fbfaf8;
    z-index: 99;
    transition: top 0.4s ease-in-out, max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .pd-product-sidebar.is-mobile-collapsed {
    height: 30px !important;
    max-height: 30px !important;
    overflow: hidden !important;
    border-bottom: 1px solid var(--pd-line);
    background: #fbfaf8;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-item {
    display: none !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-item.has-active-brand {
    display: block !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-btn {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #fbfaf8 !important;
    border: none !important;
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-brand-arrow {
    transform: none !important;
    color: var(--accent-color) !important;
  }

  .pd-sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pd-line);
    background: #fff;
  }

  .pd-sidebar-mobile-header span {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
  }

  .pd-sidebar-close-btn {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: var(--pd-muted);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
  }

  .pd-sidebar-close-btn:hover {
    color: var(--primary-color);
  }

  .pd-product-sidebar.is-mobile-collapsed .pd-sidebar-mobile-header {
    display: none !important;
  }

  .pd-brand-column {
    display: block;
    width: 100%;
    border: 0;
  }

  .pd-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .pd-hero-media {
    min-height: 420px;
    padding: 0;
  }

  .pd-main-img {
    width: auto;
    height: 75%;
    max-width: 100%;
    max-height: 75%;
    object-fit: contain;
  }

  .pd-hero-summary {
    padding: 42px 22px 52px;
  }

  .pd-product-name {
    font-size: clamp(25px, 8vw, 48px);
  }

  .pd-product-desc {
    margin-top: 24px;
    padding-top: 24px;
    font-size: 15px;
  }

  .pd-detail-toggle {
    min-height: 70px;
    padding: 0 22px;
  }

  .pd-gallery-list {
    padding: 30px 0 44px;
  }
}

@media (max-width: 575px) {
  :root {
    --pd-page-top: 86px;
    --pd-sidebar-top: 64px;
  }

  .pd-product-main {
    padding-top: var(--pd-page-top);
  }

  .pd-hero-media {
    min-height: 360px;
    padding: 0;
  }

  .pd-main-img {
    width: auto;
    height: 75%;
    max-width: 100%;
    max-height: 75%;
    object-fit: contain;
  }

  .pd-meta-row {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
  }

  .pd-meta-label,
  .pd-meta-value {
    font-size: 13px;
  }

  .top-btn {
    right: 1rem;
    bottom: 1rem;
  }
}
