/* ============================================================ */
/* ===== БАЗА (токены/сброс/шапка/подвал — как на home.html) ===== */
/* ============================================================ */

:root {
    --accent: #87FF32;
    --accent-dark: #6fd43a;
    --white: #F4FBF3;
    --black: #101413;
    --primary: #2c7873;
    --primary-dark: #1e5a56;
    --text-dark: #101413;
    --text-medium: #444444;
    --text-light: #666666;
    --text-muted: #888888;
    --header-height: 80px;
    --transition: 0.3s ease;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background: var(--white);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 20px;
    padding-top: calc(var(--header-height) + 30px);
}

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

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

button, input, select {
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--text-dark);
    box-shadow: 0 4px 20px rgba(135, 255, 50, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(135, 255, 50, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid rgba(16, 20, 19, 0.15);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(44, 120, 115, 0.05);
    transform: translateY(-3px);
}

/* ===== ШАПКА ===== */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 20px 0 20px;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.header-wrapper * {
    pointer-events: auto;
}

.header-wrapper.scrolled {
    background: transparent;
    padding-top: 8px;
    padding-bottom: 8px;
}

.header {
    max-width: 1200px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid rgba(16, 20, 19, 0.08);
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.header-wrapper.scrolled .header {
    height: calc(var(--header-height) - 12px);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
    margin-right: 5px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(135, 255, 50, 0.3);
}

.header-logo-icon {
    cursor: pointer;
    pointer-events: none;
    width: 36px;
    height: 36px;
    background: var(--black);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.header-logo-icon img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.header-logo:hover .header-logo-icon {
    transform: scale(1.05) rotate(-4deg);
}

.header-logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    cursor: pointer;
    pointer-events: none;
}

.header-logo-text span {
    color: var(--text-dark);
}

.header-logo:hover .header-logo-text {
    color: var(--primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
}

.header-nav li {
    position: relative;
    flex-shrink: 0;
}

.header-nav a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav a i {
    font-size: 0.75rem;
    opacity: 0.5;
}

.header-nav a:hover {
    color: var(--text-dark);
    background: rgba(16, 20, 19, 0.05);
}

.header-nav a:hover i {
    opacity: 0.8;
    color: var(--primary);
}

.header-nav a.active {
    color: var(--primary);
    background: rgba(44, 120, 115, 0.08);
}

.header-nav a.active i {
    opacity: 1;
    color: var(--primary);
}

.header-nav a.delivery-btn {
    color: var(--text-light);
    background: transparent;
    border: none;
    padding: 5px 10px;
}

.header-nav a.delivery-btn:hover {
    color: var(--text-dark);
    background: rgba(16, 20, 19, 0.05);
}

/* ===== КНОПКА КОРЗИНЫ В ШАПКЕ (см. комментарий в home.css) ===== */
.header-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--black);
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition);
}

.header-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 20, 19, 0.25);
}

.header-cart-btn i {
    font-size: 1.25rem;
}

.header-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: var(--text-dark);
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--white);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    z-index: 100;
    flex-shrink: 0;
    margin-left: 5px;
}

.burger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all var(--transition);
    transform-origin: center;
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.burger.active span:nth-child(2) {
    opacity: 0;
}
.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== ПОДВАЛ ===== */
.footer-note {
    text-align: center;
    padding: 25px;
    color: var(--text-medium);
    font-size: 0.95rem;
    border-top: 1px solid rgba(16, 20, 19, 0.1);
    background: rgba(16, 20, 19, 0.02);
    font-weight: 500;
    margin-top: 60px;
}

.contacts-footer {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid rgba(16, 20, 19, 0.1);
}

.contacts-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    text-align: center;
}

.contact-label {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-size: 1rem;
}

.contact-value {
    color: var(--text-medium);
    font-weight: 500;
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

@media (max-width: 880px) {
    :root {
        --header-height: 64px;
    }
    body {
        padding: 12px;
        padding-top: calc(var(--header-height) + 20px);
    }
    .header-wrapper {
        padding: 8px 12px 0 12px;
    }
    .header {
        padding: 0 14px;
        height: var(--header-height);
        border-radius: 12px;
    }
    .header-wrapper.scrolled .header {
        height: calc(var(--header-height) - 8px);
    }
    .header-logo-text {
        font-size: 0.95rem;
    }
    .header-logo-icon {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    .header-cart-btn {
        padding: 8px 10px;
        margin-left: 4px;
    }
    .header-cart-label {
        display: none;
    }
    .header-cart-btn i {
        font-size: 1.15rem;
    }
    .header-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        padding: 70px 30px 30px;
        gap: 2px;
        z-index: 60;
        align-items: stretch;
        overflow-y: auto;
        justify-content: flex-start;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .header-nav.open {
        display: flex;
        transform: translateX(0);
    }
    .header-nav a {
        font-size: 1.1rem;
        padding: 14px 18px;
        border-radius: 10px;
        justify-content: flex-start;
        white-space: normal;
        border: none;
        color: var(--text-dark);
    }
    .header-nav a:hover {
        background: rgba(16, 20, 19, 0.05);
    }
    .header-nav a.active {
        background: rgba(44, 120, 115, 0.08);
        color: var(--primary);
    }
    .header-nav a i {
        width: 28px;
        text-align: center;
        font-size: 1.1rem;
        opacity: 0.6;
    }
    .burger {
        display: flex;
    }
    body.menu-open {
        overflow: hidden;
    }
    .contacts-container {
        flex-direction: column;
        gap: 15px;
    }
    .contact-item {
        text-align: left;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 56px;
    }
    body {
        padding: 8px;
        padding-top: calc(var(--header-height) + 14px);
    }
    .header-wrapper {
        padding: 6px 6px 0 6px;
    }
    .header-logo-text {
        font-size: 0.8rem;
    }
    .header-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
        border-radius: 7px;
    }
    .header {
        padding: 0 10px;
        border-radius: 10px;
        height: var(--header-height);
    }
}

/* ============================================================ */
/* ===== СТРАНИЦА КОРЗИНЫ ===== */
/* ============================================================ */

.cart-hero {
    padding: 30px 0 10px;
    text-align: center;
}
.cart-hero h1 {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.cart-section {
    padding: 20px 0 80px;
}

/* --- Пустая корзина --- */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-medium);
}
.cart-empty i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.cart-empty p {
    font-size: 1.1rem;
    margin-bottom: 22px;
}

