/* ==============================================================
   Modern Gray UI – rental‑site (Mobile First + Lightbox)
   ============================================================== */

/* ---------- 1️⃣ Переменные ---------- */
:root {
    --clr-primary:      #495057;
    --clr-primary-dark:#343a40;
    --clr-bg:           #f8f9fa;
    --clr-surface:     #ffffff;
    --clr-muted:        #6c757d;
    --clr-success:      #28a745;
    --clr-error:        #dc3545;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.12);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.15);
    --radius: 8px;
    --gap: 1.5rem;
    --max-w: 1240px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- 2️⃣ Базовые стили ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--clr-primary);
    background: var(--clr-bg);
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: var(--max-w);
    margin: auto;
    padding: 0 1rem;
}

a { color: inherit; text-decoration: none; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--clr-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background .2s, transform .15s;
    text-align: center;
}
.btn:hover {
    background: var(--clr-primary-dark);
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(0);
}

/* ---------- 3️⃣ Header ---------- */
.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
}
.logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--clr-primary-dark);
    white-space: nowrap;
}
.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-link {
    color: var(--clr-primary);
    opacity: 0.85;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: opacity .2s, background .2s;
    white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
    opacity: 1;
    color: var(--clr-primary-dark);
    background: rgba(0,0,0,0.05);
}

/* ---------- 4️⃣ Hero ---------- */
.hero {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    text-align: center;
    padding: 4rem 1rem 3rem;
    color: var(--clr-primary-dark);
}
.hero h2 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}
.hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* ---------- 5️⃣ Carousel ---------- */
.carousel-section { padding: 2rem 0; }
.carousel-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
}
.swiper {
    width: 100%;
    padding: 1rem 0;
}
.swiper-slide {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
}
.swiper-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.slide-caption {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    color: var(--clr-primary);
}
.slide-caption strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}
.slide-caption small {
    color: var(--clr-muted);
    line-height: 1.3;
}

/* ---------- 6️⃣ Catalog Table ---------- */
.catalog { padding: 2rem 0; }
.catalog h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.catalog-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.catalog-table thead {
    display: table-header-group;
}
.catalog-table tbody {
    display: table-row-group;
}
.catalog-table th,
.catalog-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    white-space: nowrap;
}
.catalog-table th {
    background: #e9ecef;
    font-weight: 600;
    color: var(--clr-primary-dark);
    position: sticky;
    left: 0;
}
.catalog-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* ---------- 7️⃣ Form ---------- */
.order-section { padding: 2rem 0; }
.order-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
form {
    max-width: 580px;
    margin: auto;
    display: grid;
    gap: var(--gap);
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.form-row {
    display: flex;
    flex-direction: column;
}
.form-row label {
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--clr-primary-dark);
    font-size: 0.95rem;
}
.form-row input,
.form-row select,
.form-row textarea {
    padding: 0.75rem 0.9rem;
    border: 1px solid #ced4da;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 16px;
    transition: border .2s, box-shadow .2s;
    background: #fff;
    min-height: 44px;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.15);
}
.form-row textarea {
    resize: vertical;
    min-height: 100px;
}
.form-status {
    margin-top: 0.5rem;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius);
}
.form-status.success {
    color: var(--clr-success);
    background: rgba(40, 167, 69, 0.1);
}
.form-status.error {
    color: var(--clr-error);
    background: rgba(220, 53, 69, 0.1);
}

/* ---------- 8️⃣ Agreement Checkboxes ---------- */
.agreement {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.agreement input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 0.1rem;
    cursor: pointer;
    accent-color: var(--clr-primary);
}
.agreement label {
    font-weight: 500;
    line-height: 1.4;
    font-size: 0.9rem;
    cursor: pointer;
}
.agreement a {
    color: var(--clr-primary);
    text-decoration: underline;
    word-break: break-word;
}
.agreement a:hover {
    color: var(--clr-primary-dark);
}

/* ---------- 9️⃣ Footer ---------- */
.footer {
    background: #212529;
    color: #adb5bd;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
}

