:root {
    --ink: #171512;
    --muted: #70685f;
    --paper: #f7f2ea;
    --panel: #fffaf2;
    --line: rgba(55, 45, 35, .14);
    --walnut: #7a4b2b;
    --copper: #c77945;
    --olive: #52634a;
    --charcoal: #202421;
    --cream: #fff8ed;
    --shadow: 0 24px 70px rgba(42, 33, 24, .18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

body.rtl {
    text-align: right;
}

a {
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.site-navbar {
    backdrop-filter: blur(18px);
    background: rgba(247, 242, 234, .86);
    border-bottom: 1px solid var(--line);
    min-height: 78px;
}

.brand-mark,
.brand-logo {
    align-items: center;
    background: linear-gradient(135deg, var(--charcoal), var(--olive));
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    letter-spacing: 0;
    min-width: 48px;
    padding: 0 10px;
}

.brand-logo {
    background: #15120f;
    border: 1px solid rgba(199, 121, 69, .35);
    overflow: hidden;
    padding: 0;
    width: 48px;
}

.brand-logo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.brand-name {
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 900;
}

.site-navbar .nav-link {
    color: #443d36;
    font-weight: 800;
    padding-inline: .9rem !important;
}

.site-navbar .nav-link:hover {
    color: var(--copper);
}

.btn-accent {
    --bs-btn-bg: var(--copper);
    --bs-btn-border-color: var(--copper);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #a85e32;
    --bs-btn-hover-border-color: #a85e32;
    --bs-btn-hover-color: #fff;
    font-weight: 900;
}

.decor-hero {
    background:
        radial-gradient(circle at 18% 24%, rgba(199, 121, 69, .24), transparent 24rem),
        linear-gradient(135deg, #181713 0%, #2d332d 58%, #614125 100%);
    color: #fff;
    background-position: center;
    background-size: cover;
    min-height: 86vh;
    overflow: hidden;
    position: relative;
}

.decor-hero::before {
    background-image:
        linear-gradient(30deg, rgba(255, 255, 255, .06) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .06) 87.5%, rgba(255, 255, 255, .06)),
        linear-gradient(150deg, rgba(255, 255, 255, .06) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .06) 87.5%, rgba(255, 255, 255, .06));
    background-size: 88px 152px;
    content: "";
    inset: 0;
    opacity: .18;
    position: absolute;
}

.decor-hero > .container-fluid {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 760px;
    padding-top: 4rem;
}

.section-kicker {
    align-items: center;
    color: var(--copper);
    display: inline-flex;
    font-size: .94rem;
    font-weight: 900;
    gap: .55rem;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

.decor-hero .section-kicker {
    color: #f4c28b;
}

.hero-content h1,
.section-heading h2,
.contact-section h2,
.category-hero h1 {
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.12;
}

.hero-content h1 {
    font-size: clamp(2.65rem, 6vw, 5.9rem);
    margin-bottom: 1.4rem;
}

.hero-lead {
    color: rgba(255, 255, 255, .8);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.9;
    margin-bottom: 2rem;
    max-width: 680px;
}

.hero-showcase {
    min-height: 520px;
    position: relative;
}

.hero-swiper,
.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide {
    height: 520px;
}

.hero-photo {
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: var(--shadow);
    display: block;
    inset: 2.5rem 0 4.5rem 3rem;
    overflow: hidden;
    position: absolute;
}

.rtl .hero-photo {
    inset: 2.5rem 3rem 4.5rem 0;
}

.hero-photo img {
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    width: 100%;
}

.cnc-panel {
    background: rgba(255, 248, 237, .94);
    bottom: 1rem;
    box-shadow: var(--shadow);
    color: var(--ink);
    display: grid;
    gap: .35rem;
    max-width: 330px;
    padding: 1.25rem;
    position: absolute;
    right: 1rem;
}

.rtl .cnc-panel {
    left: 1rem;
    right: auto;
}

.cnc-panel i {
    color: var(--copper);
    font-size: 2rem;
}

.cnc-panel strong {
    font-size: 1.18rem;
    font-weight: 900;
}

.cnc-panel span {
    color: var(--muted);
    line-height: 1.7;
}

.material-chip {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 900;
    padding: .75rem 1.1rem;
    position: absolute;
}

.chip-wood {
    left: 1rem;
    top: 9rem;
}

.chip-marble {
    right: 2rem;
    top: 4.8rem;
}

.chip-light {
    left: 18%;
    bottom: 7rem;
}

.service-strip {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 0;
}

.service-tile {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    gap: .8rem;
    min-height: 84px;
    padding: 1rem;
}

.service-tile i {
    color: var(--copper);
    font-size: 1.7rem;
}

.service-tile span {
    font-weight: 900;
}

.section-block {
    padding: clamp(3rem, 5vw, 5rem) 0;
}

.section-heading {
    margin-bottom: 2rem;
    max-width: none;
}

.section-heading h2,
.contact-section h2 {
    font-size: clamp(2rem, 4vw, 4rem);
}

.section-heading h2 {
    max-width: 1200px;
}

.category-swiper {
    padding-bottom: 3rem;
}

.category-card {
    background: var(--cream);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(42, 33, 24, .08);
    color: var(--ink);
    display: grid;
    gap: 1rem;
    height: 100%;
    min-height: 390px;
    overflow: hidden;
    position: relative;
}

.category-card img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .5s ease;
    width: 100%;
}

.category-card:hover img {
    transform: scale(1.08);
}

.category-card div {
    display: grid;
    gap: .45rem;
    padding: 0 1.1rem 1.3rem;
}

.category-card span {
    font-size: 1.35rem;
    font-weight: 900;
}

.category-card small {
    color: var(--muted);
    font-size: .98rem;
    line-height: 1.7;
}

.category-card > i {
    background: var(--charcoal);
    color: #fff;
    display: grid;
    height: 44px;
    place-items: center;
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: 44px;
}

.rtl .category-card > i {
    left: 1rem;
    right: auto;
}

.swiper-pagination-bullet-active {
    background: var(--copper);
}

.gallery-section {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .4), transparent),
        #ece2d4;
}

