/* root variables already defined in style.css */

.products {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--primary-color);
    font-weight: 500;
}

.detail-container {
    background: #fff;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.detail-image-area {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.detail-image {
    width: 100%;
    height: 500px;
    background: #f5f5f5;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.detail-image img:hover {
    transform: scale(1.05);
}

.thumbnail-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.thumbnail-list::-webkit-scrollbar {
    width: 6px;
}

.thumbnail-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thumbnail-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.thumbnail-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: var(--transition);
}

.thumbnail-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.thumbnail-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 102, 179, 0.1);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    padding: 20px 0;
}

.detail-info h1 {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
}

.product-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.product-meta-item {
    font-size: 13px;
    color: #666;
}

.detail-price-box {
    padding: 25px 0;
    border-top: 2px solid #222;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.detail-price span {
    font-size: 20px;
}

.discount-rate {
    color: #e74c3c;
    font-weight: 800;
    margin-right: 15px;
}

.reward-point {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.reward-point strong {
    color: var(--primary-color);
}

.option-group {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    color: #333;
    font-size: 18px;
    cursor: pointer;
}

.qty-btn:hover {
    background: #e0e0e0;
}

.qty-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
}

.info-label {
    width: 120px;
    color: #666;
    font-weight: 500;
}

.info-value {
    flex: 1;
    color: #333;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.detail-btn {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cart {
    background: #fff;
    border: 2px solid #007bff;
    color: #007bff;
}

.btn-cart:hover {
    background: #e7f3ff;
}

.btn-cart:disabled {
    background: #e0e0e0;
    border-color: #999;
    color: #666;
    cursor: not-allowed;
}

.btn-buy {
    background: #007bff;
    color: #fff;
}

.btn-buy:hover {
    background: #0056b3;
}

.btn-wish {
    flex: 0 0 56px;
    padding: 16px;
    font-size: 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-wish:hover {
    border-color: #e0245e;
    background: #fff0f5;
    transform: scale(1.08);
}

.btn-wish.wished {
    border-color: #e0245e;
    background: #fff0f5;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.product-sold-out {
    background: #dc3545;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
}

.cart-btn {
    flex: 2;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.cart-btn:hover {
    background: #f8f9fa;
    border-color: #bbb;
}

.wish-btn {
    width: 60px;
    height: 60px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: var(--transition);
}

.wish-btn:hover {
    background: #fff5f5;
    border-color: #ff8787;
}

.wish-btn.active {
    color: #e74c3c;
    background: #fff5f5;
    border-color: #ff8787;
    animation: heartBeat 0.3s ease-in-out;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #222;
    margin-top: 80px;
    margin-bottom: 40px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 700;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 40px 0;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

.tab-content-inner {
    max-width: 100%;
    margin: 0 auto;
}

.tbl_info {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 14px;
    table-layout: fixed;
}

.tbl_info th {
    background: #f0f4f8;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    border: 1px solid #d8dde4;
    width: 140px;
    white-space: nowrap;
    vertical-align: middle;
}

.tbl_info td {
    padding: 14px 16px;
    border: 1px solid #d8dde4;
    color: #333;
    vertical-align: middle;
    word-break: break-word;
}

.tbl_info tr:hover td,
.tbl_info tr:hover th {
    background-color: #fafbfc;
}

.info_img {
    margin-top: 30px;
}

#imageViewerModal {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

#imageViewerModal.active {
    display: flex;
    flex-direction: column;
}

.viewer-toolbar {
    background: rgba(42, 42, 42, 0.9);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.viewer-toolbar h3 {
    color: #fff;
    font-size: 16px;
    margin-right: auto;
}

.viewer-btn {
    background: #4a4a4a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.viewer-btn:hover {
    background: #5a5a5a;
}

.viewer-close {
    background: #d32f2f;
}

.viewer-close:hover {
    background: #b71c1c;
}

#viewer-zoom-info {
    color: #ccc;
    font-size: 13px;
    min-width: 70px;
    text-align: center;
}

.viewer-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
}

@media (max-width: 768px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .detail-image-area {
        position: static;
    }

    .detail-image {
        height: 320px;
    }

    .detail-info h1 {
        font-size: 20px;
    }

    .detail-price {
        font-size: 26px;
    }

    .tab-buttons {
        overflow-x: auto;
    }

    .thumbnail-list {
        grid-template-columns: repeat(4, 1fr);
    }

    /* tbl_info 모바일 반응형 */
    .tbl_info,
    .tbl_info thead,
    .tbl_info tbody,
    .tbl_info tr,
    .tbl_info th,
    .tbl_info td {
        display: block;
        width: 100% !important;
    }

    .tbl_info tr {
        border: 1px solid #d8dde4;
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .tbl_info th {
        background: #e8eef5;
        border: none;
        border-bottom: 1px solid #d8dde4;
        font-size: 12px;
        color: #555;
        padding: 10px 14px;
        white-space: normal;
    }

    .tbl_info td {
        border: none;
        padding: 10px 14px;
        font-size: 14px;
    }

    .tbl_info td[colspan] {
        width: 100% !important;
    }

    .product-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .info-label {
        width: 90px;
        font-size: 13px;
    }
}

/* Review and QNA Lists */
.review-list,
.qna-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-item,
.qna-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

.review-header,
.qna-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
}

.review-poll {
    color: #f39c12;
    font-weight: bold;
}

.review-writer,
.qna-writer {
    color: #333;
    font-weight: 500;
}

.review-date,
.qna-date {
    color: #999;
}

.review-content,
.qna-question {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
}

.qna-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.qna-status.confirmed {
    background: #e3f2fd;
    color: #1976d2;
}

.qna-title {
    font-weight: 600;
    flex: 1;
    cursor: pointer;
}

.qna-body {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.qna-answer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    color: #2e7d32;
}

/* Pagination Styling */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.pagination a:hover {
    background: #f5f5f5;
}

.pagination .active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.no-data,
.error {
    text-align: center;
    padding: 50px 0;
    color: #999;
}

.error {
    color: #e74c3c;
}

.return-info-content {
    line-height: 1.8;
    color: #444;
    font-size: 15px;
}

/* Enhanced Tab Components */
.tab-count {
    display: inline-block;
    background: #eee;
    color: #666;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    transition: all 0.3s;
}

.tab-btn.active .tab-count {
    background: #fff;
    color: var(--primary-color);
}

.tab-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-write-review,
.btn-write-qna {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.btn-write-review img,
.btn-write-qna img {
    height: 32px;
}

/* Q&A Registration Form */
.qna-reg-container {
    margin-bottom: 30px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
}

.qna-reg-box h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.qna-form-row {
    margin-bottom: 15px;
}

.qna-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.qna-form-row select,
.qna-form-row input[type="text"],
.qna-form-row textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.qna-form-row textarea {
    height: 150px;
    resize: vertical;
}

.qna-reg-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-qna-submit {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.btn-qna-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
}

/* Q&A List Delete Button */
.btn-qna-del {
    background: none;
    border: 1px solid #ddd;
    color: #999;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-left: auto;
}

.btn-qna-del:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

/* sw-modal related styles */
.sw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.sw-modal-container {
    background: #fff;
    width: 100%;
    max-width: 550px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sw-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.sw-modal-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.sw-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.sw-modal-close:hover {
    color: #333;
}

.sw-modal-body {
    padding: 24px;
}

.sw-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

/* Modal specific button adjustments */
.sw-modal-footer .btn-qna-submit,
.sw-modal-footer .btn-qna-cancel {
    padding: 10px 24px;
    margin: 0;
}