/*
Theme Name: Key Điện Tử
Theme URI: https://domaincuaban.com
Author: Tên của bạn hoặc Tên Đội ngũ
Author URI: https://domaincuaban.com
Description: Theme WordPress chuyên dụng bán key phần mềm, bản quyền số (Windows, Office, AI...). Giao diện bắt mắt, tối ưu chuyển đổi, thiết kế hiện đại.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: keydientu
Tags: e-commerce, woocommerce, software, digital-products, responsive, right-sidebar
*/

/* ==========================================================================
 * BỔ SUNG ĐỊNH DẠNG CHO NỘI DUNG BÀI VIẾT / SẢN PHẨM (THE_CONTENT)
 * ========================================================================== */

/* 1. Định dạng Tiêu đề (Headings) */
.prose h1, .tab-content h1 { font-size: 2rem !important; font-weight: 800 !important; margin-top: 1.5rem !important; margin-bottom: 0.75rem !important; color: #1f2937 !important; }
.prose h2, .tab-content h2 { font-size: 1.5rem !important; font-weight: 700 !important; margin-top: 1.25rem !important; margin-bottom: 0.5rem !important; color: #1f2937 !important; }
.prose h3, .tab-content h3 { font-size: 1.25rem !important; font-weight: 700 !important; margin-top: 1rem !important; margin-bottom: 0.5rem !important; color: #374151 !important; }
.prose h4, .tab-content h4 { font-size: 1.125rem !important; font-weight: 600 !important; margin-top: 0.75rem !important; margin-bottom: 0.5rem !important; }

/* 2. Định dạng Đoạn văn (Paragraphs) & Thẻ in đậm */
.prose p, .tab-content p { margin-bottom: 1rem !important; line-height: 1.75 !important; color: #4b5563 !important; }
.prose strong, .tab-content strong, .prose b, .tab-content b { font-weight: 700 !important; color: #1f2937 !important; }

/* 3. Khôi phục Danh sách có dấu chấm (ul) và Số (ol) */
.prose ul, .tab-content ul { list-style-type: disc !important; padding-left: 1.5rem !important; margin-bottom: 1rem !important; }
.prose ol, .tab-content ol { list-style-type: decimal !important; padding-left: 1.5rem !important; margin-bottom: 1rem !important; }
.prose li, .tab-content li { margin-bottom: 0.375rem !important; }

/* 4. Hỗ trợ Căn chỉnh lề WordPress (Gutenberg Alignment Classes) */
.has-text-align-center, .aligncenter { text-align: center !important; margin-left: auto !important; margin-right: auto !important; }
.has-text-align-right, .alignright { text-align: right !important; }
.has-text-align-left, .alignleft { text-align: left !important; }
.has-text-align-justify { text-align: justify !important; }

/* 5. Định dạng Hình ảnh & Bảng trong bài viết */
.prose img, .tab-content img { max-width: 100% !important; height: auto !important; border-radius: 0.5rem !important; margin-top: 1rem !important; margin-bottom: 1rem !important; }
.prose table, .tab-content table { width: 100% !important; border-collapse: collapse !important; margin-bottom: 1rem !important; }
.prose th, .tab-content th, .prose td, .tab-content td { border: 1px solid #e5e7eb !important; padding: 0.75rem !important; text-align: left !important; }
.prose th, .tab-content th { background-color: #f9fafb !important; font-weight: 700 !important; }

/* --- TÙY CHỈNH KHUNG HIỂN THỊ ĐÁNH GIÁ (REVIEWS) --- */
.woocommerce-Reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}
.woocommerce-Reviews .commentlist li.comment {
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem 0;
    margin-bottom: 0;
}
.woocommerce-Reviews .commentlist li.comment:last-child {
    border-bottom: none;
}
.woocommerce-Reviews .comment_container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.woocommerce-Reviews .commentlist img.avatar {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 9999px !important;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}
.woocommerce-Reviews .comment-text {
    flex-grow: 1;
}
.woocommerce-Reviews .meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.woocommerce-Reviews .meta strong.woocommerce-review__author {
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
}
.woocommerce-Reviews .description {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
}
/* Tùy chỉnh cụm chọn số sao (Rating stars) */
.stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.stars a {
    color: #f59e0b !important;
    font-size: 1.1rem;
    text-decoration: none;
}
.woocommerce-review-link {
    color: #2563eb;
    font-weight: 600;
}

/* ==========================================================================
   KEYSOFT - CUSTOM WOOCOMMERCE LOGIN & REGISTER FORM
   ========================================================================== */

/* 1. Khung tổng thể 2 cột Đăng nhập & Đăng ký */
#customer_login {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    #customer_login {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* 2. Style Card dạng hộp bo góc & bóng mờ */
#customer_login .u-column1,
#customer_login .u-column2 {
    background: #ffffff;
    padding: 2.25rem 2rem;
    border-radius: 1.25rem; /* rounded-2xl */
    border: 1px solid #f3f4f6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 100% !important;
    float: none !important;
}

/* 3. Tiêu đề Form (H2) */
#customer_login h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eff6ff;
    position: relative;
}

#customer_login h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 45px;
    height: 2px;
    background-color: #2563eb; /* Màu xanh thương hiệu KeySoft */
    border-radius: 2px;
}

/* 4. Nhãn (Label) */
.woocommerce-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.woocommerce-form label .required {
    color: #ef4444;
    text-decoration: none;
}

/* 5. Ô nhập liệu (Input field) */
.woocommerce-form .input-text,
.woocommerce-form input[type="text"],
.woocommerce-form input[type="email"],
.woocommerce-form input[type="password"],
.woocommerce-form input[type="tel"] {
    width: 100% !important;
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important; /* rounded-xl */
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    transition: all 0.2s ease-in-out !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.woocommerce-form .input-text:focus,
.woocommerce-form input:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12) !important;
}

/* 6. Khoảng cách giữa các ô */
.woocommerce-form-row {
    margin-bottom: 1.25rem !important;
    padding: 0 !important;
}

/* 7. Nút Đăng nhập & Đăng ký nổi bật */
.woocommerce-form .woocommerce-button,
.woocommerce-form button[type="submit"] {
    width: 100% !important;
    background-color: #2563eb !important; /* Nút màu xanh primary */
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    padding: 0.85rem 1.5rem !important;
    border-radius: 0.75rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
    text-align: center;
    display: block;
    margin-top: 1rem;
}

.woocommerce-form .woocommerce-button:hover,
.woocommerce-form button[type="submit"]:hover {
    background-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35) !important;
}

/* 8. Tùy chỉnh "Ghi nhớ mật khẩu" & "Quên mật khẩu" */
.woocommerce-form-login .woocommerce-form-login__rememberme {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #4b5563;
    font-size: 0.875rem;
}

.woocommerce-form-login .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
    border-radius: 0.25rem;
    cursor: pointer;
}