/* ---------- 🔟 Requisites & Policy Pages ---------- */
.policy, .consent, .requisites {
    background: #fff;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 2rem 0;
}
.policy h3, .consent h3, .requisites h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--clr-primary-dark);
}
.policy h3:first-child,
.consent h3:first-child,
.requisites h3:first-child {
    margin-top: 0;
}
.policy ul, .consent ul, .requisites ul {
    margin: 0.5rem 0 1rem 1.5rem;
}
.policy li, .consent li, .requisites li {
    margin-bottom: 0.4rem;
}
.requisite-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    line-height: 1.6;
}
.requisite-list li {
    margin-bottom: 0.5rem;
}
.requisite-list strong {
    color: var(--clr-primary-dark);
}
.requisite-table {
    width: 100%;
    max-width: 680px;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-bottom: 2rem;
}
.requisite-table th {
    text-align: left;
    font-weight: 600;
    color: var(--clr-primary-dark);
    padding-right: 1rem;
}
.requisite-table td {
    background: #fff;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* =============================================================
   📱 МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================= */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem;
    }
    .logo {
        font-size: 1.2rem;
        text-align: center;
    }
    .nav {
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    .hero {
        padding: 2.5rem 1rem 2rem;
    }
    .hero h2 {
        font-size: 1.5rem;
    }
    .hero p {
        font-size: 0.95rem;
    }
    .carousel-section {
        padding: 1.5rem 0;
    }
    .swiper-slide img {
        height: 150px;
    }
    .slide-caption {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    .catalog-table {
        font-size: 0.85rem;
    }
    .catalog-table th,
    .catalog-table td {
        padding: 0.6rem 0.8rem;
    }
    form {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    .form-row input,
    .form-row select,
    .form-row textarea {
        font-size: 16px;
        padding: 0.7rem 0.8rem;
    }
    .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }
    .agreement {
        gap: 0.5rem;
    }
    .agreement input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }
    .agreement label {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    .policy, .consent, .requisites {
        padding: 1.5rem 1rem;
        margin: 1.5rem 0.5rem;
    }
    .policy h3, .consent h3, .requisites h3 {
        font-size: 1.1rem;
    }
    .requisite-table {
        font-size: 0.9rem;
    }
    .requisite-table th,
    .requisite-table td {
        padding: 0.5rem;
    }
    .footer {
        padding: 1.2rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    .logo {
        font-size: 1.1rem;
    }
    .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    .hero {
        padding: 2rem 0.75rem 1.5rem;
    }
    .hero h2 {
        font-size: 1.3rem;
    }
    .hero p {
        font-size: 0.9rem;
    }
    .swiper-slide img {
        height: 130px;
    }
    form {
        padding: 0.8rem;
    }
    .catalog-table th,
    .catalog-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* =============================================================
   🌙 Тёмная тема
   ============================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --clr-primary:      #adb5bd;
        --clr-primary-dark:#f8f9fa;
        --clr-bg:           #212529;
        --clr-surface:      #2d2d2d;
        --clr-muted:        #868e96;
    }
    body {
        background: var(--clr-bg);
        color: var(--clr-primary);
    }
    .header {
        background: var(--clr-surface);
    }
    .hero {
        background: linear-gradient(135deg, #2d2d2d 0%, #212529 100%);
        color: var(--clr-primary-dark);
    }
    .catalog-table,
    form,
    .policy,
    .consent,
    .requisites {
        background: var(--clr-surface);
    }
    .catalog-table th {
        background: #343a40;
        color: #fff;
    }
    .catalog-table tr:nth-child(even) {
        background: #343a40;
    }
    .requisite-table td {
        background: var(--clr-surface);
    }
    .footer {
        background: #111;
        color: #777;
    }
}

/* =============================================================
   👆 Тач-устройства
   ============================================================= */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
    }
    .nav-link:active {
        background: rgba(0,0,0,0.1);
    }
    .form-row input,
    .form-row select,
    .form-row textarea {
        min-height: 48px;
    }
    .agreement input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
}

/* =============================================================
   🖼️ LIGHTBOX (модальное окно для изображений)
   ============================================================= */

/* Оверлей на слайде при наведении */
.slide-image-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.slide-image-wrapper img {
    transition: transform 0.3s ease;
}
.slide-image-wrapper:hover img {
    transform: scale(1.05);
}
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.slide-image-wrapper:hover .slide-overlay {
    opacity: 1;
}
.zoom-icon {
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Lightbox контейнер */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
}
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-info {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.lightbox-title {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
    color: var(--clr-primary-dark);
}
.lightbox-price {
    font-size: 1.1rem;
    margin: 0;
    color: var(--clr-primary);
    font-weight: 600;
}

/* Кнопки управления Lightbox */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #fff;
    transform: scale(1.1);
}
.lightbox-close {
    top: -20px;
    right: -20px;
    font-size: 1.5rem;
}
.lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}
.lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Мобильная адаптация Lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
    }
    .lightbox-image {
        max-height: 60vh;
    }
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .lightbox-info {
        width: 100%;
        padding: 0.8rem 1rem;
    }
    .lightbox-title {
        font-size: 1.1rem;
    }
    .lightbox-price {
        font-size: 1rem;
    }
}

/* Тёмная тема для Lightbox */
@media (prefers-color-scheme: dark) {
    .lightbox-info {
        background: var(--clr-surface);
    }
    .lightbox-title {
        color: var(--clr-primary-dark);
    }
    .lightbox-price {
        color: var(--clr-primary);
    }
}
