
/* =====================================================
   NONG NGHIEP XANH
   COMMON CSS
   Shared Design System
===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&display=swap');

/* =====================================================
   1. DESIGN TOKENS
===================================================== */

:root {

    /* Brand */
    --primary: #238636;
    --primary-dark: #17652a;
    --primary-light: #e8f5e9;
    --primary-hover: #1b702c;

    /* Price */
    --price: #ee4d2d;
    --price-old: #999999;
    --sale: #ee4d2d;

    /* Text */
    --text: #26332a;
    --text-dark: #222222;
    --text-muted: #777777;
    --text-light: #999999;

    /* Background */
    --white: #ffffff;
    --background: #f5f5f5;
    --background-light: #f8faf8;

    /* Border */
    --border: #e5e5e5;
    --border-light: #eeeeee;

    /* Status */
    --success: #238636;
    --danger: #ee4d2d;
    --warning: #ff9800;

    /* Footer */
    --footer-bg: #174d2b;
    --footer-text: #d5e8d8;

    /* Shadow */
    --shadow:
        0 4px 12px rgba(0, 0, 0, 0.08);

    --shadow-hover:
        0 8px 22px rgba(0, 0, 0, 0.12);

    /* Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;

    /* Transition */
    --transition: all 0.25s ease;

    /* Layout */
    --container-width: 1200px;
    --container-padding: 5%;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 900;
    --z-modal: 1000;
}


/* =====================================================
   2. RESET
===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        'Be Vietnam Pro',
        sans-serif;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;

    color: var(--text);
    background:
        radial-gradient(
            circle at 10% 20%,
            rgba(35, 134, 54, 0.08),
            transparent 35%
        ),
        #edf6ee;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

input,
textarea,
select {
    max-width: 100%;
}

ul,
ol {
    padding-left: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

iframe {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.required::after {
    content: " *";
    color: #dc3545; /* Màu đỏ */
    font-weight: bold;
}

/* =====================================================
   3. ACCESSIBILITY
===================================================== */

:focus-visible {
    outline: 3px solid rgba(35, 134, 54, 0.4);
    outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;

    z-index: var(--z-modal);

    padding: 10px 16px;

    color: var(--white);
    background: var(--primary);

    border-radius: var(--radius);
}

.skip-link:focus {
    top: 10px;
}


/* =====================================================
   4. CONTAINER
===================================================== */

.container {
    width: calc(100% - 40px);
    max-width: var(--container-width);

    margin-left: auto;
    margin-right: auto;
}

.container-fluid {
    width: 100%;
    padding-left: 5%;
    padding-right: 5%;
}

.container-sm {
    width: calc(100% - 40px);
    max-width: 800px;

    margin-left: auto;
    margin-right: auto;
}


/* =====================================================
   5. SECTION
===================================================== */

section {
    position: relative;
    width: 100%;
}

.section {
    padding: 60px 0;
}

.section-sm {
    padding: 40px 0;
}

.section-lg {
    padding: 80px 0;
}


/* =====================================================
   6. SECTION TITLE
===================================================== */

.section-title {
    margin-bottom: 35px;
    text-align: center;
}

.section-title h2 {
    margin-bottom: 10px;

    color: var(--text-dark);

    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
}

.section-title p {
    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 1.7;
}


/* =====================================================
   7. BUTTON SYSTEM
===================================================== */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;

    min-height: 42px;

    padding: 10px 22px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-size: 14px;
    font-weight: 600;

    text-align: center;
    white-space: nowrap;

    transition: var(--transition);
}

.btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

.btn-primary {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    color: var(--white);
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline {
    color: var(--primary);
    background: transparent;
    border-color: var(--primary);
}

.btn-outline:hover {
    color: var(--white);
    background: var(--primary);
}

.btn-secondary {
    color: var(--text);
    background: var(--background);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #e9eee9;
}

.btn-danger {
    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #d73211;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 14px;
    font-size: 12px;
}

.btn-lg {
    min-height: 50px;
    padding: 13px 28px;
    font-size: 15px;
}

.btn-block {
    display: flex;
    width: 100%;
}


/* =====================================================
   8. FORM SYSTEM
===================================================== */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;

    margin-bottom: 8px;

    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.form-control {
    display: block;

    width: 100%;
    min-height: 44px;

    padding: 10px 13px;

    color: var(--text);
    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35, 134, 54, 0.09);
}

