:root {
    --bg: #f5f7fb;
    --text: #202633;
    --muted: #5b6477;
    --primary: #0a4fd6;
    --primary-dark: #063aa2;
    --card: #ffffff;
    --border: #dbe2f0;
    --success: #0d8a57;
    --danger: #bf1d3c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

.topbar {
    background: #0e1626;
    color: #c9d4f0;
    font-size: 14px;
    padding: 8px 0;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.header-row {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-horizontal {
    background: linear-gradient(90deg, #0b204d, #0a4fd6);
    color: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    text-decoration: none;
}

.logo-horizontal.is-image {
    background: transparent;
    padding: 0;
    min-height: auto;
    border-radius: 0;
    box-shadow: none;
}

.logo-image {
    display: block;
    width: min(100%, 440px);
    max-height: 80px;
    height: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nav a {
    color: #23304a;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 6px;
}

.nav a:hover {
    background: #eaf0ff;
}

.menu-toggle {
    display: none;
    border: 1px solid #cad6f2;
    background: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 700;
    color: #263861;
    cursor: pointer;
}

.hero {
    background: linear-gradient(120deg, #0b1a39 0%, #0a4fd6 100%);
    color: #fff;
    padding: 62px 0;
}

.home-slider {
    --slider-height: 420px;
    position: relative;
    height: var(--slider-height);
    overflow: hidden;
    background: #0e1626;
}

.home-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.45s ease;
}

.home-slide {
    position: relative;
    flex: 0 0 100%;
    height: 100%;
}

.home-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    color: #fff;
    background: linear-gradient(90deg, rgba(8, 18, 40, 0.65), rgba(8, 18, 40, 0.18));
}

.home-slide-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.home-slide-content h2 {
    margin: 0;
    font-size: clamp(22px, 3.2vw, 42px);
}

.home-slide-content p {
    margin: 0;
    max-width: 650px;
    color: #e4ecff;
}

.home-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #162441;
    font-size: 28px;
    cursor: pointer;
}

.home-slider-nav.prev {
    left: 16px;
}

.home-slider-nav.next {
    right: 16px;
}

.home-slider-dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    display: flex;
    gap: 8px;
}

.home-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.home-slider-dot.active {
    background: #fff;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4.5vw, 48px);
}

.hero p {
    margin: 0 0 24px;
    color: #d9e4ff;
    max-width: 700px;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 8px;
    padding: 11px 18px;
    font-weight: 700;
    display: inline-block;
}

.btn-primary {
    color: #fff;
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    color: var(--primary);
    border: 1px solid var(--primary);
    background: transparent;
}

.hero .btn-outline {
    color: #fff;
    border-color: #fff;
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
}

.page-content {
    flex: 1;
}

.section {
    padding: 46px 0;
}

.section-title {
    font-size: 28px;
    margin: 0 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.carousel-box {
    position: relative;
    background: #eef3ff;
    border: 1px solid #d8e4ff;
    border-radius: 14px;
    padding: 14px;
}

.cards-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 340px);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
}

.cards-carousel .card {
    scroll-snap-align: start;
}

.cards-carousel::-webkit-scrollbar {
    height: 10px;
}

.cards-carousel::-webkit-scrollbar-thumb {
    background: #b8c8ea;
    border-radius: 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(16, 36, 70, 0.05);
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.card-media {
    position: relative;
    cursor: pointer;
    aspect-ratio: 621 / 931;
    height: 0;
    padding-top: 149.92%;
    overflow: hidden;
    background: #eef2fa;
}

.media-slider {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.media-track {
    position: absolute;
    inset: 0;
    display: flex;
    transition: transform 0.35s ease;
}

.media-track img {
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
    min-width: 0;
    display: block;
    object-fit: cover;
}

.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(8, 16, 35, 0.7);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.media-nav.prev {
    left: 8px;
}

.media-nav.next {
    right: 8px;
}

.media-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.media-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.6);
    padding: 0;
    cursor: pointer;
}

.media-dot.active {
    background: #fff;
}

.card-content {
    padding: 16px;
}

.card h3 {
    margin: 0 0 8px;
}

.price {
    color: var(--success);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.footer {
    margin-top: auto;
    background: #0e1626;
    color: #b5c3e4;
    padding: 26px 0;
}

.footer-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.footer-left {
    text-align: left;
}

.footer-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0;
}

.footer-links a {
    color: #d4dff8;
    text-decoration: underline;
    text-decoration-color: rgba(212, 223, 248, 0.45);
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    text-align: center;
    margin-top: 14px;
}

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 22px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #c7d5f3;
    color: #1f335f;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
}

