@charset "utf-8";

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* pic_disinfo latest */
.pic_disinfo_lt { position:relative; }
.pic_disinfo_lt .lat_title { font-size:1.5em; font-weight:bold; margin-bottom:10px; }
.pic_disinfo_lt .lat_title a { color:#333; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 기본 4개 아이템 */
    gap: 20px;
    padding: 20px 0;
}

.product-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-item .product-image-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain; /* 이미지가 잘리지 않고 비율을 유지하며 전체가 보이도록 설정 */
    transition: transform 0.3s ease; /* 부드러운 효과를 위한 transition 추가 */
}

.product-item:hover .product-image-link img {
    transform: scale(1.25); /* 이미지 확대 효과 */
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info > span {
    font-size: 0.875rem; /* 14px */
    color: #888;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    margin-bottom: 10px;
    word-break: keep-all;
}

.product-price {
    margin-top: auto;
}

.discount-rate {
    color: #e74c3c;
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 10px;
}
.original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.discount-price {
    color: #e74c3c;
    font-weight: bold;
}

.empty_li {
    text-align: center;
    padding: 50px 0;
    color: #777;
    grid-column: 1 / -1;
}

/* index.php custom style */
.main-content {
    width: 100%;
}

/*메인 로고*/
.header-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.logo {
    height: 80px; /* 로고 높이 조절 */
    margin-right: 20px; /* 로고와 검색창 사이 간격 */
    margin-left: 10px;
}

.search-bar-wrapper {
    padding: 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    width: 85%;
    margin-right: 10px;
}
.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}
.search-bar input {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px 0 0 5px;
}
.search-bar button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #eee;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}
.content-wrapper {
    padding: 20px;
}

.filters {
    padding: 20px 20px 0px 20px;
    display: flex;
    gap: 10px;
}
.filters select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
/* 반응형 레이아웃 */
#wrapper {
    max-width: 1280px;
    min-width: 400px;
    margin: 0 auto;
    position: relative;
}

/* 화면이 1280px 이하일 때 (4개) */
@media (max-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 화면이 1024px 이하일 때 (4개) */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 화면이 768px 이하일 때 (3개) */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .discount-rate {
        font-size: 1.1em;
    }
    .product-info {
        padding: 10px;
    }
    .content-wrapper, .search-bar-wrapper, .filters {
        padding: 15px;
    }
    .search-bar {
        max-width: 100%;
    }
}

/* 화면이 600px 이하일 때 (2개) */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .logo {        
        margin-left: 10px;
        margin-right: 10px; /* 로고와 검색창 사이 간격 */
    }
    .search-bar-wrapper {
        
        margin-right: 10px;
    }
}

/* 화면이 400px 이하일 때 (1개) */
@media (max-width: 400px) {
    .product-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}


/*-----------VIEW 화면---------------*/
/* 상세 페이지 간단한 스타일 */
#product_view_wrap {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #e5e5e5;
}

.product-category  {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 12px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    border-radius: 20px;
}



