/* ============================================================
   БАЗОВЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #e9ecef;
    color: #212529;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* "ЛИСТ" САЙТА — центральная обёртка */
.site-wrapper {
    background-color: #f8f9fa;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 20px;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s ease-out forwards;
}

/* АНИМАЦИЯ ПОЯВЛЕНИЯ */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
}

/* ============================================================
   ШАПКА
   ============================================================ */
.navbar {
    background: #ffffff;
    padding: 15px 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: #212529;
}

.logo span {
    color: #fd7e14;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #495057;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #fd7e14;
}

.nav-links .btn-outline {
    border: 1px solid #dee2e6;
    padding: 8px 20px;
    border-radius: 20px;
}

.nav-links .btn-outline:hover {
    background: #fd7e14;
    color: #fff;
    border-color: #fd7e14;
}

/* ============================================================
   ПОДВАЛ
   ============================================================ */
footer {
    background: #ffffff;
    padding: 20px 0;
    border-radius: 0 0 24px 24px;
    border-top: 1px solid #e9ecef;
    margin-top: 40px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

footer a {
    color: #fd7e14;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: #fd7e14;
    color: #fff;
}

.btn-primary:hover {
    background: #e96b0a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.25);
}

.btn-secondary {
    background: #212529;
    color: #fff;
}

.btn-secondary:hover {
    background: #343a40;
    transform: translateY(-2px);
}

.btn-success {
    background: #2b8a3e;
    color: #fff;
}

.btn-success:hover {
    background: #237032;
    transform: translateY(-2px);
}

.btn-danger {
    background: #c92a2a;
    color: #fff;
}

.btn-danger:hover {
    background: #a51d1d;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background: transparent;
    color: #212529;
    border: 2px solid #dee2e6;
}

.btn-outline-secondary:hover {
    border-color: #fd7e14;
    color: #fd7e14;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 40px;
    font-size: 1.1rem;
}



.product-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    border-color: #fd7e14;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.08);
    transform: translateY(-4px);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    background-color: #f1f3f5;
}

.product-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #212529;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
    margin: 8px 0 6px;
    min-height: 36px;
}

.product-card .old-price {
    color: #adb5bd;
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-right: 6px;
}

.product-card .badge {
    margin: 4px 0 10px;
    display: inline-block;
}

.product-card .btn-buy {
    background: #212529;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: auto;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-decoration: none;
    display: inline-block;
}

.product-card .btn-buy:hover {
    background: #fd7e14;
}

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.card:hover {
    border-color: #fd7e14;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.08);
    transform: translateY(-4px);
}

/* ============================================================
   ГЕРОЙ-БЛОК
   ============================================================ */
.hero {
    padding: 50px 0 40px;
    text-align: center;
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #212529;
}

.hero h1 span {
    color: #fd7e14;
}

.hero p {
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto 25px;
    color: #6c757d;
}

/* ============================================================
   ТОВАРЫ (СЕТКА)
   ============================================================ */
.section-title {
    font-size: 1.5rem;
    margin: 30px 0 20px;
    color: #212529;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.product-card:hover {
    border-color: #fd7e14;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.08);
    transform: translateY(-4px);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    background-color: #f1f3f5;
}

.product-card h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #212529;
}

.product-card .price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fd7e14;
}

.product-card .old-price {
    color: #adb5bd;
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-right: 6px;
}

.product-card .btn-buy {
    background: #212529;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.product-card .btn-buy:hover {
    background: #fd7e14;
}

.badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

.badge-success {
    background: #d3f0df;
    color: #0a7e3d;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #212529;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #fd7e14;
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.1);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .site-wrapper {
        border-radius: 20px;
        padding: 0 10px 10px;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .nav-links a {
        font-size: 0.9rem;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .navbar .container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-card {
        padding: 12px;
    }
    .product-card img {
        height: 100px;
    }
}

/* ============================================================
   ПРЕЛОАДЕР (анимация загрузки страницы)
   ============================================================ */
#page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Спиннер */
.spinner {
    width: 60px;
    height: 60px;
    position: relative;
    animation: spin 1.2s linear infinite;
}

.spinner-dot {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 4px solid transparent;
    border-top-color: #fd7e14;
    animation: spin 0.8s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.spinner-dot:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #6C63FF;
    animation-duration: 1s;
    animation-direction: reverse;
}

.spinner-dot:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #2b8a3e;
    animation-duration: 1.2s;
}

.spinner-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анимация появления контента (уже есть, но дополним) */
.site-wrapper {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== АДАПТИВНЫЕ УВЕДОМЛЕНИЯ ===== */
@media (max-width: 768px) {
    .header-notifications {
        padding: 8px 12px !important;
        margin: -10px -10px 10px -10px !important;
        font-size: 0.75rem !important;
    }
    .header-notifications .notification-item {
        padding: 6px 8px !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    .header-notifications .notification-text {
        font-size: 0.7rem !important;
    }
    .header-notifications .notification-btn {
        font-size: 0.6rem !important;
        padding: 1px 8px !important;
    }
}

/* ===== УВЕДОМЛЕНИЯ (АДАПТИВ) ===== */
@media (max-width: 768px) {
    .notifications-dropdown {
        position: relative !important;
    }
    #notifications-menu {
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: unset !important;
        max-height: 60vh !important;
        border-radius: 16px !important;
    }
    #notifications-menu .notification-item {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }
    #notifications-menu .notification-item .notification-text {
        font-size: 0.8rem !important;
    }
    #notifications-menu .notification-item .notification-actions {
        flex-shrink: 0 !important;
    }
}

@media (max-width: 480px) {
    #notifications-menu {
        top: 55px !important;
        right: 5px !important;
        left: 5px !important;
        max-height: 50vh !important;
        border-radius: 12px !important;
    }
}