.filter-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: .6rem;
    margin-top: 1rem;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: .25rem;
    scrollbar-width: thin;
}

.filter-pills button {
    background: #fffaf2;
    border: 1px solid var(--line);
    color: var(--muted);
    flex: 0 0 auto;
    font-weight: 900;
    padding: .65rem 1rem;
    white-space: nowrap;
}

.filter-pills button.active,
.filter-pills button:hover {
    background: var(--charcoal);
    color: #fff;
}

.gallery-masonry {
    columns: 5 220px;
    column-gap: 1rem;
}

.gallery-card {
    break-inside: avoid;
    color: #fff;
    display: block;
    margin: 0 0 1rem;
    overflow: hidden;
    position: relative;
}

.gallery-card.is-hidden {
    display: none;
}

.gallery-card img {
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
    transition: transform .5s ease, filter .5s ease;
    width: 100%;
}

.gallery-card:nth-child(3n) img {
    aspect-ratio: 1 / 1;
}

.gallery-card:hover img {
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.06);
}

.gallery-card span {
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78));
    bottom: 0;
    display: grid;
    gap: .25rem;
    left: 0;
    padding: 4rem 1rem 1rem;
    position: absolute;
    right: 0;
}

.gallery-card strong {
    font-size: 1.08rem;
    font-weight: 900;
}

.gallery-card small {
    color: rgba(255, 255, 255, .78);
}

.gallery-section .section-heading {
    align-items: stretch !important;
    display: grid !important;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1fr);
}

.gallery-section .section-heading > div:first-child {
    min-width: 0;
}

.gallery-section .section-heading h2 {
    max-width: none;
}

.contact-section {
    background:
        linear-gradient(135deg, rgba(23, 21, 18, .96), rgba(50, 59, 49, .96)),
        var(--charcoal);
    color: #fff;
    padding: clamp(3rem, 5vw, 5rem) 0;
}

