html {
    min-height: 100%;
    color: #ffffff;
}

* {
    font-family: 'Roboto', sans-serif;
}

html, body {
    font-weight: 300;
    height: 100%;
    margin: 0;
}

body {
    padding-inline: clamp(1rem, 2vw, 1.3rem);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background:
            radial-gradient(
                    circle at 190% 20%,
                    rgba(140, 0, 0, 0.35),
                    transparent 60%
            ),
            linear-gradient(
                    25deg,
                    #030303 10%,
                    #090909 50%,
                    #220000 70%,
                    #8B0000 100%
            );

    filter: url(#noise);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}

main {
    flex: 1;
}

p, a {
    margin: 0;
}

a {
  color: darkturquoise;
}

h1 {
    font-size: clamp(2rem, 7vw, 3.75rem);
    font-weight: 500;
    line-height: 1;
    word-break: break-word;
}

h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    line-height: 1.2;
}

@media (max-width: 768px) {
    html {
        background: linear-gradient(
                180deg,
                #050505 0%,
                #220000 100%
        );
    }
}

.side-menu-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    height: 3rem;
}

.side-menu {
    width: 12.5rem;
}

.items-page-wrap {
    display: flex;
}

.side-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-left: 0;
}

.side-menu-list li a {
    text-decoration: none;
    color: inherit;
    transition: color 0.5s ease-out;
}

.side-menu-list li a:hover,
.side-menu-list li a:focus,
.side-menu-list a.active {
    text-decoration: underline;
    color: rgb(255, 61, 36);
}

.side-menu-toggle,
.side-menu-overlay {
    display: none;
}

.side-menu-drawer {
    flex: 0 0 12.5rem;
}

.parts-page-section {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .items-page-wrap {
        display: block;
    }

    .side-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        margin: 1rem 0;
        padding: 0.7rem 1rem;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.25);
        color: white;
        border-radius: 0.5rem;
        font-size: 1rem;
        cursor: pointer;
    }

    .side-menu-drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 18rem);
        height: 100vh;
        background: #090909;
        padding: 1.5rem;
        box-sizing: border-box;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 3000;
        overflow-y: auto;
    }

    .side-menu-drawer.open {
        transform: translateX(0);
    }

    .side-menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.65);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 2999;
    }

    .side-menu-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    body.side-menu-open {
        overflow: hidden;
    }

    .side-menu {
        width: 100%;
    }
}

#transport-page-content {
    opacity: 1;
    transition: opacity 0.25s ease-out;
    will-change: opacity;
}

#transport-page-content.page-fade-out {
    opacity: 0;
}


.ad-list {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0 auto 5rem auto;
    align-self: center;
}

.ad-card {
    width: 14rem;
    max-width: 14rem;
    height: 20rem;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 0.4rem 0.4rem 1rem 0.4rem;
    display: flex;
    transition: scale 0.4s ease-out;
}

@media (max-width: 560px) {

    .ad-list {
        width: 100%;
        justify-content: center;
    }

    .home-cards-list {
        justify-items: center;
    }

    .ad-list-item {
        display: flex;
        justify-content: center;
    }
}

.home-cards-list .ad-card {
    max-width: none;
}

.ad-card:hover,
.ad-card:focus {
    scale: 1.05;
}

.ad-card a {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    justify-content: space-between;
    height: 100%;
}

.ad-card-image {
    width: 100%;
    height: 11rem;
    border-top-left-radius: 0.4rem;
    border-top-right-radius: 0.4rem;
    object-fit: cover;
}

.ad-card-header {
    padding: 0;
    height: auto;
}

.ad-card-title {
    text-align: center;
    color: #361213;
    text-decoration: none;
    margin-bottom: 0;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    line-height: 1.2;
}

.ad-card-body,
.ad-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #361213;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 4rem 0;
}

.page-number,
.page-arrow {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;

    background: #f3f3f3;
    color: #222;

    transition: all 0.3s ease;
}

.page-number:hover,
.page-arrow:hover {
    background: #ff3d24;
    color: white;
}

.page-number.active {
    background: #ff3d24;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 61, 36, 0.3);
}

.page-number {
    backdrop-filter: blur(6px);
}

@media (max-width: 560px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 2.5rem 0;
    }

    .page-number,
    .page-arrow {
        min-width: 2.2rem;
        height: 2.2rem;
        font-size: 0.9rem;
    }
}

.page-dots {
    color: white;
    opacity: 0.6;
    padding: 0 0.3rem;
}

.back-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.back-btn:hover,
.back-btn:focus {
    border-color: #ff3d24;
    color: #ff3d24;
}