.category-bar .category-chip {
    text-decoration: none;
}

.category-chip.active {
    background: #0a4fd6;
    border-color: #0a4fd6;
    color: #fff;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 24, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.lightbox.open {
    display: flex;
}

.lightbox[aria-hidden="true"] {
    display: none !important;
}

.lightbox img {
    width: min(80vw, 620px);
    height: auto;
    max-height: 90vh;
    aspect-ratio: 621 / 931;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.lightbox-nav {
    border: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 22px;
}

.lightbox-next {
    right: 22px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd5ea;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.alert {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.alert-success {
    background: #e6f8ef;
    border: 1px solid #b6ebcb;
    color: #0a6d43;
}

.alert-danger {
    background: #ffebef;
    border: 1px solid #f3bcc8;
    color: #8d1530;
}

.admin-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: 260px 1fr;
}

.admin-menu a {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #243252;
    font-weight: 600;
}

.upload-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.upload-item img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 6px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    gap: 24px;
}

.detail-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.hero-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rich-content {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rich-content img,
.rich-content video,
.rich-content iframe {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}

.rich-content iframe {
    min-height: 240px;
    border: 0;
}

.rich-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-manager-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #f9fbff;
}

.image-manager-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.image-board {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
}

.image-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: grid;
    gap: 6px;
    padding: 6px;
    cursor: move;
    align-items: center;
    width: 160px;
    max-width: 100%;
}

.image-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: 160px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.image-card-meta {
    display: grid;
    gap: 3px;
}

.image-card-meta span {
    color: var(--muted);
    font-size: 11px;
    word-break: break-all;
}

.image-card-actions {
    display: flex;
    justify-content: flex-end;
}

.slide-admin-board {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.slide-admin-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: move;
}

.slide-admin-preview {
    width: 170px;
    max-width: 100%;
    height: 170px;
}

.slide-admin-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.new-slide-preview {
    width: 170px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px dashed var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: none;
    margin-bottom: 10px;
}

.new-slide-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-admin-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 880px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .header-row {
        min-height: auto;
        padding: 12px 0;
        flex-direction: column;
        align-items: stretch;
    }

    .logo-horizontal {
        width: 100%;
        text-align: center;
    }

    .menu-toggle {
        display: inline-block;
        width: 100%;
    }

    .nav {
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav.open {
        display: grid;
    }

    .nav a {
        text-align: center;
        background: #f4f7ff;
    }

    .cards-carousel {
        grid-auto-columns: minmax(240px, calc(100vw - 84px));
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .admin-filter-grid {
        grid-template-columns: 1fr;
    }

    .home-slider {
        --slider-height: 420px;
    }

    .home-slide-overlay {
        justify-content: center;
        background: linear-gradient(180deg, rgba(8, 18, 40, 0.6), rgba(8, 18, 40, 0.2));
    }

    .footer-top-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .slide-admin-item {
        grid-template-columns: 1fr;
    }

    .slide-admin-preview {
        width: 170px;
        height: 170px;
    }

    .slide-admin-fields {
        grid-template-columns: 1fr;
    }

    .lightbox img {
        width: min(90vw, 420px);
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}