/* --- Таблица товаров --- */
.cart-table {
    background: #fff;
    border: 1px solid rgba(16, 20, 19, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.cart-table-head {
    display: grid;
    grid-template-columns: 40px 1fr 90px 130px 90px 100px 36px;
    gap: 14px;
    align-items: center;
    padding: 14px 20px;
    background: rgba(44, 120, 115, 0.06);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-medium);
}

.cart-row {
    display: grid;
    grid-template-columns: 40px 1fr 90px 130px 90px 100px 36px;
    gap: 14px;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(16, 20, 19, 0.06);
}

.cart-row .col-num {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-row .col-product {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.cart-row-img {
    width: 60px;
    height: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #eef3ed;
    flex-shrink: 0;
}
.cart-row-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Услуги (без фото товара) — иконка-заглушка вместо картинки */
.cart-row-img.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
}

.cart-row-info {
    min-width: 0;
}
.cart-row-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 3px;
}
.cart-row-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-row .col-volume {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 600;
}

.cart-row .col-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(16, 20, 19, 0.15);
    background: #fff;
    color: var(--text-dark);
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}
.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.qty-value {
    width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-row .col-price {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.cart-row .col-sum {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
}

.cart-row-remove {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(16, 20, 19, 0.06);
    color: var(--text-medium);
    cursor: pointer;
    font-size: 0.8rem;
}
.cart-row-remove:hover {
    background: rgba(220, 60, 60, 0.12);
    color: #c0392b;
}

/* --- Итого --- */
.cart-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 14px;
    padding: 10px 20px 30px;
    border-bottom: 1px solid rgba(16, 20, 19, 0.08);
    margin-bottom: 30px;
}
.cart-total-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-medium);
}
.cart-total-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* --- Способ получения заказа --- */
.delivery-method-block {
    margin-bottom: 24px;
}

.delivery-method-choose-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(44, 120, 115, 0.08);
    border: 1.5px dashed var(--primary);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.delivery-method-choose-btn:hover {
    background: rgba(44, 120, 115, 0.14);
    transform: translateY(-2px);
}
.delivery-method-choose-btn i {
    font-size: 1.1rem;
}

.delivery-method-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(135, 255, 50, 0.1);
    border: 1px solid rgba(135, 255, 50, 0.35);
}
.delivery-method-icon {
    color: var(--accent-dark);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.delivery-method-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.delivery-method-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}
.delivery-method-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}
.delivery-method-change {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all var(--transition);
}
.delivery-method-change:hover {
    background: rgba(44, 120, 115, 0.1);
}

@media (max-width: 480px) {
    .delivery-method-row {
        flex-wrap: wrap;
    }
    .delivery-method-change {
        margin-left: auto;
    }
}


.checkout-block {
    background: #fff;
    border: 1px solid rgba(16, 20, 19, 0.08);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 640px;
}
.checkout-block h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.checkout-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.checkout-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
}
.checkout-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}
.checkout-btn i, .checkout-btn .max-icon {
    font-size: 1.2rem;
}
.checkout-btn-vk { background: #0077FF; }
.checkout-btn-whatsapp { background: #25D366; }
.checkout-btn-telegram { background: #29A9EA; }
.checkout-btn-max { background: #7B61FF; }
.max-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(255,255,255,0.25);
    font-weight: 800;
    font-size: 0.85rem;
}

.checkout-note {
    display: none;
    background: rgba(44, 120, 115, 0.08);
    border: 1px solid rgba(44, 120, 115, 0.2);
    color: var(--primary-dark);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
}
.checkout-note.visible {
    display: block;
}

.checkout-pdf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(16, 20, 19, 0.08);
}
.checkout-pdf-row span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Скрытый шаблон для рендера в PDF (виден только html2canvas'у) --- */
.pdf-template {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 700px;
    background: #fff;
    padding: 40px;
    font-family: 'Manrope', sans-serif;
    color: #101413;
}

/* ============================================================ */
/* ===== АДАПТИВ ===== */
/* ============================================================ */

@media (max-width: 900px) {
    .cart-table-head { display: none; }

    .cart-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
        position: relative;
    }
    .cart-row .col-num { display: none; }
    .cart-row .col-product { grid-column: 1; }
    .cart-row .col-volume,
    .cart-row .col-qty,
    .cart-row .col-price,
    .cart-row .col-sum {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.88rem;
    }
    .cart-row .col-volume::before { content: 'Объём: '; color: var(--text-muted); }
    .cart-row .col-price::before { content: 'Цена: '; color: var(--text-muted); }
    .cart-row .col-sum::before { content: 'Сумма: '; color: var(--text-muted); }
    .cart-row-remove {
        position: absolute;
        top: 14px;
        right: 14px;
    }
    .checkout-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cart-hero h1 { font-size: 1.7rem; }
    .checkout-block { padding: 20px; }
    .cart-total-row { justify-content: space-between; }
}
