/* 검색 페이지 스타일 */
.search-container {
    padding: 1rem;
    min-height: calc(100vh - 120px);
}

/* 검색 폼 섹션 */
.search-form-section {
    background: #ffffff;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-type-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-type-item {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.search-type-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.search-type-item span {
    display: block;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-type-item input[type="radio"]:checked + span {
    background: var(--primary-color, #008f8c);
    color: #ffffff;
    border-color: var(--primary-color, #008f8c);
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary-color, #008f8c);
}

.search-btn {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color, #008f8c);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: #007a77;
}

/* 최근 검색어 섹션 */
.recent-searches-section {
    background: #ffffff;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.result-count {
    color: var(--primary-color, #008f8c);
    font-weight: 600;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.recent-searches-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.recent-search-text {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
}

.delete-search-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.delete-search-btn:hover {
    opacity: 1;
}

.delete-search-btn img {
    width: 16px;
    height: 16px;
}

/* 검색 결과 섹션 */
.search-results-section {
    background: #ffffff;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 상품 그리드 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-item {
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .jjim-on {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.product-image .jjim-on img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    position: relative;
}

.product-info {
    padding: 0.75rem;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 0.85rem;
    color: var(--primary-color, #008f8c);
    font-weight: 600;
}

/* 알쓸정보 리스트 */
.contents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.content-item:hover {
    background: #f8f9fa;
}

.content-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.content-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 더보기 버튼 */
.load-more-section {
    text-align: center;
    padding: 1rem 0;
}

.load-more-btn {
    padding: 0.875rem 2rem;
    background: #ffffff;
    color: var(--primary-color, #008f8c);
    border: 1px solid var(--primary-color, #008f8c);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.load-more-btn:hover {
    background: var(--primary-color, #008f8c);
    color: #ffffff;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 검색 결과 없음 */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.no-results p {
    margin: 0;
    font-size: 1rem;
}

/* Lazy loading 이미지 스타일 */
.search-container img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.search-container img[loading="lazy"].loaded {
    opacity: 1;
}

/* 태블릿 이상 */
@media (min-width: 768px) {
    .search-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .search-form-section {
        padding: 2rem;
    }

    .search-type-group {
        max-width: 400px;
        margin: 0 auto 1.5rem;
    }

    .content-item {
        padding: 1rem;
    }

    .content-image {
        width: 100px;
        height: 100px;
    }

    .content-title {
        font-size: 1rem;
    }
}

/* 데스크톱 */
@media (min-width: 1024px) {
    .search-input-group {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* 추천딜 배너 섹션 */
.pick-deals-banner-section {
    overflow: hidden;
}

.pick-deal-banner-wrapper {
    display: block;
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.pick-deal-banner-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.pick-deal-banner-wrapper:hover img {
    transform: scale(1.02);
}

.pick-deal-reason {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

/* 추천딜 Swiper 슬라이더 스타일 */
.pick-deal-banner-swiper {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.pick-deal-banner-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}

.pick-deal-banner-swiper .swiper-pagination {
    bottom: 8px;
}

.pick-deal-banner-swiper .swiper-pagination-bullet {
    background: #ffffff;
    opacity: 0.6;
    width: 6px;
    height: 6px;
}

.pick-deal-banner-swiper .swiper-pagination-bullet-active {
    background: var(--primary-color, #008f8c);
    opacity: 1;
    width: 18px;
    border-radius: 3px;
}

/* 추천딜 배너 반응형 */
@media (min-width: 768px) {
    .pick-deal-banner-wrapper,
    .pick-deal-banner-swiper {
        height: 150px;
    }

    .pick-deal-reason {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
}

@media (min-width: 1024px) {
    .pick-deal-banner-wrapper,
    .pick-deal-banner-swiper {
        height: 180px;
    }

    /* 검색 컨테이너 */
    .search-container {
        max-width: 768px;
        margin: 0 auto;
    }

    /* 검색 헤더 */
    .search-header {
        padding: 2rem 3rem;
    }

    /* 검색 입력창 중앙 정렬 */
    .search-input-wrapper {
        max-width: 600px;
        margin: 0 auto;
    }

    /* 검색 결과 그리드 */
    .search-results-grid {
        padding: 0 3rem;
    }
}

/* ========================================
   PC 대화면 (1400px+)
   ======================================== */
@media (min-width: 1400px) {
    /* 검색 결과 그리드 5열 */
    .search-results-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
