/* Modern UI layer for WebPCCC.
   Giữ logic Razor/controller cũ, chỉ chuẩn hóa giao diện, spacing và trạng thái hover. */

:root {
    --brand: #9f1111;
    --brand-dark: #710707;
    --brand-soft: #fff1f1;
    --ink: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 8px;
}

html {
    scroll-padding-top: 104px;
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(159, 17, 17, 0.08), transparent 28rem),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 42%, #ffffff 100%);
}

.site-page {
    min-height: 100vh;
    background: transparent;
}

.container-modern {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    color: var(--brand);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.15;
}

.brand-lockup img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    padding: 4px;
}

.brand-lockup span {
    max-width: 360px;
    overflow-wrap: anywhere;
    font-size: clamp(0.95rem, 1.4vw, 1.35rem);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    align-items: center;
    justify-content: center;
}

.nav-toggle:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

.site-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius);
    padding: 0 12px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--brand);
    background: var(--brand-soft);
}

.site-nav .nav-admin {
    color: #ffffff;
    background: var(--brand);
}

.site-nav .nav-admin:hover {
    color: #ffffff;
    background: var(--brand-dark);
}

.site-nav .nav-bell {
    position: relative;
    gap: 7px;
    color: var(--brand);
    background: var(--brand-soft);
}

.site-nav .nav-bell i {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.site-main {
    min-height: 60vh;
}

.section-modern {
    padding: clamp(56px, 7vw, 92px) 0;
}

.section-soft {
    background: var(--surface-soft);
    border-block: 1px solid var(--line);
}

.section-eyebrow {
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.display-red-title {
    color: var(--brand);
    font-size: clamp(2.15rem, 4.8vw, 4rem);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
}

.display-subtitle {
    margin-top: 12px;
    color: var(--ink);
    font-size: clamp(1.05rem, 2vw, 1.55rem);
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
}

.display-left {
    text-align: left;
}

.section-title {
    margin-top: 10px;
    color: var(--ink);
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: 0;
}

.section-copy {
    color: var(--muted);
    line-height: 1.8;
    font-size: 1rem;
}

.hero-modern {
    position: relative;
    min-height: clamp(430px, 58vh, 590px);
    overflow: hidden;
    background: #111827;
    color: #ffffff;
}

.hero-modern .swiper,
.hero-modern .swiper-wrapper,
.hero-modern .swiper-slide {
    height: 100%;
}

.hero-modern .swiper {
    position: absolute;
    inset: 0;
    padding: 0 !important;
}

.hero-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.86) 0%, rgba(15, 23, 42, 0.62) 45%, rgba(15, 23, 42, 0.24) 100%),
        linear-gradient(180deg, transparent 66%, rgba(15, 23, 42, 0.7) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    min-height: inherit;
    display: flex;
    align-items: center;
    padding: 38px 0 52px;
    pointer-events: none;
}

.hero-panel {
    max-width: 760px;
    pointer-events: auto;
}