.form-control:disabled {
    background: var(--background);
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.form-error {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}


/* =====================================================
   9. CARD SYSTEM
===================================================== */

.card {
    min-width: 0;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    overflow: hidden;

    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 18px;
}

.card-footer {
    padding: 15px 18px;
    border-top: 1px solid var(--border-light);
}


/* =====================================================
   10. PRICE SYSTEM
===================================================== */

.price {
    color: var(--price);
    font-weight: 700;
}

.price-current {
    color: var(--price);
    font-size: 18px;
    font-weight: 700;
}

.price-old {
    color: var(--price-old);
    font-size: 13px;
    text-decoration: line-through;
}

.price-discount {
    color: var(--sale);
    font-size: 12px;
    font-weight: 600;
}


/* =====================================================
   11. BADGE SYSTEM
===================================================== */

.badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    padding: 4px 9px;

    border-radius: var(--radius-sm);

    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary {
    color: var(--primary);
    background: var(--primary-light);
}

.badge-success {
    color: #17652a;
    background: #e8f5e9;
}

.badge-danger {
    color: #d73211;
    background: #fff0ed;
}

.badge-warning {
    color: #9a6500;
    background: #fff4dc;
}

.badge-sale {
    color: var(--white);
    background: var(--sale);
}


/* =====================================================
   12. ALERT SYSTEM
===================================================== */

.alert {
    padding: 12px 16px;
    margin-bottom: 15px;

    border: 1px solid transparent;
    border-radius: var(--radius);

    font-size: 13px;
}

.alert-success {
    color: #17652a;
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.alert-danger {
    color: #b42318;
    background: #fff0ed;
    border-color: #ffd2ca;
}

.alert-warning {
    color: #8a5a00;
    background: #fff4dc;
    border-color: #ffe2a8;
}

.alert-info {
    color: #155b85;
    background: #eaf5fc;
    border-color: #c9e5f6;
}


/* =====================================================
   13. DIVIDER
===================================================== */

.divider {
    width: 100%;
    height: 1px;

    margin: 20px 0;

    background: var(--border);
}

.divider-light {
    background: var(--border-light);
}


/* =====================================================
   14. LOADING
===================================================== */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 100px;

    color: var(--text-muted);
}

.loading-spinner {
    width: 28px;
    height: 28px;

    border: 3px solid var(--border);
    border-top-color: var(--primary);

    border-radius: 50%;

    animation: common-spin 0.8s linear infinite;
}

@keyframes common-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =====================================================
   15. EMPTY STATE
===================================================== */

.empty-state {
    width: 100%;
    padding: 45px 20px;

    text-align: center;

    color: var(--text-muted);
    background: var(--background-light);

    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 18px;
}

.empty-state p {
    margin-bottom: 0;
}


/* =====================================================
   16. TEXT UTILITIES
===================================================== */

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-light) !important;
}

.fw-normal {
    font-weight: 400;
}

.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}


/* =====================================================
   17. BACKGROUND UTILITIES
===================================================== */

.bg-white {
    background: var(--white);
}

.bg-light {
    background: var(--background-light);
}

.bg-primary {
    background: var(--primary);
}

.bg-primary-light {
    background: var(--primary-light);
}


/* =====================================================
   18. DISPLAY UTILITIES
===================================================== */

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-grid {
    display: grid !important;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-5 {
    gap: 5px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}


/* =====================================================
   19. SPACING UTILITIES
===================================================== */

.m-0 {
    margin: 0 !important;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}


/* =====================================================
   20. WIDTH UTILITIES
===================================================== */

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}


/* =====================================================
   21. BORDER UTILITIES
===================================================== */

.border {
    border: 1px solid var(--border);
}

