/* common.css - Общие стили для всех страниц */

/* БАЗОВЫЕ СТИЛИ И ПЕРЕМЕННЫЕ */
:root {
    --main-red: #D32F2F;
    --dark-red: #B71C1C;
    --light-red: #FFCDD2;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray: #9E9E9E;
    --gray-dark: #212121;
    --shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Roboto, sans-serif; 
}

body { 
    background-color: var(--white); 
    color: var(--gray-dark); 
    line-height: 1.6;
    padding-bottom: 80px;
}

/* TOP ПАНЕЛЬ И МЕНЮ (общее для всех страниц) */
.top-bar {
    background-color: var(--main-red);
    color: var(--white);
    padding: 12px 15px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--white);
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-menu-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-icon {
    background: none;
    border: none;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.top-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--white);
    color: var(--main-red);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dropdown-menu {
    position: fixed;
    top: 60px;
    right: 15px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 999;
    display: none;
    min-width: 200px;
    overflow: hidden;
    border: 2px solid var(--light-red);
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--gray-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-light);
    transition: background 0.3s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--light-red);
    color: var(--main-red);
}

.dropdown-item i {
    width: 20px;
    color: var(--main-red);
}

.main-content {
    padding-top: 60px;
}

/* НИЖНЯЯ НАВИГАЦИЯ (общее для всех страниц) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 12px 10px;
    border-top: 2px solid var(--light-red);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--gray);
    text-decoration: none;
    font-size: 11px;
    gap: 5px;
}

.nav-item.active {
    color: var(--main-red);
}

.nav-icon {
    font-size: 22px;
}

/* ХЛЕБНЫЕ КРОШКИ (общее для details.html и article.html) */
.breadcrumbs {
    padding: 15px 20px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--main-red);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--dark-red);
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--gray);
}

.breadcrumbs i {
    color: var(--gray);
    font-size: 12px;
}

/* ОБЩИЕ КНОПКИ И ФОРМЫ */
.btn-primary, .btn-secondary {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--main-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--dark-red);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--gray-dark);
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background-color: var(--gray-light);
    border-color: var(--main-red);
    color: var(--main-red);
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--main-red);
    outline: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 15px;
}

/* СЕКЦИИ И ЗАГОЛОВКИ (общие) */
.section-title {
    font-size: 22px;
    color: var(--gray-dark);
    font-weight: 700;
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--light-red);
    padding-bottom: 10px;
}

/* УВЕДОМЛЕНИЯ (общие) */
.notification {
    position: fixed;
    top: 70px;
    right: 15px;
    background: var(--main-red);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* МОДАЛЬНЫЕ ОКНА (базовые стили) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal {
    background: var(--white);
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    background: var(--main-red);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.modal-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* КОРЗИНА (общие стили) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.cart-modal {
    background: var(--white);
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.cart-header {
    background: var(--main-red);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 20px;
    font-weight: 700;
}

.clear-cart {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.cart-items {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 15px;
}

.cart-item-price {
    color: var(--main-red);
    font-weight: 700;
    font-size: 16px;
}

.remove-from-cart {
    background: var(--light-red);
    color: var(--main-red);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.cart-total {
    padding: 20px;
    background: var(--gray-light);
    border-top: 2px solid var(--light-red);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    margin-bottom: 10px;
}

.total-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--main-red);
}

/* УСПЕШНАЯ ОТПРАВКА (общее) */
.success-message {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.success-icon {
    font-size: 60px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--gray-dark);
}

.success-text {
    color: var(--gray);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* МЕДИА ЗАПРОСЫ (общие) */
@media (max-width: 768px) {
    .top-menu-icons {
        gap: 15px;
    }
    
    .top-bar {
        padding: 10px 12px;
    }
    
    .modal {
        width: 95%;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .top-icon {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .cart-count-badge {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 18px;
    }
}