/* ===== Tra Cứu Nước Làm Mát - Styles ===== */
.tcnlm-wrapper {
    max-width: 1000px;
    margin: 24px auto;
    padding: 28px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}
.tcnlm-wrapper *,
.tcnlm-wrapper *::before,
.tcnlm-wrapper *::after {
    box-sizing: border-box;
}

.tcnlm-header {
    text-align: center;
    margin-bottom: 24px;
}
.tcnlm-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
.tcnlm-subtitle {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.tcnlm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tcnlm-field {
    display: flex;
    flex-direction: column;
}
.tcnlm-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.tcnlm-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.tcnlm-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: #111827;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}
.tcnlm-select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.tcnlm-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.tcnlm-button {
    margin-top: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.tcnlm-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}
.tcnlm-button:active:not(:disabled) {
    transform: translateY(0);
}
.tcnlm-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Loading */
.tcnlm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    color: #6b7280;
    font-size: 14px;
}
.tcnlm-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tcnlm-spin 0.8s linear infinite;
}
@keyframes tcnlm-spin {
    to { transform: rotate(360deg); }
}

/* Result */
.tcnlm-result {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    border: 1.5px solid #10b981;
    border-radius: 12px;
    animation: tcnlm-fadein 0.4s ease;
}
@keyframes tcnlm-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.tcnlm-result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #047857;
}
.tcnlm-result-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}
.tcnlm-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.tcnlm-result-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    transition: all 0.25s ease;
}
.tcnlm-result-row.tcnlm-product-row {
    background: #ffffff;
    border-left: 3px solid #10b981;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.tcnlm-result-row.tcnlm-product-row:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    background: #fdfdfd;
}
.tcnlm-result-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.tcnlm-result-value {
    font-size: 15px;
    color: #111827;
    font-weight: 500;
}
.tcnlm-result-value.highlight {
    color: #047857;
    font-weight: 700;
    font-size: 16px;
}
.tcnlm-result-note {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.55;
}

/* Error */
.tcnlm-result.error {
    background: #fef2f2;
    border-color: #ef4444;
}
.tcnlm-result.error .tcnlm-result-title {
    color: #b91c1c;
}

/* Responsive */
@media (max-width: 600px) {
    .tcnlm-wrapper {
        margin: 12px;
        padding: 20px 16px;
    }
    .tcnlm-title {
        font-size: 19px;
    }
    .tcnlm-result-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .tcnlm-result-label {
        font-size: 13px;
        color: #6b7280;
    }
}

/* Horizontal Layout for Desktop Devices */
@media (min-width: 820px) {
    .tcnlm-form {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr auto;
        gap: 16px;
        align-items: end;
    }
    .tcnlm-button {
        margin-top: 0;
        height: 48px;
        padding: 0 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
}

/* Consultation Form Styles */
.tcnlm-consult-wrapper {
    margin-top: 24px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    text-align: left;
}

.tcnlm-consult-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.tcnlm-consult-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.tcnlm-consult-icon {
    width: 20px;
    height: 20px;
    color: #10b981;
    flex-shrink: 0;
}

.tcnlm-consult-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.tcnlm-consult-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .tcnlm-consult-fields {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .tcnlm-consult-field.full-width {
        grid-column: 1 / -1;
    }
}

.tcnlm-consult-field {
    display: flex;
    flex-direction: column;
}

.tcnlm-consult-field label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

.tcnlm-consult-field label .required {
    color: #ef4444;
}

.tcnlm-consult-field input,
.tcnlm-consult-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.tcnlm-consult-field input {
    height: 42px;
}

.tcnlm-consult-field input:focus,
.tcnlm-consult-field textarea:focus {
    border-color: #10b981;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.tcnlm-consult-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

@media (min-width: 768px) {
    .tcnlm-consult-btn {
        width: auto;
    }
}

.tcnlm-consult-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.tcnlm-consult-btn:active:not(:disabled) {
    transform: translateY(0);
}

.tcnlm-consult-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.tcnlm-consult-msg {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.tcnlm-consult-msg.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.tcnlm-consult-msg.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.tcnlm-spinner-inline {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tcnlm-spin 0.8s linear infinite;
    display: inline-block;
}

/* ===== Image Popup Styles ===== */
.tcnlm-popup-widget {
    position: fixed;
    bottom: 24px;
    width: 320px;
    max-width: 90%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, visibility 0.4s ease;
}

.tcnlm-popup-widget.tcnlm-position-bottom-left {
    left: 24px;
}

.tcnlm-popup-widget.tcnlm-position-bottom-right {
    right: 24px;
}

.tcnlm-popup-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tcnlm-popup-content {
    position: relative;
    width: 100%;
    background: transparent;
    border-radius: 16px;
}

.tcnlm-popup-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
    border: 3px solid #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tcnlm-popup-content a {
    display: block;
    outline: none;
}

.tcnlm-popup-content a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -10px rgba(99, 102, 241, 0.3), 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.tcnlm-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    color: #1e293b;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0 0 3px 0;
}

.tcnlm-popup-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
}

@media (max-width: 640px) {
    .tcnlm-popup-widget {
        bottom: 16px;
        width: 280px;
    }
    .tcnlm-popup-widget.tcnlm-position-bottom-left {
        left: 16px;
    }
    .tcnlm-popup-widget.tcnlm-position-bottom-right {
        right: 16px;
    }
    .tcnlm-popup-close {
        top: -8px;
        right: -8px;
        width: 26px;
        height: 26px;
        font-size: 18px;
    }
}