.border-top {
    border-top: 1px solid var(--border);
}

.border-bottom {
    border-bottom: 1px solid var(--border);
}

.rounded {
    border-radius: var(--radius);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}


/* =====================================================
   22. RESPONSIVE - LARGE TABLET
===================================================== */

@media (max-width: 1100px) {

    :root {
        --container-padding: 4%;
    }

    .container {
        width: 92%;
    }

    .section {
        padding: 55px 0;
    }

}


/* =====================================================
   23. RESPONSIVE - TABLET
===================================================== */

@media (max-width: 768px) {

    .container,
    .container-sm {
        width: 94%;
    }

    .container-fluid {
        padding-left: 3%;
        padding-right: 3%;
    }

    .section {
        padding: 42px 0;
    }

    .section-sm {
        padding: 30px 0;
    }

    .section-lg {
        padding: 55px 0;
    }

    .section-title {
        margin-bottom: 25px;
    }

    .section-title h2 {
        font-size: 23px;
    }

    .section-title p {
        font-size: 13px;
    }

    .btn {
        min-height: 40px;
        padding: 9px 17px;
        font-size: 13px;
    }

    .card-body {
        padding: 15px;
    }

}


/* =====================================================
   24. RESPONSIVE - SMALL MOBILE
===================================================== */

@media (max-width: 480px) {

    .container,
    .container-sm {
        width: 94%;
    }

    .section {
        padding: 32px 0;
    }

    .section-sm {
        padding: 25px 0;
    }

    .section-lg {
        padding: 40px 0;
    }

    .section-title {
        margin-bottom: 22px;
    }

    .section-title h2 {
        font-size: 21px;
    }

    .section-title p {
        font-size: 12px;
    }

    .btn {
        min-height: 38px;
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-lg {
        min-height: 44px;
        padding: 10px 18px;
    }

    .card-body {
        padding: 12px;
    }

}


/* =====================================================
   25. REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}

/* =====================================================
   26. TOAST NOTIFICATION SYSTEM
===================================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    gap: 12px;

    width: 360px;
    max-width: calc(100% - 30px);

    pointer-events: none;
}

/* Toast Positions */
.toast-top-left {
    top: 20px;
    left: 20px;
}

.toast-top-right {
    top: 20px;
    right: 20px;
}

.toast-bottom-left {
    bottom: 20px;
    left: 20px;
    flex-direction: column-reverse;
}

.toast-bottom-right {
    bottom: 20px;
    right: 20px;
    flex-direction: column-reverse;
}

/* Toast Item */
.toast {
    position: relative;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    width: 100%;
    padding: 14px 16px;

    background: var(--white);

    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);

    box-shadow: var(--shadow-hover);

    pointer-events: auto;

    animation: toast-slide-in 0.3s ease forwards;
}

/* Toast Types */
.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: #2196f3;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    font-size: 18px;
    font-weight: 700;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: #2196f3;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    margin-bottom: 3px;

    color: var(--text-dark);

    font-size: 14px;
    font-weight: 700;
}

.toast-message {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

/* Close Button */
.toast-close {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    padding: 0;

    color: var(--text-light);
    background: transparent;

    border: none;
    border-radius: var(--radius-sm);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-dark);
    background: var(--background);
}

/* Animations */
@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(25px);
    }
}

.toast.toast-hiding {
    animation: toast-slide-out 0.25s ease forwards;
}

/* Top Left Animation */
.toast-top-left .toast {
    animation-name: toast-slide-left;
}

@keyframes toast-slide-left {
    from {
        opacity: 0;
        transform: translateX(-25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bottom Position Animation */
.toast-bottom-left .toast,
.toast-bottom-right .toast {
    animation-name: toast-slide-up;
}

@keyframes toast-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {

    .toast-container {
        width: auto;
        max-width: none;

        left: 12px;
        right: 12px;
    }

    .toast-top-left,
    .toast-top-right {
        top: 12px;
    }

    .toast-bottom-left,
    .toast-bottom-right {
        bottom: 12px;
    }

    .toast {
        padding: 12px;
    }

}
