:root {
    --az-primary: #FF5A5F; /* Màu chủ đạo đỏ cam như ảnh */
    --az-bg: #F3F5F7;
    --az-text: #333;
    --az-border: #E0E0E0;
}

.az-qr-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--az-text);
}

/* TABS */
.az-qr-tabs-container {
    margin-bottom: 25px;
}
.az-qr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.az-tab-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.az-tab-btn:hover { background: #f8f8f8; color: var(--az-primary); }
.az-tab-btn.active {
    background: var(--az-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 90, 95, 0.3);
}

/* LAYOUT GRID */
.az-qr-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
}

/* CARDS */
.az-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.04);
    overflow: hidden;
}
.az-card-header {
    padding: 20px 25px 10px;
}
.az-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    border-left: 4px solid var(--az-primary);
    padding-left: 10px;
}
.az-card-body {
    padding: 10px 25px 15px;
}

/* FORM ELEMENTS */
.az-input-group { display: none; animation: fadeIn 0.3s ease; }
.az-input-group.active { display: block; }

.az-form-control {
    width: 100%;
    padding: 7px 15px;
    border: 1px solid var(--az-border);
    border-radius: 10px;
    font-size: 14px;
    transition: 0.2s;
    background: #FAFAFA;
    box-sizing: border-box;
	height: 40px;
}
.az-form-control:focus {
    border-color: var(--az-primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.1);
}
label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #555;
}

.az-form-row {
    display: flex;
    margin-left: -10px;
    margin-right: -10px;
}
.az-form-row .col-6 { width: 50%; padding: 0 10px; }
.az-form-row .col-12 { width: 100%; padding: 0 10px; margin-bottom: 15px; }

/* PRESETS */
.az-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.az-preset-item {
    text-align: center;
    padding: 10px 5px;
    background: #F8F9FA;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.az-preset-item.active {
    background: #FFF5F5;
    border-color: var(--az-primary);
    color: var(--az-primary);
    font-weight: bold;
}

/* COLORS */
.az-color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FAFAFA;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--az-border);
}
.az-color-picker-wrap input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
	margin-bottom : 0;
}

/* RIGHT COLUMN */
.az-sticky-preview {
    position: sticky;
    top: 20px;
}
/* PREVIEW BOX - SỬA LỖI FLEX COLUMN */
.az-preview-box {
    padding: 30px;
    display: flex;
    flex-direction: column; /* QUAN TRỌNG: Xếp dọc để Text nằm dưới QR */
    justify-content: center;
    align-items: center;
    background: #fff;
    min-height: 340px; /* Tăng chiều cao một chút */
    position: relative;
    gap: 15px; /* Khoảng cách giữa QR và Text */
}

/* Style cho Text bên dưới QR */
#az-qr-text-bottom {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    max-width: 100%;
    word-break: break-word;
    padding: 0 10px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

/* Empty State */
#az-empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.az-dashed-box {
    border: 2px dashed #dce1e7;
    border-radius: 12px;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #8898aa;
    background: #f8f9fa;
}

/* DOWNLOAD BUTTONS */
.az-download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    padding: 10px;
    background: #FAFAFA;
    border-top: 1px solid #eee;
}
.az-download-grid button {
    padding: 10px;
    border: 1px solid var(--az-border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: 0.2s;
}
.az-download-grid button:hover {
    background: var(--az-primary);
    color: #fff;
    border-color: var(--az-primary);
}

.az-logo-section {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    font-size: 14px;
}
.az-btn-sm {
    padding: 5px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE */
@media (max-width: 768px) {
    .az-qr-body { grid-template-columns: 1fr; }
    .az-presets-grid { grid-template-columns: repeat(2, 1fr); }
    .az-sticky-preview { position: static; }
}

/* EMPTY STATE (HÌNH ĐẠI DIỆN) */
.az-preview-box {
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    min-height: 320px;
    position: relative;
}

#az-empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.az-dashed-box {
    border: 2px dashed #dce1e7;
    border-radius: 12px;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #8898aa;
    background: #f8f9fa;
}

.az-dashed-box p {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
}
/* --- AUTO QR (WOO + POST + SHARE SHORTCODE) --- */
/* --- AUTO QR (WOO + POST + SHARE SHORTCODE) --- */
.az-auto-qr-wrapper {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    clear: both; /* Tránh bị float của theme làm vỡ layout */
}

/* Căn lề Wrapper */
.az-align-left {
    margin-right: auto;
    align-items: flex-start;
}
.az-align-center {
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    text-align: center;
}
.az-align-right {
    margin-left: auto;
    align-items: flex-end;
}

.az-qr-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Canvas chứa QR - FIX LỖI KHÔNG HIỆN HÌNH */
.az-auto-qr-canvas {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    /* Bắt buộc có kích thước tối thiểu để không bị ẩn */
    min-width: 150px;
    min-height: 150px; 
}

/* Share Buttons */
.az-woo-share-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.az-align-left .az-woo-share-btns { justify-content: flex-start; }
.az-align-right .az-woo-share-btns { justify-content: flex-end; }

.az-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
    line-height: 1;
}
.az-share-btn:hover { opacity: 0.9; color: #fff !important; }
.az-share-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }

.az-share-btn.fb { background: #1877F2; }
.az-share-btn.zalo { background: #0068FF; }
.az-share-btn.x { background: #000000; }