/*
Theme Name: Woodmart Child
Template: woodmart
Version: 1.0.0
*/

/* ============================================
   1. 로고 크기 - 스크롤 반응형
   ============================================ */

/* 일반 상태 (스크롤 전) */
.site-logo img,
.wd-logo img,
.wd-header-logo img {
  max-height: 85px !important;
  width: auto !important;
  transition: max-height 0.3s ease !important;
}

/* Sticky 헤더 (스크롤 후) */
.wd-header.wd-header-sticky .site-logo img,
.wd-header.wd-header-sticky .wd-logo img,
.wd-header.wd-header-sticky .wd-header-logo img,
.header-clone .site-logo img,
.header-clone .wd-logo img,
.header-clone .wd-header-logo img {
  max-height: 60px !important;
}

/* 모바일 */
@media (max-width: 768px) {
  .site-logo img,
  .wd-logo img,
  .wd-header-logo img {
    max-height: 85px !important;
  }
  
  .wd-header.wd-header-sticky .site-logo img,
  .wd-header.wd-header-sticky .wd-logo img,
  .header-clone .site-logo img,
  .header-clone .wd-logo img {
    max-height: 60px !important;
  }
}

/* ============================================
   2. 우드마트 기본 검색 완전 숨김
   ============================================ */

/* 검색 Form 숨김 */
.wd-header-search .searchform,
.wd-header-search-form,
.wd-search-full-screen,
.wd-dropdown-search,
.wd-search-dropdown {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* "Search for products" input 숨김 */
.wd-header-search input[type="text"],
.wd-header-search input[type="search"],
.wd-header-search .search-field {
  display: none !important;
}

/* 검색 아이콘만 보이게 */
.wd-header-search {
  display: flex !important;
  align-items: center !important;
}

.wd-header-search .wd-tools-icon,
.wd-header-search > a {
  display: flex !important;
  cursor: pointer !important;
}

/* ============================================
   3. 사보이 검색 오버레이
   ============================================ */

.mp-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.mp-search-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mp-search-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 1;
}

.mp-search-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s;
  z-index: 2;
}

.mp-search-overlay.active .mp-search-container {
  transform: translateY(0);
}

.mp-search-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.mp-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  padding: 10px;
  color: #333;
  background: transparent;
}

.mp-search-input::placeholder {
  color: #999;
}

.mp-search-close {
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mp-search-close:hover {
  background: #e0e0e0;
}

.mp-search-results {
  max-height: 500px;
  overflow-y: auto;
  background: #fff;
}

.mp-search-loading,
.mp-no-results,
.mp-search-error {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 15px;
}

.mp-results-list {
  display: flex;
  flex-direction: column;
}

.mp-result-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-bottom: 1px solid #f5f5f5;
}

.mp-result-item:hover {
  background: #f9f9f9;
}

.mp-result-item:last-child {
  border-bottom: none;
}

.mp-result-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  margin-right: 15px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}

.mp-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-result-content {
  flex: 1;
  min-width: 0;
}

.mp-result-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mp-result-price {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

body.mp-search-open {
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .mp-search-overlay {
    padding-top: 60px;
  }
  
  .mp-search-container {
    margin: 0 15px;
  }
  
  .mp-search-input {
    font-size: 16px;
  }
  
  .mp-result-image {
    width: 60px;
    height: 60px;
  }
}