/* 카테고리별 색상 */
.category-color-1 { background-color: #f8d44c; color: #333; } /* 이마트 느낌 */
.category-color-2 { background-color: #3a3a3a; color: white; } /* 노브랜드 느낌 */
.category-color-3 { background-color: #5c6bc0; color: white; }
.category-color-4 { background-color: #26a69a; color: white; }
.category-color-5 { background-color: #66bb6a; color: white; }
.category-color-6 { background-color: #ffa726; color: white; }
.category-color-7 { background-color: #8d6e63; color: white; }
.category-color-8 { background-color: #78909c; color: white; }
.category-color-9 { background-color: #42a5f5; color: white; }
.category-color-10 { background-color: #ec407a; color: white; }


/* 마우스 오버 시 약간 밝아지는 효과 */
.product-category:hover {
    filter: brightness(1.1);
    transition: filter 0.2s ease-in-out;
}


#product_view_wrap h1 {
    font-size: 24px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.product_description {
    line-height: 1.8;
    font-size: 1.2em;
    /* white-space: pre-wrap; 속성은 PHP에서 직접 HTML을 생성하므로 더 이상 필요하지 않습니다. */
}

.product-detail-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-detail-item:last-child {
    border-bottom: none;
}

.product-detail-title {
    font-weight: bold;
    color: #333;
}

.product-detail-info {
    color: #555;
}

.product-detail-item img{
    width:100%;
}

.product-detail-item img:hover {
    cursor: pointer;
    opacity: 0.9;
}

/* 화면이 420px 이하일 때  */
@media (max-width: 600px) {
    .product_description {
        font-size: 1.0em;
    }
    .product-detail-arrow {
        display: none; /* 모바일에서는 화살표 숨김 */
    }
    .product-detail-info {
        display: block; /* '→' 이후 내용을 다음 줄로 내림 */
        padding-left: 10px; /* 약간의 들여쓰기 효과 */
        color: #e74c3c; /* 가격 정보 색상 강조 */
    }
}

.highlight {
    background-color: yellow;
}

.highlight.active {
    background-color: #ffc107; /* 더 진한 노란색으로 활성화 표시 */
    border: 1px solid #e6a200;
    border-radius: 3px;
}

#highlight-nav {
    display: none; /* 키워드가 있을 때만 JS로 표시 */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 1000;
}

#highlight-counter {
    margin-right: 15px;
}

.highlight-btn {
    margin: 0 5px;
}

.regular-price {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9em;
}
.sale-price {
    color: #e53935; /* 붉은 계열 */
    font-weight: bold;
    font-size: 1.1em;
}

/* 장바구니 아이콘 */
#cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #ffc107;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1001;
}

#cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #e53935;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    font-weight: bold;
}

/* 이미지 뷰어 모달 스타일 */
.view_btn_wrap {
    overflow: hidden;
    margin-bottom: 10px;
    clear: both;
}
.btn_list_top {
    float: right;
    padding: 8px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #212529;
    font-weight: bold;
}
.btn_list_top:hover {
    background: #e9ecef;
}
.btn_list_top + .btn_list_top {
    margin-right: 5px;
}

/* 이미지 뷰어 컨트롤 버튼 스타일 */
.image-viewer-controls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(40,40,40,0.7);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    gap: 8px;
}

.image-viewer-controls button {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.image-viewer-controls button:hover {
    background-color: #f0f0f0;
}

.image-viewer-modal-content.draggable {
    cursor: grab;
    position: absolute; /* 드래그를 위해 position 변경 */
}


/* 이미지 뷰어 모달 스타일 */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    cursor: pointer;
}

.image-viewer-modal-content {
    margin: auto;
    display: block;
    position: absolute;
    max-width: 90%;
    max-height: 90%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.2s ease-out;
}

.image-viewer-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

/* 장바구니 팝업 */
@media (min-width: 600px) {
    .add-to-cart-btn{
        margin-left: 20px;
    }
}


#cart-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none; /* 기본 숨김 */
    flex-direction: column;
}
#cart-popup.show {
    display: flex;
}
#cart-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}
#cart-popup-header h3 {
    margin: 0;
}
#cart-popup-header div {
    display: flex;
    align-items: center;
}
#cart-items {
    padding: 15px;
    overflow-y: auto;
}
.cart-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}
.cart-item-category {
    font-size: 0.8em;    
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 4px;
    align-self: flex-start;    
}

.cart-item-name {
    font-size: 0.9em;
    color: #333;
}
.cart-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-item-price {
    font-size: 0.9em;
    font-weight: bold;
    color: #555;
    flex-grow: 1;
    text-align: left;
}

.cart-item:last-child {
    border-bottom: none;
}
.remove-from-cart-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
#clear-cart-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 12px;
}

/* 장바구니 팝업 푸터 */
#cart-popup-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    text-align: right;
    font-size: 1.1em;
    font-weight: bold;
}

#cart-total-price {
    color: #e53935;
    margin-left: 10px;
}


/* 마감 css */
.product-item.timeout {
    position: relative;
    filter: grayscale(90%); /* 회색톤으로 변경 */
    opacity: 0.7;
}

.timeout-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.5em;
    font-weight: bold;
    z-index: 10;
    pointer-events: none; /* 오버레이 아래의 링크 클릭이 가능하도록 설정 */
}

/* view.php 용 마감 처리 */
#product_view_wrap.timeout {
    position: relative;
    filter: grayscale(90%);
    opacity: 0.7;
}
