@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #091321;
    --panel: #101e31;
    --panel2: #172941;
    --line: #263950;
    --text: #f4f7fb;
    --muted: #91a0b4;
    --orange: #ff8b35;
    --orange-light: #ffad63;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Manrope, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    height: 76px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: #0b1727;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand > span:last-child {
    color: var(--orange);
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--orange);
    color: #111827;
    border-radius: 10px;
    font-size: 21px;
}

nav {
    display: flex;
    gap: 25px;
    font-size: 12px;
    font-weight: 700;
    color: #b8c5d5;
}

nav a:hover {
    color: var(--orange);
}

.container {
    width: min(1160px, 90%);
    margin: 0 auto;
    flex: 1;
    padding-bottom: 40px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin: 42px 0 65px;
    padding: 75px 7%;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(115deg, #142b45, #0e1b2d 65%, #192b41);
}

.eyebrow {
    color: var(--orange);
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 800;
}

.hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(45px, 7vw, 78px);
    line-height: 1.08;
    letter-spacing: -3px;
    margin: 22px 0;
}

.hero h1 span,
.detail-content h1 span,
.auth h1 span {
    color: var(--orange);
}

.hero p {
    position: relative;
    z-index: 1;
    max-width: 470px;
    color: #b1bfd0;
    font-size: 14px;
    line-height: 1.9;
}

.hero-decoration {
    position: absolute;
    width: 370px;
    height: 370px;
    right: 5%;
    top: -80px;
    border: 1px solid rgba(255,139,53,.2);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(255,139,53,.025),
                0 0 0 110px rgba(255,139,53,.02);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    border: 0;
    border-radius: 9px;
    padding: 14px 20px;
    background: var(--orange);
    color: #111827;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
}

.btn:hover {
    background: var(--orange-light);
    transform: translateY(-2px);
}

.hero .btn {
    margin-top: 18px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 25px;
}

.section-heading h2 {
    font-size: 28px;
    margin: 9px 0 0;
}

.section-heading small {
    display: inline-block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.search {
    display: flex;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 4px;
}

.search input {
    width: 190px;
    padding: 9px;
    background: transparent;
    border: 0;
    outline: none;
    color: white;
    font-family: inherit;
}

.search button {
    width: 38px;
    border: 0;
    border-radius: 7px;
    background: var(--orange);
    font-size: 22px;
    cursor: pointer;
}

/* ---------- FILTERS ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0 0 28px;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.filters select,
.filters input[type=number],
.filters input[type=text] {
    padding: 11px 12px;
    background: #0b1727;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.filters select:focus,
.filters input:focus {
    border-color: var(--orange);
}

.filters input[type=number] {
    width: 120px;
}

.filters .btn {
    padding: 11px 16px;
}

.filters .secondary {
    padding: 11px 16px;
}

/* ---------- PRODUCTS ---------- */

.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 65px;
}

.product {
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 15px;
    transition: .25s;
}

.product:hover {
    transform: translateY(-4px);
    border-color: #526a83;
}

.product-photo {
    height: 220px;
    position: relative;
    display: block;
    background: #17263a;
    overflow: hidden;
}

.product-photo img,
.detail-photo img,
.admin-thumb img,
.current-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, #29415c, #111e30);
    color: rgba(255,139,53,.6);
    font-size: 70px;
    font-weight: 800;
}

.photo-label {
    position: absolute;
    left: 13px;
    top: 13px;
    padding: 7px 10px;
    background: rgba(9,19,33,.85);
    border-radius: 5px;
    color: var(--orange);
    font-size: 9px;
    letter-spacing: 1px;
}

.product-content {
    padding: 19px;
}

.product-content h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.product-content p {
    height: 43px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
}

.product-bottom strong {
    font-size: 14px;
}

.product-bottom a {
    color: var(--orange);
    font-size: 11px;
    font-weight: 800;
}

/* ---------- PAGINATION ---------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding-bottom: 60px;
}

.pagination a {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #b8c5d5;
    font-size: 12px;
    font-weight: 700;
    transition: .2s;
}

.pagination a:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.pagination a.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #111827;
}

/* ---------- EMPTY ---------- */