.woocommerce-LostPassword {
    margin-top: 1rem;
    text-align: center;
}

.woocommerce-LostPassword a {
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.woocommerce-LostPassword a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 9. Làm đẹp khung Thông báo lỗi / Thành công */
.woocommerce-error, 
.woocommerce-message, 
.woocommerce-info {
    max-width: 1000px;
    margin: 1.5rem auto !important;
    border-radius: 0.75rem !important;
    border: none !important;
    padding: 1rem 1.25rem !important;
    font-size: 0.875rem !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    list-style: none !important;
}

.woocommerce-error {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-left: 4px solid #ef4444 !important;
}

.woocommerce-message {
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    border-left: 4px solid #22c55e !important;
}

/* Custom WooCommerce My Account Tables */
.woocommerce-orders-table, 
.woocommerce-table--order-details {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #f3f4f6 !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
}

.woocommerce-orders-table th, 
.woocommerce-table--order-details th {
    background-color: #f9fafb !important;
    color: #374151 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.woocommerce-orders-table td, 
.woocommerce-table--order-details td {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    color: #1f2937 !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.woocommerce-orders-table tr:last-child td, 
.woocommerce-table--order-details tr:last-child td {
    border-bottom: none !important;
}

/* Nút Xem chi tiết / Copy Key trong bảng */
.woocommerce-orders-table__cell-order-actions .button {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.75rem !important;
    font-size: 0.8rem !important;
    transition: all 0.2s !important;
}

.woocommerce-orders-table__cell-order-actions .button:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}