/* 모바일 섹션 타이틀 기본 숨김 (1020px 이하에서만 표시) */
.mobile-section-title { display: none; }

/* 모바일 액션 버튼 기본 숨김 (1020px 이하에서만 표시) */
.basic-buttons.basic-buttons-mobile { display: none; }

/* 바이어 리스트 카드형 레이아웃 (1350px 이하) */
@media (max-width: 1350px) {
	/* 테이블 헤더 숨김 */
	.buyer-list-header {
		display: none;
	}

	/* 테이블을 block으로 변경 */
	.buyer-list-container,
	.buyer-list-body {
		display: block;
	}

	/* 각 행을 카드로 변경 */
	.buyer-list-row {
		display: flex;
		flex-wrap: wrap;
		gap: 5px 0px;
		padding: 20px;
		margin-bottom: 15px;
		border: 1px solid #ddd;
		border-radius: 8px;
		background: #fff;
	}

	/* 모든 td 기본 스타일 초기화 */
	.buyer-list-row td {
		padding: 0;
		border: none;
		background: none;
		font-size:15px;
	}

	/* 첫 번째 줄: 바이어구분 + 기업명 + | + 국가 */
	.buyer-col-type {
		width:auto;
		order: -5;
		flex: 0 0 auto;
		margin-bottom:10px;
		
	}
	.buyer-col-btype {
		width: auto;
	}

	.buyer-col-company {
		order: -4;
		width:auto;
		flex: 0 0 auto;
		align-self: center;
		margin-left: 8px;
		margin-bottom:10px;
	}

	.buyer-col-country {
		order: -4;
		width:auto;
		flex: 0 0 auto;
		align-self: center;
		font-size: 16px;
		margin-right:15px;
	}

	.buyer-col-company .buyer-items-wrapper {
		display: inline;
	}

	.buyer-col-company .buyer-company-name {
		font-size: 16px;
		font-weight: bold;
		color: #002244;
		text-decoration: none;
	}

	.buyer-col-company .buyer-company-name:hover {
		text-decoration: underline;
	}

	.buyer-col-company .buyer-toggle-detail-btn {
		display: none;
	}

	/* 정보 컨테이너 (국가+업종/업태, 연간매출액+연간구매예산 묶음) */
	.buyer-info-wrapper-container {
		display: flex;
		gap: 0;
		order: -4;
		width: 100%;
		flex-wrap:wrap;
	}

	/* 두 번째 줄: 국가 + 업종/업태 */
	.buyer-info-wrapper-1 {
		display: flex;
		align-items: flex-start;
		flex-wrap: wrap;
		font-size: 15px;
		gap: 0;
	}

	.buyer-info-wrapper-1 .buyer-col-country,
	.buyer-info-wrapper-1 .buyer-col-btype {
		display: flex;
		align-items: flex-start;
		padding: 0;
		border: none;
		background: none;
		font-size: 15px;
		margin-top: 5px;
		text-align: left;
	}

	/* 국가는 flex-shrink를 0으로 설정하여 줄바꿈 방지 */
	.buyer-info-wrapper-1 .buyer-col-country {
		flex: 0 0 auto;
		margin-right: 25px;
	}

	/* 업종/업태는 flex-grow를 1로 설정하여 남은 공간 차지, 필요시 줄바꿈 */
	.buyer-info-wrapper-1 .buyer-col-btype {
		flex: 1 1 auto;
		min-width: 0; /* flex item이 줄바꿈될 수 있도록 */
		padding-right: 0px !important;
	}

	.buyer-info-wrapper-1 .buyer-col-country::before {
		content: attr(data-label) ' : ';
		font-weight: 600;
		color: #333;
		margin-right: 5px;
		white-space: nowrap;
	}

	.buyer-info-wrapper-1 .buyer-col-btype::before {
		content: attr(data-label) ' : ';
		font-weight: 600;
		color: #333;
		margin-right: 5px;
		white-space: nowrap;
	}

	/* 세 번째 줄: 연간매출액 + 연간구매예산 */
	.buyer-info-wrapper-2 {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		font-size: 15px;
	}

	.buyer-info-wrapper-2 .buyer-col-turnover,
	.buyer-info-wrapper-2 .buyer-col-purchasing {
		width: auto;
		display: flex;
		align-items: center;
		flex-wrap:wrap;
		padding: 0;
		padding-right: 25px;
		border: none;
		background: none;
		font-size: 15px;
		margin-top: 5px;
	}

	.buyer-info-wrapper-2 .buyer-col-turnover::before {
		content: attr(data-label) ' : ';
		font-weight: 600;
		color: #333;
		margin-right: 5px;
		white-space: nowrap;
	}

	.buyer-info-wrapper-2 .buyer-col-purchasing::before {
		content: attr(data-label) ' : ';
		font-weight: 600;
		color: #333;
		margin-right: 5px;
		white-space: nowrap;
	}

	/* br 태그 숨김 */
	.buyer-col-turnover br,
	.buyer-col-purchasing br {
		display: none;
	}
	/* 세 번째 줄: 관심품목 */
	.buyer-col-items {
		display:flex;align-items:center;
		order: -2;
		width: 100%;
		margin-top:5px;
		margin-bottom:10px;
	}

	.buyer-col-items::before {
		content: attr(data-label) ' : ';
		font-weight: 600;
		color: #333;
		margin-right:5px;
		white-space: nowrap;
	}
	.buyer-col-items{align-items:flex-start;}

	/* 네 번째 줄: 상세보기 + 즐겨찾기 */
	.buyer-col-action {
		width:auto;
		order: -1;
	}

	.buyer-btn-detail {
		padding: 8px 20px;
		font-size: 14px;
	}

	.buyer-col-favorite {
		order: -1;
		margin-left: auto;
		flex: 0 0 auto;
	}

	/* 관심품목 영역 */
	.buyer-items-wrapper {
		display: block;
		max-height: calc(1.4em * 3);
		position: relative;
		line-height: 1.4;
		overflow: hidden;
	}

	.buyer-items-wrapper.expanded {
		max-height: none;
		overflow: visible;
	}

	.buyer-items-text {
		display: inline;
		word-break:keep-all;
	}

	/* 3줄 넘을 때 ... 표시 */
	.buyer-items-wrapper.has-more::after {
		content: '...';
		position: absolute;
		right: 20px;
		bottom: 0;
		background: #fff;
		padding-left: 5px;
	}

	.buyer-items-wrapper.expanded::after {
		display: none;
	}

	/* 초청바이어 ... 배경색 */
	.buyer-list-body tr.buyer_type1 .buyer-items-wrapper.has-more::after {
		background-color: floralwhite;
	}

	/* 토글 버튼 - 기본 숨김, JS에서 필요시 표시 */
	.buyer-toggle-detail-btn {
		display: none;
		background: #fff;
		border: none;
		color: #888;
		cursor: pointer;
		padding: 0 0 0 8px;
		margin: 0;
		font-size: 14px;
		line-height: 1.4;
		vertical-align: baseline;
		transition: transform 0.3s ease, color 0.2s ease;
		position: absolute;
		right: 0;
		bottom: 0;
	}

	.buyer-toggle-detail-btn.show {
		display: inline-flex;
	}

	.buyer-toggle-detail-btn.show.expanded {
		position: static;
		display: inline-flex !important;
		margin-left: 8px;
		transform: rotate(180deg);
		background: transparent;
	}

	.buyer-toggle-detail-btn:hover {
		color: #002244;
	}
}

