@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'Ambidexter';
    src: url('../fonts/Ambidexter.woff2') format('woff2'),
         url('../fonts/Ambidexter.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    background-color: #f4f1ea;
    display: flex;
    flex-direction: column;
}

/* ШАПКА */
.header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(39, 12, 16, 0.95));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 40px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 100;
}

.hero-section .header {
    background: transparent !important;  
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: none;
}

.header a img {
    width: 50px;
    height: auto;
}

.hero-section .header a img {
    filter: none;
}

.navigacia {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.navigacia a {
    text-decoration: none;
    color: #ffffff !important;
    font-size: 16px;
    transition: color 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.navigacia a:hover {
    color: #d4af37 !important;
}

.nav-izbr-korz {
    display: flex;
    gap: 15px;
}

.nav-izbr-korz a img {
    width: 28px;
    height: 28px;
    transition: transform 0.2s;
}

.nav-izbr-korz a img:hover {
    transform: scale(1.1);
}

.hero-section .header .nav-izbr-korz a img {
    filter: none;
}

.search {
    border-radius: 50px;
    padding: 10px 20px;
    width: 300px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.search::placeholder {
    color: rgba(255,255,255,0.7);
}

/* БУРГЕР-МЕНЮ */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 200;
}

.burger span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

/* Адаптив */
@media (max-width: 768px) {
    .burger {
        display: flex;
    }
    
    .navigacia {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.3s ease;
        z-index: 150;
        backdrop-filter: blur(10px);
    }
    
    .navigacia.active {
        right: 0;
    }
    
    .navigacia a {
        font-size: 1.2rem;
    }
    
    /* Анимация бургера в крестик */
    .burger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .burger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .burger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* ГЛАВНЫЙ ЭКРАН */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-image: url('../images/fon.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.text-one {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    z-index: 5;
    padding: 0 20px;
}

.antikvarnSalon {
    font-size: 7rem;
    color: #fff;
    font-family: 'Ambidexter', serif;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin: 0;
    line-height: 1;
}

.magazin {
    font-size: 3.5rem;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin: 15px 0 0 0;
}

/* КАТЕГОРИИ */
.categories {
    background-color: #f4f1ea;
    padding: 80px 20px;
    text-align: center;
}

.section-title {
    font-family: 'Ambidexter', serif;
    font-size: 3.5rem;
    color: #2c2c2c;
    margin-bottom: 50px;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.card {
    background: #fff;
    border-radius: 20px;
    width: 260px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
}

.card-image {
    height: 320px;
    background-color: #e8e4dc;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.card-content {
    padding: 20px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.card-content h3 {
    font-weight: 500;
    font-size: 1.2rem;
    color: #333;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 0 15px;
    line-height: 1.3;
}

.btn-buy {
    background-color: #7a2e3a;
    color: #fff;
    padding: 10px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.3s;
    margin-top: auto;
    border: none;
    cursor: pointer;
}

.btn-buy:hover {
    background-color: #b13449;
}

/* КОНТАКТЫ */
.contacts {
    background-color: #f4f1ea;
    padding: 80px 20px;
    text-align: center;
}

.contacts-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.contact-item {
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-item img {
    width: 24px;
    height: 24px;
}

.social-icons {
    display: flex;
    gap: 25px;
    margin-top: 30px;
}

.social-link {
    display: inline-block;
    transition: transform 0.3s;
}

.social-link img {
    width: 32px;
    height: 32px;
}

.social-link:hover {
    transform: scale(1.1);
}

/* ФУТЕР */
.footer {
    background-color: #7a2e3a;
    color: #fff;
    padding: 60px 40px;
    margin-top: auto;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-logo img {
    width: 70px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

.footer-contacts {
    text-align: right;
    font-size: 1rem;
    line-height: 1.8;
}

.footer-contacts p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-contacts p img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

input, textarea, button {
    font-family: 'Montserrat', sans-serif;
}

button {
    cursor: pointer;
}

/* КОРЗИНА: БЕЙДЖ И УВЕДОМЛЕНИЯ */
.cart-link {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #b13449;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #f4f1ea;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s ease, toastFadeOut 0.4s ease 2.6s forwards;
    border-left: 4px solid #d4af37;
    max-width: 350px;
}

.toast.success { border-left-color: #4caf50; }
.toast.error { border-left-color: #f44336; }
.toast.info { border-left-color: #2196f3; }

.toast-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

@keyframes toastSlideIn {
    from { transform: translateX(150%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(150%); }
}

/* СТРАНИЦА КОРЗИНЫ */
.cart-page {
    padding: 40px 20px;
    min-height: 70vh;
    background: #f4f1ea;
    flex: 1;
}

.cart-title {
    font-family: 'Ambidexter', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    color: #2c2c2c;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2rem;
}

.cart-empty a {
    color: #7a2e3a;
    text-decoration: none;
    font-weight: 500;
}

.cart-empty a:hover {
    text-decoration: underline;
}

.cart-items {
    max-width: 900px;
    margin: 0 auto;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    align-items: center;
    transition: transform 0.2s;
}

.cart-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.cart-item-img {
    width: 100px;
    height: 100px;
    background: #e8e4dc;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c2c2c;
    font-size: 1.05rem;
}

.cart-item-price {
    color: #7a2e3a;
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-item-qty {
    margin: 10px 0;
    color: #666;
    font-size: 0.95rem;
}

.cart-item-remove {
    background: #f4f1ea;
    color: #7a2e3a;
    border: none;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.cart-item-remove:hover {
    background: #7a2e3a;
    color: #fff;
}

.cart-total {
    text-align: right;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 30px 0;
    color: #2c2c2c;
    max-width: 900px;
    margin-left: auto;
}

.cart-actions {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.btn-checkout {
    background: #7a2e3a;
    color: #fff;
    padding: 14px 45px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-checkout:hover {
    background: #b13449;
}

.btn-clear {
    background: #f4f1ea;
    color: #7a2e3a;
    padding: 14px 35px;
    border: 2px solid #7a2e3a;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: #7a2e3a;
    color: #fff;
}

.modal-checkout {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-checkout.active {
    display: flex;
}

.modal-checkout-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideDown 0.3s ease;
}

@keyframes modalSlideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-checkout-content input,
.modal-checkout-content textarea,
.modal-checkout-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #555;
}

@media (max-width: 1024px) {
    .header { padding: 15px 20px; }
    .navigacia { width: 100%; justify-content: center; gap: 15px; }
    .search { width: 220px; }
    .antikvarnSalon { font-size: 4rem; }
    .magazin { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .cards-container { flex-direction: column; align-items: center; }
    .card { width: 100%; max-width: 320px; }
    .card-image { height: 280px; }
    .footer-container { flex-direction: column; text-align: center; }
    .footer-contacts { text-align: center; }
    .section-title { font-size: 2.5rem; }
    .antikvarnSalon { font-size: 3rem; }
    .magazin { font-size: 2rem; }
    .contact-item { justify-content: center; }
    .header { padding: 10px 15px; }
    .navigacia { margin-top: 10px; }
    .navigacia a { font-size: 14px; }
    .nav-izbr-korz { gap: 10px; }
}

@media (max-width: 600px) {
    .cart-item { flex-direction: column; text-align: center; }
    .cart-item-img { width: 100%; height: 200px; }
    .cart-actions { display: flex; flex-direction: column; gap: 10px; }
    .btn-clear { margin-left: 0; }
    .cart-total { text-align: center; }
    .modal-checkout-content { margin: 10px; max-height: calc(100vh - 20px); }
}

.modal-checkout {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-checkout.active {
    display: flex;
}

.modal-checkout-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideDown 0.3s ease;
}

@keyframes modalSlideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-checkout-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: #f4f1ea;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c2c2c;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-checkout-close:hover {
    background: #7a2e3a;
    color: #fff;
}

.modal-checkout-header {
    background: linear-gradient(135deg, #7a2e3a 0%, #5a222b 100%);
    color: #fff;
    padding: 25px 30px;
    border-radius: 15px 15px 0 0;
    margin: -30px -30px 25px -30px;
}

.modal-checkout-header h3 {
    font-family: 'Ambidexter', serif;
    font-size: 1.8rem;
    margin: 0;
}

.modal-checkout-header p {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.modal-checkout-body {
    padding: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c2c2c;
    font-size: 0.95rem;
}

.form-group label .required {
    color: #f44336;
    margin-left: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e4dc;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #faf9f7;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #7a2e3a;
    background: #fff;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.order-summary {
    background: #f9f7f4;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.order-summary-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c2c2c;
    display: flex;
    justify-content: space-between;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e8e4dc;
    font-size: 0.95rem;
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    color: #7a2e3a;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #d4d0c8;
}

.modal-checkout-footer {
    padding: 20px 0 0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-submit-order {
    background: linear-gradient(135deg, #7a2e3a 0%, #5a222b 100%);
    color: #fff;
    padding: 14px 35px;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
}

.btn-submit-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 46, 58, 0.4);
}

.btn-submit-order:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel-order {
    background: #f4f1ea;
    color: #7a2e3a;
    padding: 14px 25px;
    border: 2px solid #7a2e3a;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel-order:hover {
    background: #7a2e3a;
    color: #fff;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-checkout-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-checkout-footer {
        flex-direction: column;
    }
    
    .btn-submit-order,
    .btn-cancel-order {
        width: 100%;
    }
}