/* =============================================
   МАРКЕТПЛЕЙС - ОСНОВНЫЕ СТИЛИ
   ============================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    color: #5a6fd6;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
   КНОПКИ
   ============================================= */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: #5a6fd6;
    color: #fff;
    text-decoration: none;
}

.btn-success {
    background: #4caf50;
    color: #fff;
}

.btn-success:hover {
    background: #388e3c;
    color: #fff;
    text-decoration: none;
}

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

.btn-danger:hover {
    background: #c41e1e;
    color: #fff;
    text-decoration: none;
}

.btn-warning {
    background: #ff9800;
    color: #fff;
}

.btn-warning:hover {
    background: #f57c00;
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #fff;
    text-decoration: none;
}

.btn-sm {
    padding: 5px 15px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 35px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =============================================
   ШАПКА
   ============================================= */
.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}

.mp-logo a {
    font-size: 24px;
    font-weight: 700;
    color: #e52b2b;
    text-decoration: none;
}

.mp-logo a:hover {
    color: #c41e1e;
    text-decoration: none;
}

.mp-search {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
    position: relative;
}

.mp-search form {
    display: flex;
    position: relative;
}

.mp-search input {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
}

.mp-search input:focus {
    border-color: #667eea;
}

.mp-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: color 0.3s;
}

.mp-search button:hover {
    color: #667eea;
}

.mp-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.mp-nav a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: color 0.3s;
    position: relative;
}

.mp-nav a:hover {
    color: #667eea;
    text-decoration: none;
}

.mp-cart-link,
.mp-wishlist-link {
    position: relative;
}

.mp-cart-badge,
.mp-wishlist-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e52b2b;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}

.mp-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.mp-user-menu:hover {
    background: #f0f0f0;
}

.mp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

/* =============================================
   ФУТЕР
   ============================================= */
.mp-footer {
    background: #1a1a2e;
    color: #fff;
    padding: 40px 20px;
    margin-top: 40px;
}

.mp-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.mp-footer h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
}

.mp-footer a {
    color: #aaa;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.3s;
}

.mp-footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* =============================================
   КАРТОЧКИ ТОВАРОВ
   ============================================= */
.mp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.mp-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
}

.mp-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mp-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}

.mp-product-name {
    font-weight: 600;
    margin: 10px 0 5px;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-product-name a {
    color: #333;
    text-decoration: none;
}

.mp-product-name a:hover {
    color: #667eea;
    text-decoration: none;
}

.mp-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #e52b2b;
}

.mp-product-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-left: 8px;
}

.mp-product-store {
    color: #666;
    font-size: 13px;
    margin: 5px 0;
}

.mp-product-rating {
    color: #f5a623;
    font-size: 13px;
}

.mp-product-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mp-product-actions .btn-cart {
    flex: 1;
    padding: 8px;
    background: #e52b2b;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
}

.mp-product-actions .btn-cart:hover {
    background: #c41e1e;
}

.mp-product-actions .btn-cart.in-cart {
    background: #4caf50;
}

.mp-product-actions .btn-cart.in-cart:hover {
    background: #388e3c;
}

.mp-product-actions .btn-wishlist {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.mp-product-actions .btn-wishlist:hover {
    background: #ffebee;
    transform: scale(1.1);
}

.mp-product-actions .btn-wishlist.active {
    background: #ffebee;
    color: #e52b2b;
}

.mp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    z-index: 10;
}

.mp-badge-new {
    background: #4caf50;
}

.mp-badge-sale {
    background: #ff9800;
}

.mp-badge-hit {
    background: #e52b2b;
}

.mp-badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #e52b2b;
    z-index: 10;
}

/* =============================================
   КАТЕГОРИИ
   ============================================= */
.mp-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px 0;
}

.mp-category-item {
    text-align: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.mp-category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
    text-decoration: none;
    color: #333;
}

.mp-category-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
}

