/**
 * Graf Drakula Engine v2.0 - Глобальна дизайн-система та стилі (main.css)
 */

/* --- 1. Скидання та Глобальні налаштування --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    opacity: 0.9;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

/* --- 2. Каркас та Головний Header --- */
.site-main-wrapper {
    min-height: calc(100vh - 140px);
    padding: 40px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.main-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    color: var(--header-text);
}

.accent-text {
    color: var(--accent-color);
}

/* Інтелектуальний Пошук */
.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-form {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #0f172a;
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: #64748b;
}

.search-btn:hover {
    color: var(--primary-color);
}

.search-ajax-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    overflow: hidden;
    z-index: 10;
}

.autocomplete-row-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    transition: background 0.15s ease;
}

.autocomplete-row-item:hover {
    background-color: #f8fafc;
}

/* Навігація */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-icon-link {
    color: #64748b;
    position: relative;
    display: flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Випадаюче меню аккаунта */
.user-profile-menu {
    position: relative;
}

.profile-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--header-text);
}

.user-avatar-mini, .form-preview-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #cbd5e1;
}

.user-profile-menu:hover .profile-dropdown {
    display: block;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    margin-top: 10px;
}

/* Невидимий інтерактивний міст для утримання фокусу миші при переході на марджин */
.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #334155;
    font-size: 14px;
}

.profile-dropdown a:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 5px 0;
}

.logout-link-item {
    color: #ef4444 !important;
}

.auth-btn-header {
    background: var(--primary-color);
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}

/* Селектор Мов */
.lang-selector {
    position: relative;
}
.lang-current-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 4px;
}
.lang-selector:hover .lang-dropdown {
    display: block;
}
.lang-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #334155;
}
.lang-dropdown a.active {
    font-weight: 700;
    color: var(--primary-color);
}

/* --- 3. Головна Сторінка (Home View) --- */
.hero-promo-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 60px 40px;
    margin-bottom: 40px;
    text-align: left;
}

.hero-banner-content h1 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 15px;
}

.brand-highlight {
    color: var(--primary-color);
}

.hero-banner-content p {
    color: #94a3b8;
    font-size: 18px;
    max-width: 600px;
    margin-bottom: 30px;
}

.hero-cta-btn {
    background: var(--accent-color);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Товарна Сітка */
.products-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card-item {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

.pc-image-wrapper {
    background: #f8fafc;
    position: relative;
    padding-top: 100%; /* Квадрат */
    overflow: hidden;
}

.pc-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-fav-trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #cbd5e1;
}

.pc-fav-trigger:hover, .in-favorites {
    color: #ef4444;
}

.pc-details-box {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.pc-title a {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 48px;
    margin-bottom: 15px;
}

.pc-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pc-price-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.pc-cart-action-btn {
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.pc-cart-action-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* Новини та Блог */
.news-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.news-card-item {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 25px;
}

.news-date-badge {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.news-card-body h3 {
    font-size: 18px;
    margin: 10px 0;
    color: #0f172a;
}

.news-card-body p {
    color: #475569;
    font-size: 14px;
    margin-bottom: 15px;
}

/* --- 4. Сторінка Авторизації (Auth Forms) --- */
.auth-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
}

.auth-card-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
}

.auth-card-header p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 25px;
}

.form-group-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group-item label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #475569;
}

.input-with-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-inner-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    width: 18px;
}

.input-with-icon-wrapper input, .form-fields-inputs-flex-grid-layout input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
}

.input-with-icon-wrapper input {
    padding-left: 38px;
}

.auth-submit-action-btn, .profile-save-submit-action-btn-lg, .place-order-submit-btn-lg {
    width: 100%;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.auth-card-footer-links {
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
}

.auth-error-alert-box, .checkout-error-alert-box {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- 5. Кошик та Оформлення замовлення (Cart & Checkout) --- */
.cart-split-layout-grid, .checkout-form-split-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

.cart-row-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.cri-thumb-box img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cri-info-box {
    flex: 1;
    text-align: left;
}

.cri-info-box h3 a {
    color: #0f172a;
    font-weight: 700;
}

.sys-qty-notice {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}

.cart-row-delete-btn {
    background: #fef2f2;
    color: #ef4444;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-receipt-card, .checkout-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    text-align: left;
}

.receipt-divider, .checkout-divider-line {
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
}

.promo-form-flex {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.promo-submit-btn {
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.receipt-row-total-sum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0;
}

.final-checkout-sum-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-color);
}

.proceed-to-checkout-btn-lg {
    background: var(--accent-color);
    color: #ffffff;
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
}

/* --- 6. Особистий Кабінет (Profile Dashboard) --- */
.profile-layout-grid-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

.profile-sidebar-navigation-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px 15px;
}

.profile-avatar-nickname-block {
    text-align: center;
    margin-bottom: 25px;
}

.profile-main-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid #f1f5f9;
}

.user-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

.status-admin { background: #fee2e2; color: #991b1b; }
.status-seller { background: #e0f2fe; color: #0369a1; }
.status-user { background: #f1f5f9; color: #334155; }

.profile-menu-links-stack .p-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #475569;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.profile-menu-links-stack .p-link:hover, .profile-menu-links-stack .p-link.active {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.profile-stats-cards-flex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card-item {
    padding: 25px;
    border-radius: 12px;
    color: #ffffff;
    text-align: left;
}

.purple-gradient-theme { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }
.blue-gradient-theme { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.green-gradient-theme { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.orange-gradient-theme { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0.9;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 900;
    margin: 10px 0;
}

.stat-card-desc {
    font-size: 12px;
    opacity: 0.75;
}

/* Нативні Таблиці */
.workspace-section-card-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    text-align: left;
}

.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.profile-native-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.profile-native-data-table th, .profile-native-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.profile-native-data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #64748b;
}

.table-status-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
}

.order-status-delivered { background-color: #dcfce7; color: #15803d; }
.order-status-processing { background-color: #fef9c3; color: #a16207; }

/* Форма анкети */
.form-fields-inputs-flex-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.full-width-row {
    grid-column: span 2;
}

/* --- 7. Чат Тикет-Системи (Support Tickets UI) --- */
.support-chat-history-timeline-scrollbox {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-bubble-message-card {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: left;
}

.user-sender-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
}

.admin-reply-bubble {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    align-self: flex-end;
}

.cb-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

/* --- 8. Інтерактивний Інформер Live Sales (Social Proof Widget) --- */
.live-sales-container {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    padding: 16px;
    z-index: 1000;
    max-width: 360px;
    width: 100%;
}

.live-sales-body {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    text-align: left;
}

.live-sales-icon-box {
    background: #f0fdf4;
    color: #16a34a;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-sales-content {
    flex: 1;
    font-size: 13px;
}

.ls-product-title {
    font-weight: 700;
    color: var(--primary-color);
}

.ls-meta-row {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.live-sales-close {
    background: transparent;
    border: none;
    cursor: pointer;
    position: absolute;
    top: -5px;
    right: -5px;
    color: #94a3b8;
}

/* Анімації */
.slide-in-animation {
    animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInUp {
    from { transform: translateY(120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

/* --- 9. Глобальний Футер (Footer View) --- */
.main-footer {
    padding: 50px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: left;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-desc, .ad-body, .social-callout {
    font-size: 14px;
    opacity: 0.8;
}

.social-buttons-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.social-btn {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.social-btn:hover {
    background: var(--primary-color);
}