/*
 Theme Name: Storefront Child
 Template: storefront
 Text Domain: storefront-child
*/

/* ==== Premium Product Page ============================== */

.custom-product-page {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  max-width: 1400px;
  margin: 60px auto;
  padding: 0 20px;
  align-items: flex-start;
}

.product-gallery {
  flex: 2;
  min-width: 500px;
}

.product-info {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 상품명 */
.product-info .product_title {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  color: #111;
  line-height: 1.3;
}

/* 가격 */
.product-info .price {
  font-size: 24px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

/* 장바구니 버튼 */
.single_add_to_cart_button {
  background: #111;
  color: #fff;
  padding: 16px 28px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.single_add_to_cart_button:hover {
  background: #444;
}

/* 메인 이미지 */
.product-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* 썸네일 (가로 배열) */
.product-gallery .flex-control-thumbs {
  display: flex !important;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.product-gallery .flex-control-thumbs li {
  flex: 0 0 auto;
}

.product-gallery .flex-control-thumbs img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.product-gallery .flex-control-thumbs img:hover {
  transform: scale(1.05);
  border-color: #111;
}

/* Related products - 카드형 */
.related.products {
  max-width: 1400px;
  margin: 80px auto;
  padding: 0 20px;
}

.related.products h2 {
  font-size: 24px;
  margin-bottom: 24px;
  font-weight: 700;
}

.related.products ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.related.products ul.products li.product {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  transition: box-shadow 0.3s ease;
}

.related.products ul.products li.product:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .custom-product-page { flex-direction: column; gap: 40px; }
  .product-info .product_title { font-size: 28px; }
  .product-info .price { font-size: 20px; }
  .product-gallery .flex-control-thumbs img { width: 70px; height: 70px; }
}

/* === Force white background across all wrappers === */
body,
.site,
#page,
#content,
.site-content,
.content-area,
.site-main,
.col-full,
.hentry,
.page-header,
.storefront-breadcrumb,
.storefront-breadcrumb .col-full,
.woocommerce,
.woocommerce-account,
.woocommerce-cart,
.woocommerce-checkout,
.woocommerce-products-header,
.archive .woocommerce-products-header,
.wc-block-components-main,
.wc-block-components-sidebar {
  background: #fff !important;
}

/* 회색 스트립/테두리 제거 */
.page-header,
.storefront-breadcrumb,
.woocommerce-products-header {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

/* 필요 시 상단 여백만 유지하고 색만 흰색 */
.woocommerce-products-header,
.page-header {
  padding-top: 24px;
  padding-bottom: 24px;
}

/* === 푸터 스타일 통합 (배경 + 정렬 통합) === */
.site-footer {
  background-color: #f5f5f5 !important;  /* 회색 배경 유지 */
  max-width: 1200px;                    /* 상품 영역과 동일 폭 */
  margin: 0 auto;
  padding: 40px 20px;                   /* 상품과 동일 좌우 여백 (20px) */
  box-sizing: border-box;
  color: #333;                          /* 글자색 통일 */
  font-size: 0.95rem;                   /* 조금 작은 균형 텍스트 */
  line-height: 1.6;
}

/* 푸터 내부 섹션(사업자 정보, 사이트 정보) 동일한 회색 유지 */
.site-footer .col-full,
.site-footer .site-info {
  background-color: #f5f5f5 !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 텍스트 좌측 정렬 (상품 시작 라인과 시각적 일치) */
.site-footer p,
.site-footer div,
.site-footer span {
  text-align: left !important;
  margin-left: 0;
}

/* 링크 스타일 조정 (약관, 개인정보 등) */
.site-footer a {
  color: #0073aa;
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* 푸터 하단 카피라이트 부분 정리 */
.site-footer .site-info {
  border-top: 1px solid #ddd;
  margin-top: 20px;
  padding-top: 10px;
  font-size: 0.9rem;
  text-align: left;
  color: #666;
}

/* === 내 계정 페이지 스타일 개선 === */
.woocommerce-account .woocommerce {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  gap: 40px;
}

.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
  flex: 1;
  background: #fff;
  padding: 30px 25px;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.woocommerce-account h2 {
  font-size: 22px;
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
}

.woocommerce-account form input.input-text {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 16px;
}

.woocommerce-account button.button {
  background: #111;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.woocommerce-account button.button:hover {
  background: #333;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .woocommerce-account .woocommerce {
    flex-direction: column;
    gap: 20px;
    margin: 20px auto;
    padding: 0 15px;
  }
  .woocommerce-account .u-column1,
  .woocommerce-account .u-column2 {
    padding: 20px;
  }
  .woocommerce-account h2 {
    font-size: 20px;
  }
}
/* === 상품 리스트 여백 및 타이틀 정돈 === */
.woocommerce-products-header {
  display: none !important; /* "상점" 제목 제거 */
}

.archive.woocommerce .woocommerce-products-header__title.page-title {
  display: none !important;
}

.archive.woocommerce ul.products {
  margin-top: 10px !important;
  padding-top: 0 !important;
}

/* PC 버전에서 여백 조정 */
@media (min-width: 1024px) {
  .site-main {
    padding-top: 50px !important;
  }
  .woocommerce-result-count,
  .woocommerce-ordering {
    margin-top: 5px !important;
    margin-bottom: 20px !important;
  }
  ul.products {
    margin-top: 20px !important;
  }
}

/* === 헤더 로고(Arcane Market)와 상품 이미지 수평 정렬 보정 === */
.storefront-full-width-content .col-full,
.archive.woocommerce .col-full,
.archive.woocommerce .site-main,
.archive.woocommerce .content-area {
  max-width: 100% !important;   /* Storefront 기본 1200px 제한 해제 */
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* 상품 목록 전체를 화면 폭에 맞게 */
.archive.woocommerce ul.products {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 60px !important;   /* ← Arcane Market 로고 좌측 정렬 맞춤 */
  padding-right: 60px !important;
  max-width: 1400px !important;   /* 실제 카드 너비 제한 */
  box-sizing: border-box;
}

/* 상품 카드의 정렬 균형 */
.archive.woocommerce ul.products li.product {
  flex: 0 1 calc(25% - 40px);  /* 4열 그리드 기준 */
  box-sizing: border-box;
}

/* 상품이 적을 때 가운데 정렬 */
.archive.woocommerce ul.products:only-child,
.archive.woocommerce ul.products li.product:last-child {
  justify-content: center;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .archive.woocommerce ul.products {
    padding-left: 15px !important;
    padding-right: 15px !important;
    gap: 20px;
  }
  .archive.woocommerce ul.products li.product {
    flex: 0 1 calc(50% - 20px);
  }
}
/* ======= 상품 목록 커스터마이징 (Arcane Market 버전) ======= */

/* 상품 제목: 최대 4줄 고정 + 중앙정렬 */
.product-title-box {
  min-height: 5.6em; /* 약 4줄 기준 */
  line-height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  text-align: center;
  font-size: 0.95rem;
}

/* 제목 링크 색상 제어: 기본 검정, hover·visited 보라 */
.product-title-box a,
.woocommerce-loop-product__title a {
  color: #000 !important; /* 평소 검정 */
  text-decoration: none !important;
  transition: color 0.2s ease-in-out;
}

.product-title-box a:hover,
.woocommerce-loop-product__title a:hover {
  color: #7F54B3 !important; /* 클릭 직전 hover */
  opacity: 0.9;
}

.product-title-box a:visited,
.woocommerce-loop-product__title a:visited {
  color: #7F54B3 !important; /* 클릭 후 (방문) */
}

/* 가격 */
.product-price-box {
  text-align: center;
  font-weight: 600;
  color: #000 !important; /* 항상 검정 */
  font-size: 1rem;
  margin-bottom: 0.8em;
}

/* "옵션 선택" 버튼 숨김 */
li.product .button {
  display: none !important;
}

/* 카드 정렬 및 여백 안정화 */
.product-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

ul.products li.product {
  margin-bottom: 30px !important;
}