.empty {
    text-align: center;
    padding: 75px 20px;
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 15px;
    margin-bottom: 60px;
}

.empty-symbol {
    font-size: 40px;
    color: var(--orange);
}

.empty p {
    color: var(--muted);
    font-size: 12px;
}

.empty .btn {
    margin-top: 14px;
}

/* ---------- BACK ---------- */

.back {
    display: inline-block;
    margin: 30px 0;
    color: var(--muted);
    font-size: 12px;
}

.back:hover {
    color: var(--orange);
}

/* ---------- DETAIL ---------- */

.detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 45px;
    padding-bottom: 70px;
}

.detail-photo {
    position: relative;
    height: 440px;
    overflow: hidden;
    border-radius: 17px;
    background: var(--panel);
}

.detail-photo #main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-content h1 {
    font-size: 42px;
    line-height: 1.2;
}

.detail-price {
    color: var(--orange);
    font-size: 25px;
    font-weight: 800;
    margin: 20px 0;
}

.detail-content > p {
    color: #b0bfd0;
    line-height: 1.9;
    font-size: 13px;
}

.category-badge {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 14px;
    background: rgba(255,139,53,.12);
    border: 1px solid rgba(255,139,53,.3);
    border-radius: 999px;
    color: var(--orange);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.category-badge:hover {
    background: rgba(255,139,53,.22);
}

/* ---------- GALLERY ---------- */

.gallery {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    background: rgba(9,19,33,.75);
    border-radius: 10px;
    backdrop-filter: blur(6px);
}

.gallery button {
    padding: 0;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    transition: .2s;
}

.gallery button:hover {
    border-color: var(--orange);
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery.existing {
    position: static;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    margin-top: 12px;
}

.gallery.existing .gallery-item {
    position: relative;
    width: 74px;
    height: 74px;
}

.gallery.existing .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.gallery.existing .gallery-item .danger.small {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
}

/* ---------- SPECS ---------- */

.specs {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.specs th,
.specs td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.specs tr:last-child th,
.specs tr:last-child td {
    border-bottom: 0;
}

.specs th {
    color: var(--muted);
    font-weight: 700;
    width: 42%;
}

.specs td {
    color: var(--text);
}

/* ---------- ORDER PANEL ---------- */

.order-panel {
    margin-top: 30px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.order-panel h3 {
    margin: 0;
    font-size: 15px;
}

.order-panel > p {
    color: var(--muted);
    font-size: 11px;
}

.messenger {
    display: flex;
    justify-content: space-between;
    padding: 13px;
    margin-top: 10px;
    border-radius: 8px;
    background: var(--panel2);
    font-size: 12px;
    font-weight: 800;
}

.messenger b {
    color: var(--orange);
}

.telegram:hover {
    background: #183b53;
}

.whatsapp:hover {
    background: #174431;
}

.max:hover {
    background: #273e66;
}

/* ---------- SIMILAR ---------- */

.similar {
    padding-bottom: 60px;
}

.similar h2 {
    font-size: 24px;
    margin: 0 0 20px;
}

.similar .products {
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: 0;
}

/* ---------- AUTH ---------- */

.auth {
    display: grid;
    place-items: center;
    padding: 65px 0;
}

.form {
    width: min(100%, 600px);
    padding: 30px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 15px;
}

.auth .form {
    max-width: 440px;
}

.form h1 {
    font-size: 29px;
    margin: 12px 0 25px;
}

.form label {
    display: block;
    margin: 17px 0 8px;
    color: #c7d2e0;
    font-size: 12px;
    font-weight: 700;
}

.form input:not([type=checkbox]),
.form select,
.form textarea {
    width: 100%;
    padding: 13px;
    background: #0b1727;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    border-color: var(--orange);
}

.form textarea {
    resize: vertical;
}

.form input[type=file] {
    font-size: 11px;
}

.full {
    width: 100%;
    margin-top: 20px;
}

/* ---------- ADMIN ---------- */

.admin-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 40px 0 25px;
    flex-wrap: wrap;
}

.admin-heading h1 {
    margin-bottom: 5px;
}

.admin-heading p {
    color: var(--muted);
    font-size: 12px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary,
.danger {
    border: 1px solid var(--line);
    background: var(--panel2);
    color: white;
    border-radius: 7px;
    padding: 10px 13px;
    font: 700 10px Manrope;
    cursor: pointer;
}

.secondary:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.danger {
    background: #49252e;
    border-color: #713c47;
    color: #ffc1c1;
}

.danger:hover {
    background: #5a2c37;
}

.admin-list {
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    margin-bottom: 60px;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.admin-item:last-child {
    border-bottom: 0;
}

.admin-thumb {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--panel2);
    color: var(--orange);
    font-size: 20px;
    font-weight: 800;
    border-radius: 8px;
}

.admin-info {
    flex: 1;
    min-width: 140px;
    display: grid;
    gap: 5px;
}

.admin-info strong {
    font-size: 12px;
}

.admin-info span,
.admin-info small {
    color: var(--muted);
    font-size: 10px;
}

.admin-info small {
    color: var(--orange);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.current-photo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    color: var(--muted);
    font-size: 11px;
}

.current-photo img {
    width: 75px;
    height: 75px;
    border-radius: 8px;
}

/* ---------- STATS ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0 0 28px;
}

.stat {
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.stat strong {
    display: block;
    font-size: 28px;
    color: var(--orange);
    line-height: 1.1;
}

.stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ---------- INLINE FORM ---------- */

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input[type=text] {
    padding: 10px 13px;
    background: #0b1727;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.inline-form input[type=text]:focus {
    border-color: var(--orange);
}

/* ---------- FLASH ---------- */

.flash {
    padding: 12px;
    margin-top: 12px;
    border-radius: 8px;
    font-size: 12px;
}

.flash.success {
    background: #123b2c;
    color: #8ce0b5;
}

.flash.error {
    background: #48242d;
    color: #ffb6b6;
}

/* ---------- FOOTER ---------- */

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 5%;
    border-top: 1px solid rgba(255,255,255,.07);
    background: #0b1727;
    color: #8190a5;
    font-size: 11px;
    text-align: center;
    width: 100%;
}

footer > span {
    display: block;
}

footer .site-credit {
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
}

footer .site-credit a {
    color: var(--orange);
    font-weight: 800;
    margin-left: 4px;
    text-decoration: none;
    transition: .2s;
}

footer .site-credit a:hover {
    color: var(--orange-light);
    text-decoration: underline;
}

/* ---------- RESPONSIVE ---------- */

@media(max-width:960px) {
    .similar .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:800px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .detail-photo {
        height: 340px;
    }

    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .similar .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:540px) {
    .topbar {
        height: 65px;
        padding: 0 5%;
    }

    .brand {
        font-size: 11px;
    }

    nav {
        gap: 12px;
        font-size: 10px;
    }

    .hero {
        margin: 22px 0 42px;
        padding: 42px 7%;
    }

    .hero h1 {
        font-size: 48px;
        letter-spacing: -2px;
    }

    .hero-decoration {
        opacity: .4;
        right: -180px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search,
    .search input {
        width: 100%;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters input[type=number] {
        width: 100%;
    }

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

    .similar .products {
        grid-template-columns: 1fr;
    }

    .product-photo {
        height: 230px;
    }

    .detail-content h1 {
        font-size: 32px;
    }

    .detail-photo {
        height: 300px;
    }

    .gallery button {
        width: 44px;
        height: 44px;
    }

    .specs th {
        width: 50%;
    }

    .form {
        padding: 22px;
    }

    .admin-item {
        gap: 7px;
        padding: 9px;
    }

    .admin-thumb {
        width: 43px;
        height: 43px;
    }

    .secondary,
    .danger {
        padding: 8px;
        font-size: 9px;
    }

    .stat strong {
        font-size: 22px;
    }
}