.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); /* Slight transparency */
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

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

/* The Drawer itself (Slides from right) */
.modal-drawer {
    --c-primary: #ff5c33;
    position: fixed;
    top: 0;
    right: 0;
    overflow-y: auto; /* вертикальный скролл */
    height: 100vh;
    width: 50vw; /* Half screen */
    min-width: 400px;
    max-width: 700px;
    background: #fafafa; /* Light gray from screenshot */
    z-index: var(--z-drawer);
    transform: translateX(100%); /* Start off-screen */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    /*justify-content: center; */
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.modal-drawer.open {
    transform: translateX(0); /* Slide in */
    overflow-y: auto; /* вертикальный скролл */
}

/* Close Button (X) */
.btn-close {
    position: absolute;
    top: 40px;
    left: 40px; /* On the screenshot close is on left or right? Usually right for drawers, but let's follow standard UX or Image. Image shows X at top right relative to modal content area, or top left. Let's put top right of drawer. */
    right: 40px;
    left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.btn-close svg {
    width: 24px;
    height: 24px;
    stroke: #111;
    stroke-width: 1.5;
}

/* Form Content */
.auth-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 500;
    color: #000;
    margin-bottom: 40px;
}
.login-error {
    color: #ff4a29;
}

.form-group-login {
    margin-bottom: 24px;
    position: relative;
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #000;
    border-radius: 6px;
    background: transparent;
    font-size: 16px;
    font-family: var(--font-body);
    color: #111;
    outline: none;
}

.input-field::placeholder {
    color: #999;
}
.input-field:focus {
    border-color: var(--c-primary); /* Orange border */
    border-width: 1px;
}

/* Active State (Password Field) */

/* Floating Label Trick */
.floating-label {
    position: absolute;
    top: -8px;
    left: 16px;
    background: #fafafa; /* Matches drawer bg to hide border */
    padding: 0 6px;
    font-size: 13px;
    color: #111;
    line-height: 1;
}
.floating-label span {
    color: var(--c-primary);
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: 14px;
    color: #111;
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 30px;
}

.btn-auth-submit {
    width: 100%;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 16px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background 0.2s;
}
.btn-auth-submit:hover {
    background: #c95735;
}

.register-link {
    display: block;
    text-align: center;
    font-size: 15px;
    color: #111;
    text-decoration: underline;
    cursor: pointer;
}

/* Mobile Adapt */
@media (max-width: 768px) {
    .product-main {
        grid-template-columns: 1fr;
    }
    .modal-drawer {
        width: 100%;
        min-width: 100%;
        padding: 40px 20px;
    }
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
    .products-grid > div:nth-child(n + 3) {
        display: none;
    }
}