.mp-category-item span {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

/* =============================================
   БАННЕРЫ
   ============================================= */
.mp-banner {
    margin: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.mp-banner-content {
    text-align: center;
    padding: 20px;
}

.mp-banner-content h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.mp-banner-content p {
    font-size: 18px;
    opacity: 0.9;
}

.mp-banner-content .btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: #fff;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

/* =============================================
   АКЦИИ
   ============================================= */
.mp-promotions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.mp-promotion-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s;
}

.mp-promotion-card:hover {
    transform: scale(1.02);
    text-decoration: none;
    color: #fff;
}

.mp-promotion-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* =============================================
   КОРЗИНА
   ============================================= */
.mp-cart-item {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

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

.mp-cart-item .item-image {
    flex: 0 0 100px;
}

.mp-cart-item .item-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

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

.mp-cart-item .item-name {
    font-weight: 600;
    font-size: 16px;
}

.mp-cart-item .item-name a {
    color: #333;
    text-decoration: none;
}

.mp-cart-item .item-name a:hover {
    color: #667eea;
}

.mp-cart-item .item-price {
    font-size: 18px;
    font-weight: 700;
    color: #e52b2b;
}

.mp-cart-item .item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-cart-item .item-quantity button {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.mp-cart-item .item-quantity button:hover {
    background: #f0f0f0;
}

.mp-cart-item .item-quantity input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.mp-cart-item .item-subtotal {
    font-weight: 700;
    font-size: 18px;
    min-width: 100px;
    text-align: right;
}

.mp-cart-item .item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s;
    padding: 5px;
}

.mp-cart-item .item-remove:hover {
    color: #e52b2b;
}

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

.mp-form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.mp-form-group .required {
    color: #e52b2b;
}

.mp-form-group .help-text {
    font-size: 13px;
    color: #999;
    margin-top: 3px;
}

.mp-form-group input,
.mp-form-group select,
.mp-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.mp-form-group input:focus,
.mp-form-group select:focus,
.mp-form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.mp-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.mp-form-group .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-form-group .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mp-form-group .checkbox-group label {
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

/* =============================================
   ТАБЛИЦЫ
   ============================================= */
.mp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.mp-table th {
    padding: 12px 15px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    text-align: left;
}

.mp-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.mp-table tr:last-child td {
    border-bottom: none;
}

/* =============================================
   ПАГИНАЦИЯ
   ============================================= */
.mp-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.mp-pagination a,
.mp-pagination span {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.3s;
}

.mp-pagination a:hover {
    background: #f0f0f0;
    text-decoration: none;
    color: #333;
}

.mp-pagination .active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* =============================================
   УВЕДОМЛЕНИЯ
   ============================================= */
.mp-notification {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid;
}

.mp-notification.success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.mp-notification.error {
    background: #ffebee;
    border-color: #e52b2b;
    color: #c62828;
}

.mp-notification.warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.mp-notification.info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
}

/* =============================================
   СТАТУСЫ (BADGE)
   ============================================= */
.mp-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.mp-status-badge.active {
    background: #4caf50;
}

.mp-status-badge.inactive {
    background: #999;
}

.mp-status-badge.pending {
    background: #ff9800;
}

.mp-status-badge.approved {
    background: #2196f3;
}

.mp-status-badge.rejected {
    background: #e52b2b;
}

.mp-status-badge.completed {
    background: #4caf50;
}

.mp-status-badge.cancelled {
    background: #e52b2b;
}

.mp-status-badge.verified {
    background: #2196f3;
}

.mp-status-badge.unverified {
    background: #ff9800;
}

/* =============================================
   АДАПТИВНОСТЬ
   ============================================= */
@media (max-width: 1200px) {
    .mp-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .mp-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .mp-cart-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .mp-header {
        flex-direction: column;
        padding: 10px 15px;
    }

    .mp-search {
        width: 100%;
        max-width: 100%;
        margin: 5px 0;
        order: 3;
    }

    .mp-nav {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .mp-nav a {
        font-size: 13px;
    }

    .mp-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 10px 0;
    }

    .mp-product-card .mp-product-image {
        height: 150px;
    }

    .mp-banner {
        height: 200px;
        margin: 10px;
    }

    .mp-banner-content h2 {
        font-size: 24px;
    }

    .mp-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .mp-cart-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .mp-cart-item .item-image {
        flex: none;
        text-align: center;
    }

    .mp-cart-item .item-image img {
        width: 80px;
        height: 80px;
    }

    .mp-cart-item .item-subtotal {
        text-align: center;
    }

    .mp-cart-item .item-quantity {
        justify-content: center;
    }

    .mp-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .mp-promotions-grid {
        grid-template-columns: 1fr;
    }

    .mp-table {
        font-size: 13px;
    }

    .mp-table th,
    .mp-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .mp-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .mp-product-card {
        padding: 10px;
    }

    .mp-product-card .mp-product-image {
        height: 120px;
    }

    .mp-product-name {
        font-size: 13px;
    }

    .mp-product-price {
        font-size: 16px;
    }

    .mp-avatar {
        width: 28px;
        height: 28px;
    }

    .mp-logo a {
        font-size: 20px;
    }

    .mp-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .mp-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* =============================================
   УТИЛИТЫ
   ============================================= */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: #999;
}

.text-danger {
    color: #e52b2b;
}

.text-success {
    color: #4caf50;
}

.text-warning {
    color: #ff9800;
}

.text-primary {
    color: #667eea;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-20 {
    padding: 20px;
}

.p-30 {
    padding: 30px;
}

/* =============================================
   АНИМАЦИИ
   ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* =============================================
   SELECT2 (если используется)
   ============================================= */
.select2-container .select2-selection--single {
    height: 42px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* =============================================
   КОРЗИНА - ИТОГИ
   ============================================= */
.mp-cart-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.mp-cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    color: #444;
}

.mp-cart-summary .summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
}

.mp-cart-summary .summary-row .discount {
    color: #4caf50;
}

/* =============================================
   ПРОФИЛЬ
   ============================================= */
.mp-profile-header {
    display: flex;
    gap: 30px;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.mp-profile-header .avatar {
    flex: 0 0 100px;
}

.mp-profile-header .avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
}

.mp-profile-header .info {
    flex: 1;
}

.mp-profile-header .info .name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.mp-profile-header .info .email {
    color: #666;
    font-size: 14px;
}

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

.mp-profile-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
    display: block;
}

.mp-profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #333;
}

.mp-profile-card .card-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.mp-profile-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mp-profile-card .card-desc {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

.mp-profile-card .card-count {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}