/* 689px 이하: 업종/업태, 관심품목 줄바꿈 시 들여쓰기 제거 */
@media (max-width: 689px) {
	.buyer-info-wrapper-1 .buyer-col-btype,
	.buyer-col-items {
		display: block;
		padding-right:0px !important;
	}

	.buyer-info-wrapper-1 .buyer-col-btype::before,
	.buyer-col-items::before {
		display: inline;
	}

	.buyer-info-wrapper-1 .buyer-col-btype .buyer-items-wrapper,
	.buyer-col-items .buyer-items-wrapper {
		display: inline;
	}
	
}

@media (max-width: 1280px) {
	.product-view-layout {gap: 40px;}
	.product-view-layout .product-list-grid{
		grid-template-columns: repeat(2, 1fr);
		gap: 40px 15px;
	}
}

@media (max-width: 1020px) {
	.product-view-layout { flex-direction: column; display: flex; }
	.product-view-left { width: 100%;}

	/* 제품 상세 페이지: 탭 기능 제거 및 순서 변경 */
	.product-view-layout .company-tabs { display: none; }
	.product-view-layout .tab-content { display: block !important; }
	.product-view-layout .product-view-right { width: 100%; display: contents; }
	.product-view-layout .tab-content-wrapper { display: contents; }

	/* 순서 변경: 제품 리스트 → 제품 상세 → 회사 정보 */
	.product-view-layout #tab-products { order: 1; }
	.product-view-layout .product-view-left { order: 2; }
	.product-view-layout #tab-detail { order: 3; }

	/* 모바일 섹션 타이틀 표시 */
	.product-view-layout .mobile-section-title {
		display: block;
		font-size: 20px;
		font-weight: bold;
		margin-bottom: 20px;
		padding-bottom: 15px;
		border-bottom: 2px solid #002244;
		color: #002244;
	}

	.product-image-large{margin-left:auto;margin-right:auto;}
	.product-view-layout .product-list-grid{
		grid-template-columns: repeat(3, 1fr);
        gap: 30px 15px;
	}

	.basic-logo{max-width:500px;margin-left:auto;margin-right:auto;}

	.company-description, .product-description{padding-left:5px;padding-right:5px;}

	/* 액션 버튼 모바일/데스크톱 전환 */
	.product-view-layout .basic-buttons-mobile {
		display: flex;
	}

	/* 모바일 순서: 제품 상세 → 버튼 → 제품 리스트 → 회사 정보 → 회사 상세 */
	.product-view-layout .product-detail-area { order: 1; }
	.product-view-layout .product-list-section { order: 3; }
	.product-view-layout .product-view-left { order: 4; }
	.product-view-layout #tab-detail { order: 5; }
}

