/* --- 1. ICON KÍCH HOẠT --- */
#wps-scanner-wrapper {
    margin: 10px auto;
    text-align: center;
    display: inline-block;
}

#wps-start-scan {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    max-width: 100%;
}

#wps-start-scan:active {
    transform: scale(0.9);
}

.wps-scan-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

/* --- 2. STYLE CHUNG CHO CÁC MODAL --- */
.wps-modal {
    display: none; 
    position: fixed; 
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.85); /* Nền tối mờ */
    backdrop-filter: blur(4px);
    align-items: center; 
    justify-content: center;
}

.wps-modal[style*="display: block"] {
    display: flex !important;
}

.wps-modal-content {
    background-color: #fff;
    padding: 20px;
    width: 90%; 
    max-width: 380px;
    border-radius: 12px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- 3. STYLE POPUP CAMERA --- */
.wps-camera-content {
    background-color: #000;
    color: #fff;
    border: 1px solid #444;
}

#wps-reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

#wps-reader video {
    width: 100%;
    height: auto;
    object-fit: cover;
}

#wps-close-camera {
    color: #fff;
    position: absolute;
    right: 15px;
    top: 5px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

/* --- 4. STYLE POPUP KẾT QUẢ --- */
.wps-result-content {
    background-color: #fff;
    color: #333;
    max-height: 90vh;
    overflow-y: auto;
}

.wps-close-result {
    color: #333;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.wps-prod-img img {
    max-height: 160px;
    width: auto;
    margin: 0 auto 10px auto;
    display: block;
    border-radius: 6px;
}

.wps-prod-title {
    font-size: 1.1em;
    margin: 10px 0;
    font-weight: 700;
    color: #333;
}

.wps-prod-sku {
    color: #666;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.wps-prod-price {
    font-size: 1.3em;
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 15px;
}

/* --- 5. STYLE NÚT BẤM (QUAN TRỌNG) --- */
.wps-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style cho nút "Quét tiếp" và "Thêm giỏ hàng" */
.wps-actions .button, 
#wps-scan-again {
    width: 100%;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    margin: 0;
}

/* SỬA LỖI: Style riêng cho nút "Xem chi tiết" để hoạt động độc lập */
.wps-btn-detail {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #333; /* Màu đen xám */
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    box-sizing: border-box;
    transition: background 0.3s;
    border: none;
}

.wps-btn-detail:hover {
    background-color: #000;
    color: #fff;
}

/* --- 6. STYLE THÔNG BÁO NOT FOUND --- */
.wps-not-found-wrapper {
    text-align: center;
    padding: 20px 10px;
}
.wps-warning-icon {
    font-size: 50px;
    margin-bottom: 15px;
}
.wps-not-found-wrapper h3 {
    color: #e6a800; /* Màu vàng cam */
    margin: 0 0 10px 0;
}
.wps-sub-msg {
    color: #888;
    font-size: 0.9em;
    margin-top: 5px;
    font-style: italic;
}