/* static/css/style.css */

html {
    scrollbar-gutter: stable;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > header {
    background: #333;
    color: #fff;
    padding: 1rem;
    width: 100%;
}

body > header nav {
    max-width: 100%;     /* изменил с 1200px на 100% */
    margin: 0;
    padding: 0 20px;     /* добавил отступы только для nav, не для всего контента */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-left a, .dropdown-btn {
    color: #fff;
    text-decoration: none;
}

.nav-left .site-brand {
    margin-right: 0.75rem;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.nav-left a:hover {
    text-decoration: underline;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #555;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-family: inherit;
}

.dropdown-btn:hover {
    background: #777;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    z-index: 1;
}

.dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover {
    background: #f5f5f5;
    border-radius: 5px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.login-btn {
    background: #2c7da0;
    padding: 8px 16px;
    border-radius: 5px;
    color: white;
    text-decoration: none;
}

.login-btn:hover {
    background: #1f5e7a;
    text-decoration: none;
}

.container {
    max-width: 100%;     /* изменил с 1200px на 100% */
    margin: 2rem 0;      /* убрал auto, оставил только вертикальные отступы */
    padding: 0 20px;     /* небольшие отступы по бокам, чтобы текст не прилипал к краям */
    flex: 1;
    width: 100%;
}

body > footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    width: 100%;
}


/* Иконка корзины */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 15px;
    text-decoration: none;
}

.cart-icon img {
    display: block;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.quantity-stepper {
    display: grid;
    grid-template-columns: 36px minmax(42px, 1fr) 36px;
    height: 48px;
}

.quantity-stepper button,
.quantity-stepper input {
    min-width: 0;
    border: 1px solid #d9d6d0;
    border-radius: 0;
    background: #fff;
    color: #171a1c;
    font: inherit;
    text-align: center;
}

.quantity-stepper button {
    padding: 0;
    font-size: 20px;
    cursor: pointer;
}

.quantity-stepper button:hover,
.quantity-stepper button:focus-visible {
    z-index: 1;
    border-color: #f36b2b;
    color: #f36b2b;
    outline: none;
}

.quantity-stepper input {
    margin: 0 -1px;
    appearance: textfield;
}

.quantity-stepper input::-webkit-inner-spin-button,
.quantity-stepper input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.global-cart-notification {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 100;
    max-width: min(420px, calc(100vw - 48px));
    padding: 15px 18px;
    border-left: 4px solid #f36b2b;
    background: #fff;
    color: #171a1c;
    box-shadow: 0 12px 35px rgba(30, 25, 23, .18);
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.global-cart-notification:empty {
    display: none;
}

.global-cart-notification--visible {
    opacity: 1;
    transform: translateY(0);
}

.global-cart-notification--error {
    border-left-color: #b74238;
    color: #8f2e26;
}

@media (max-width: 680px) {
    .global-cart-notification {
        top: 82px;
        right: 14px;
        max-width: calc(100vw - 28px);
    }
}

/* Правовые документы в общем подвале магазина. */
body > footer .footer-policies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
    max-width: 1120px;
    margin: 0 auto 20px;
    padding: 0 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    line-height: 1.6;
}
.footer-policies a, .footer-policies a:visited {
    color: #b9bdc0;
    text-decoration: none;
    text-underline-offset: 4px;
    transition: color 0.2s;
}
.footer-policies a:hover { color: #f36b2b; text-decoration: underline; }
.footer-policies a:focus-visible { color: #fff; outline: 2px solid #f36b2b; outline-offset: 4px; }
body > footer p { line-height: 1.8; }
@media (max-width: 600px) {
    body > footer .footer-policies { flex-direction: column; align-items: center; gap: 12px; }
}