@media (max-width: 768px) {
	.search-row:nth-child(1) .items-group.simple-group {
	 grid-template-columns: repeat(2, 1fr);	
	}
	body.comp_list .search-row:nth-child(3) .simple-group{
		grid-template-columns: repeat(3, 1fr);
	}
	
	/*
	body.buyer_list .simple-group{display:flex;align-items:center;flex-wrap:wrap;}
	*/
	body.buyer_list .simple-group{grid-template-columns: repeat(2, 1fr);}
	body.buyer_list #buyerBTypesOptions .simple-group{grid-template-columns: repeat(2, 1fr);}
	body.buyer_list #buyerTurnoversOptions, 
	body.buyer_list #buyerPurchasingsOptions, 
	body.buyer_list #buyerItemsOptions{width:100% !important;}
	
	.search-area{padding:15px 10px;}
	.accordion-items-grid{
		gap:3px 5px;
		padding: 15px 5px 15px 5px;
	}
	.items-options{padding:10px 10px;}
	.simple-group{gap:3px 7px;}
	.product-info{padding:15px 5px;}
	.product-actions{padding:12px 5px;}
	.product-grid{margin-bottom:10px;}
	.product-view-layout .product-list-grid{
		grid-template-columns: repeat(2, 1fr);
        gap: 20px 10px;
	}
	
}

@media (max-width: 768px) {
	.company-header-info{gap:10px;}
	.company-description, .product-description{text-align:left;}
}
@media (max-width: 660px) {
	body.comp_list .search-row:nth-child(4) .simple-group{
		grid-template-columns: repeat(1, 1fr);
	}
	#buyerListContainer{margin-left:-20px;width:calc(100% + 40px)}
	.buyer-list-body{border-top:2px solid #777;}
	.buyer-list-body tr.buyer-list-row{margin-bottom:0px;border:0px;border-bottom:1px solid #ccc;}
}
@media (max-width: 550px) {
	.buyer-info-wrapper-1, 
	.buyer-info-wrapper-2{display:block;}
	.company-name { min-height: initial;overflow:visible;}
	body.comp_list .search-row:nth-child(3) .simple-group{
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.search-row .items-group.simple-group {
		grid-template-columns: repeat(1, 1fr);
		gap: 3px 7px;
	}
	#buyerTypesOptions .items-group.simple-group{grid-template-columns: repeat(2, 1fr);}
	.items-options{min-width:initial;}
	.items-buttons button{padding-left:0px;padding-right:0px;}
	.buyer-info-table th{width:100px;}
	
}
	