.side-menu-level3 {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.side-menu-level3 li {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.side-menu-level3 li a {
    font-size: 0.9rem;
    opacity: 0.8;
}

.side-menu-level3 li a:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .search-title {
        text-align: left;
        margin-bottom: 0;
    }

    .search-count {
        font-size: 0.9rem;
    }
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-count {
    opacity: 0.8;
    font-size: 0.95rem;
}

.search-error {
    animation: shake 0.25s;
}

.search-title {
    text-align: center;
    margin-bottom: 2rem;
}

mark {
    background: rgba(255, 61, 36, 0.25);
    color: inherit;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.order-btn {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 12px 24px;
    background: #ff3b3b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    height: 3rem;
}

.order-btn:hover {
    background: #ff1f1f;
}

.modal {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.7);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 1rem;
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: #111;
    padding: clamp(1.2rem, 4vw, 30px);
    border-radius: 12px;

    width: min(100%, 400px);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;

    color: white;
    box-sizing: border-box;

    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    box-sizing: border-box;

    margin-bottom: 20px;
    padding: 10px;

    border-radius: 6px;
    border: 1px solid transparent;

    font-size: 16px;
}

.modal-content textarea {
    min-height: 6rem;
    resize: vertical;
}

.modal-content button {
    display: block;
    width: 100%;
    max-width: 16rem;

    padding: 12px 25px;
    margin: 0 auto;

    border-radius: 6px;
    background: #ff3b3b;
    color: white;
    border: none;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;

    float: none;
    font-size: 24px;
    cursor: pointer;
}

.order-lbl {
    margin-bottom: 8px;
    display: inline-block;
}

.modal input:focus {
    outline: none;
    border: none;
}

@media (max-width: 480px) {
    .modal {
        align-items: flex-start;
        padding-top: 1rem;
    }

    .modal-content {
        width: 100%;
        max-height: calc(100vh - 2rem);
        border-radius: 10px;
    }
}

.field-error {
    min-height: 18px;
    margin-top: -12px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: #ff6b6b;
}

.input-error {
    border: 1px solid #ff6b6b !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.input-valid {
    border: 1px solid #4bc92e !important;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    margin-bottom: 20px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border: 1px solid #ff3b3b;
}

.toast {
    position: fixed;
    z-index: 1000;
    top: 120px;
    left: 50%;
    padding: 15px 20px;
    border-radius: 8px;
    background: #4bc92e;
    color: white;
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.home-page {
    width: min(100%, 1760px);
    margin: 0 auto;
    padding-top: clamp(2.5rem, 4vw, 4rem);
    padding-bottom: 5rem;
}

.home-hero {
    min-height: clamp(18rem, 25vw, 25rem);
    position: relative;
}

.home-hero-content {
    max-width: 46rem;
}

.home-eyebrow {
    color: #ff3d24;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.home-hero h1 {
    font-size: clamp(2.8rem, 7vw, 6rem);
    line-height: 0.95;
    margin: 0 0 1.5rem;
    font-weight: 500;
}

.home-subtitle {
    max-width: 34rem;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.6;
    opacity: 0.8;
}

.home-category-hint {
    position: absolute;
    top: clamp(-6rem, -4vw, -3rem);
    right: clamp(6rem, 22vw, 24rem);
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    color: rgba(255,255,255,0.85);
    font-size: clamp(1rem, 1.6vw, 1.5rem);
    white-space: nowrap;
}

.home-category-hint span {
    margin-bottom: -1.5rem;
}

.home-arrow {
    width: clamp(170px, 18vw, 300px);
    height: auto;
    overflow: visible;
    flex-shrink: 0;
    animation: arrowFloat 2.5s ease-in-out infinite;
}

@media (max-width: 1500px) {
    .home-arrow,
    .home-category-hint {
        display: none;
    }
}

.home-arrow-line {
    fill: none;
    stroke: #ff3d24;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: drawArrow 1.4s ease forwards;
}

.home-arrow-head {
    fill: #ff3d24;
    stroke: none;
    opacity: 0;
    animation: showArrowHead 0.2s ease forwards;
    animation-delay: 1.2s;
}

.home-cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.5rem;
}

.home-cards-list .ad-card {
    width: 14rem;
    max-width: 14rem;
}

@media (max-width: 1200px) {
    .home-category-hint {
        right: 6rem;
    }
}

@media (max-width: 900px) {
    .home-hero {
        min-height: auto;
        padding-bottom: 3rem;
    }
}

@media (max-width: 560px) {
    .home-page {
        padding-top: 2rem;
    }

    .home-hero h1 {
        font-size: clamp(2.3rem, 14vw, 3.3rem);
    }

    .home-cards-list {
        grid-template-columns: 1fr;
    }
}

.latest-section {
    margin-top: clamp(2rem, 5vw, 3rem);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    margin: 0;
}

.latest-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

@keyframes drawArrow {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes showArrowHead {
    to {
        opacity: 1;
    }
}

@keyframes arrowFloat {
    0%, 100% {
        transform: translateX(0) rotate(-8deg);
    }
    50% {
        transform: translateX(10px) rotate(-5deg);
    }
}

@media (max-width: 900px) {
    .home-page {
        padding-top: 3rem;
    }

    .home-hero {
        flex-direction: column;
        min-height: auto;
    }

    .home-category-hint {
        white-space: normal;
    }

    .latest-grid {
        justify-content: center;
    }
}

@keyframes shake {
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-3px); }
}