.hero-title {
    margin-top: 16px;
    font-size: clamp(2.4rem, 6vw, 5.3rem);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-kicker {
    margin-top: 14px;
    color: #fee2e2;
    font-size: clamp(1.12rem, 2.5vw, 2rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-brand-title {
    margin-top: 8px;
    color: #ffffff;
    font-size: clamp(2.15rem, 5.4vw, 4.85rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-transform: uppercase;
}

.hero-lead {
    max-width: 680px;
    margin-top: 20px;
    color: #e2e8f0;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.85;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 28px;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.trust-pill {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    padding: 10px 14px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
}

.btn-modern {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius);
    padding: 0 18px;
    font-weight: 900;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-modern:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #ffffff;
    background: var(--brand);
    box-shadow: 0 16px 32px rgba(159, 17, 17, 0.24);
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-light {
    color: var(--brand);
    background: #ffffff;
}

.btn-outline {
    color: var(--brand);
    border: 1px solid rgba(159, 17, 17, 0.32);
    background: #ffffff;
}

.btn-outline:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--brand);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
    transform: translateY(-1px);
}

.card-modern {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-modern:hover {
    transform: translateY(-4px);
    border-color: rgba(159, 17, 17, 0.24);
    box-shadow: var(--shadow-md);
}

.product-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
}

.product-image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 22px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-body {
    padding: 18px;
    border-top: 1px solid #f1f5f9;
}

.product-title {
    min-height: 48px;
    color: var(--ink);
    font-size: clamp(1.08rem, 1.55vw, 1.22rem);
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
}

.product-price {
    margin-top: 10px;
    color: var(--brand);
    font-weight: 900;
    text-align: right;
}

.product-price-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-price-value {
    display: block;
    margin-top: 2px;
    color: var(--brand);
    font-size: 1.12rem;
    line-height: 1.2;
}

.category-sidebar {
    position: sticky;
    top: 104px;
}

.form-modern {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.form-modern input,
.form-modern select,
.form-modern textarea,
.input-modern {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-modern input,
.form-modern select,
.input-modern {
    min-height: 46px;
    padding: 0 14px;
}

.form-modern textarea {
    padding: 14px;
}

.form-modern input:focus,
.form-modern select:focus,
.form-modern textarea:focus,
.input-modern:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(159, 17, 17, 0.1);
}

.label-modern {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern th {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-modern th,
.table-modern td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

/* Rich text editor shared by product and service admin forms. */
.rich-editor {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.rich-editor > .label-modern {
    padding: 16px 18px 0;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid transparent;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.rich-editor-toolbar button,
.rich-editor-toolbar select {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 900;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.rich-editor-toolbar button {
    min-width: 40px;
    padding: 0 12px;
}

.rich-editor-toolbar select {
    padding: 0 10px;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar select:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.rich-editor-surface {
    min-height: 220px;
    padding: 18px;
    color: #334155;
    line-height: 1.8;
    outline: none;
}

.rich-editor-surface:focus {
    box-shadow: inset 0 0 0 2px rgba(159, 17, 17, 0.14);
}

.rich-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.rich-content {
    overflow-wrap: anywhere;
}

.rich-content p,
.rich-content div {
    margin: 0 0 0.9rem;
}

.rich-content p:last-child,
.rich-content div:last-child {
    margin-bottom: 0;
}

.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin: 1rem 0 0.5rem;
    color: var(--ink);
    font-weight: 950;
    line-height: 1.25;
}

.rich-content ul,
.rich-content ol {
    margin: 0.75rem 0 0.75rem 1.3rem;
    padding-left: 1rem;
}

.rich-content ul {
    list-style: disc;
}

.rich-content ol {
    list-style: decimal;
}

.rich-content li {
    margin: 0.35rem 0;
}

/* Admin dashboard helpers: compact cards that remain readable on phone screens. */
.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.admin-metric-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.admin-metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-metric-card strong {
    display: block;
    margin-top: 8px;
    color: var(--brand);
    font-size: 2rem;
    line-height: 1;
    font-weight: 950;
}

.system-log-view {
    max-height: 620px;
    overflow: auto;
    margin: 0;
    padding: 18px;
    color: #e2e8f0;
    font-size: 0.82rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.site-footer {
    color: #e2e8f0;
    background: #111827;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) minmax(220px, 0.8fr);
    gap: 32px;
    padding: 56px 0;
}

.footer-title {
    color: #ffffff;
    font-weight: 950;
    text-transform: uppercase;
}

.footer-link {
    color: #cbd5e1;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #ffffff;
}

.floating-actions {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.floating-actions a,
.floating-phone {
    min-width: 52px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.floating-actions a:hover,
.floating-phone:hover {
    transform: translateY(-2px);
    filter: brightness(0.96);
}

.swiper-button-next,
.swiper-button-prev,
.swiper-nav-modern {
    width: 44px !important;
    height: 44px !important;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand) !important;
    box-shadow: var(--shadow-sm);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 15px !important;
    font-weight: 900;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--brand);
    color: #ffffff !important;
    border-color: var(--brand);
}

.service-detail-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 12px 0;
}

.service-detail-content ul {
    list-style: disc;
    padding-left: 22px;
}

@media (max-width: 1024px) {
    .header-inner {
        min-height: 74px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(100% + 8px);
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #ffffff;
        box-shadow: var(--shadow-md);
    }

    .site-nav.is-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .site-nav a {
        justify-content: center;
    }

    .category-sidebar {
        position: static;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container-modern {
        width: min(100% - 24px, 1180px);
    }

    .brand-lockup img {
        width: 44px;
        height: 44px;
    }

    .brand-lockup span {
        max-width: 220px;
        font-size: 0.88rem;
    }

    .site-nav.is-open {
        grid-template-columns: 1fr;
    }

    .hero-modern {
        min-height: 520px;
    }

    .hero-actions .btn-modern,
    .button-row .btn-modern {
        width: 100%;
    }

    .floating-actions {
        right: 14px;
        bottom: 14px;
        gap: 8px;
    }

    .floating-actions a,
    .floating-phone {
        min-width: 48px;
        min-height: 48px;
    }

    .admin-metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    .system-log-view {
        max-height: 520px;
        font-size: 0.76rem;
    }
}