.contact-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid a {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    display: grid;
    gap: .3rem;
    padding: 1.2rem;
}

.contact-grid i {
    color: #f4c28b;
    font-size: 1.8rem;
}

.contact-grid span {
    color: rgba(255, 255, 255, .66);
}

.contact-grid strong {
    font-size: 1.06rem;
}

.category-hero {
    background: linear-gradient(135deg, var(--charcoal), #5d3c23);
    color: #fff;
    padding: 9rem 0 5rem;
}

.category-hero h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
}

.category-hero p {
    color: rgba(255, 255, 255, .78);
    font-size: 1.2rem;
    line-height: 1.9;
    max-width: 760px;
}

.back-link {
    color: #f4c28b;
    display: inline-flex;
    font-weight: 900;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.site-footer {
    background: #11100e;
    color: #fff;
    padding: 2rem 0;
}

.site-footer p,
.footer-note {
    color: rgba(255, 255, 255, .68);
}

.admin-shell {
    margin: 7rem auto 3rem;
    max-width: 1180px;
    padding: 0 1rem;
}

.admin-console {
    background: #f3eee6;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 78px);
    padding-top: 78px;
}

.admin-sidebar {
    background: #191815;
    color: #fff;
    min-height: calc(100vh - 78px);
    padding: 1.2rem;
    position: sticky;
    top: 78px;
}

.admin-brand {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    display: flex;
    gap: .8rem;
    padding-bottom: 1rem;
}

.admin-brand img {
    height: 54px;
    object-fit: cover;
    width: 54px;
}

.admin-brand span {
    font-weight: 900;
    line-height: 1.4;
}

.admin-menu {
    display: grid;
    gap: .4rem;
    margin-top: 1.2rem;
}

.admin-menu a {
    align-items: center;
    color: rgba(255, 255, 255, .76);
    display: flex;
    gap: .8rem;
    padding: .85rem .9rem;
}

.admin-menu a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.admin-menu i {
    color: #f4c28b;
    font-size: 1.15rem;
}

.admin-main {
    min-width: 0;
    padding: 1.5rem;
}

.admin-toolbar {
    align-items: center;
    background: #fffaf2;
    border: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    padding: 1.2rem;
}

.admin-toolbar h1 {
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 900;
    margin: 0;
}

.admin-kicker {
    color: var(--copper);
    font-size: .9rem;
    font-weight: 900;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.admin-helper {
    align-items: center;
    background: #fff7e8;
    border: 1px solid rgba(199, 121, 69, .24);
    color: #5d5146;
    display: flex;
    gap: .8rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding: 1rem;
}

.admin-helper i {
    color: var(--copper);
    font-size: 1.4rem;
}

.admin-icon-preview {
    align-items: center;
    background: #fff7e8;
    color: var(--copper);
    display: inline-flex;
    font-size: 1.4rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.admin-shell.narrow {
    max-width: 460px;
}

.admin-top {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.admin-nav a,
.admin-top a,
.danger {
    color: var(--copper);
    font-weight: 900;
}

.admin-form,
.grid-form,
.table-row {
    display: grid;
    gap: .75rem;
}

.grid-form,
.settings-form,
.table-row,
.image-admin-card,
.stat-grid a {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 36px rgba(42, 33, 24, .06);
}

.grid-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.table-row input,
.table-row select {
    border: 1px solid rgba(55, 45, 35, .22);
    font: inherit;
    padding: .72rem .85rem;
    width: 100%;
}

.admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-form button,
.table-row button {
    background: var(--charcoal);
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    padding: .75rem 1rem;
}

.settings-form {
    margin: 0 auto;
    max-width: 760px;
    padding: 1.1rem;
}

.check,
.table-row label {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.check input,
.table-row label input {
    width: auto;
}

.admin-table {
    display: grid;
    gap: .85rem;
}

.table-row {
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: .85rem;
}

.image-upload-panel {
    background: linear-gradient(135deg, #fffaf2, #efe4d4);
    border: 1px solid var(--line);
    display: grid;
    gap: 1.3rem;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    margin-bottom: 1.4rem;
    padding: 1.2rem;
}

.image-upload-panel h2,
.admin-gallery-toolbar h2 {
    font-weight: 900;
    margin: .25rem 0 0;
}

.upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-form label,
.edit-image-form label {
    font-weight: 800;
}

.upload-drop {
    align-items: center;
    background: #fff;
    border: 2px dashed rgba(199, 121, 69, .45);
    cursor: pointer;
    display: flex;
    gap: .8rem;
    min-height: 70px;
    padding: 1rem;
}

.upload-drop i {
    color: var(--copper);
    font-size: 1.8rem;
}

.upload-drop input {
    display: none;
}

.upload-preview {
    background: #fff;
    display: none;
    height: 132px;
    object-fit: cover;
    width: 100%;
}

.upload-preview.show {
    display: block;
}

.admin-gallery-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0 1rem;
}

.admin-gallery-toolbar span,
.image-card-body span {
    color: var(--muted);
}

.image-admin-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.image-admin-grid.improved {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.image-admin-card {
    padding: .85rem;
}

.admin-image-preview {
    display: block;
    overflow: hidden;
}

.image-admin-card img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .35s ease;
    width: 100%;
}

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

.image-card-body {
    align-items: flex-start;
    display: flex;
    gap: .8rem;
    justify-content: space-between;
    padding: .85rem 0;
}

.image-card-body strong {
    display: block;
    font-weight: 900;
}

.featured-badge {
    background: #fff0cf;
    color: #8b5a08;
    font-size: .82rem;
    font-weight: 900;
    padding: .3rem .55rem;
    white-space: nowrap;
}

.image-card-actions {
    display: flex;
    gap: .5rem;
    padding-bottom: .7rem;
}

.edit-image-form {
    background: #faf5ec;
    border-top: 1px solid var(--line);
    padding-top: .85rem;
}

.stat-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-grid a {
    color: var(--ink);
    display: grid;
    gap: .5rem;
    padding: 1.4rem;
}

.stat-grid strong {
    color: var(--copper);
    font-size: 3rem;
    font-weight: 900;
}

.alert {
    background: #ffe4df;
    color: #8f2117;
    margin-bottom: 1rem;
    padding: .85rem;
}

@media (max-width: 991.98px) {
    .site-menu {
        background: var(--paper);
    }

    .hero-content {
        padding-top: 6.5rem;
    }

    .hero-showcase {
        min-height: 430px;
    }

    .hero-swiper,
    .hero-swiper .swiper-wrapper,
    .hero-swiper .swiper-slide {
        height: 430px;
    }

    .hero-photo {
        inset: 1rem 0 3rem 0;
    }

    .rtl .hero-photo {
        inset: 1rem 0 3rem 0;
    }

    .cnc-panel {
        bottom: 0;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .material-chip {
        display: none;
    }

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

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

    .admin-sidebar {
        min-height: auto;
        position: static;
    }

    .admin-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main {
        padding: 1rem;
    }

    .admin-toolbar,
    .image-upload-panel {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        align-items: flex-start;
        display: grid;
    }

    .upload-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .brand-name {
        font-size: .92rem;
        max-width: 170px;
    }

    .brand-mark {
        height: 42px;
        min-width: 42px;
    }

    .brand-logo {
        height: 42px;
        min-width: 42px;
        width: 42px;
    }

    .hero-content h1 {
        font-size: 2.35rem;
    }

    .hero-lead {
        font-size: 1rem;
    }

    .section-block {
        padding: 3.5rem 0;
    }

    .service-tile {
        align-items: flex-start;
        display: grid;
        min-height: 112px;
    }

    .gallery-masonry {
        columns: 1;
    }

    .admin-top {
        align-items: flex-start;
        display: grid;
    }

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