/* * Cart Export Styles - Final Clean Version
 */

.hitech-cart-export {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative; /* Для корректного позиционирования меню */
}

.hitech-export-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: -0.375rem;
}

.hitech-export-buttons > * {
    margin: 0.375rem;
}

/* Общие стили кнопок */
.hitech-export-btn,
.hitech-share-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1rem;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #333333;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 44px;
}

.hitech-export-btn:hover, .hitech-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Цвета кнопок */
.hitech-export-csv { border-color: #28a745; color: #28a745; }
.hitech-export-csv:hover { background: #28a745; color: white; }

.hitech-export-xlsx { border-color: #007bff; color: #007bff; }
.hitech-export-xlsx:hover { background: #007bff; color: white; }

.hitech-export-pdf { border-color: #dc3545; color: #dc3545; }
.hitech-export-pdf:hover { background: #dc3545; color: white; }

.hitech-export-copy { border-color: #6c757d; color: #6c757d; }
.hitech-export-copy:hover { background: #6c757d; color: white; }

.hitech-share-btn { border-color: #6c757d; color: #6c757d; position: relative; }
.hitech-share-btn:hover { background: #6c757d; color: white; }

/* Стрелочка Share (только если есть текст) */
.hitech-share-btn:has(.hitech-export-label)::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s;
}
.hitech-share-btn[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Иконки и Лайблы */
.hitech-export-btn i, .hitech-share-btn i {
    font-size: 1.1em;
    min-width: 1.2em;
    text-align: center;
}

/* Если labels="1" (есть текст) */
.hitech-export-btn:has(.hitech-export-label) i,
.hitech-share-btn:has(.hitech-export-label) i {
    margin-right: 0.5rem;
}

/* Если labels="0" (нет текста) - делаем кнопку квадратной */
.hitech-export-btn:not(:has(.hitech-export-label)),
.hitech-share-btn:not(:has(.hitech-export-label)) {
    width: 44px;
    justify-content: center;
    padding: 0;
}

.hitech-export-label { white-space: nowrap; }

/* Выпадающее меню Share */
.hitech-share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.hitech-share-menu__inner { padding: 4px 0; }

.hitech-share-option {
    width: 100%;
    border: none;
    background: none;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333333 !important; /* Четкий текст */
    font-weight: 500;
    transition: background 0.2s;
    text-align: left;
}

.hitech-share-option:hover { background: #f0f7ff; }

.hitech-share-option i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.hitech-share-whatsapp i { color: #25D366 !important; }
.hitech-share-email i { color: #007bff !important; }

/* Статусы */
.hitech-export-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
}
.hitech-export-status.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.hitech-export-status.error { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.hitech-export-status.loading { display: block; background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* Адаптивность */
@media (max-width: 768px) {
    .hitech-export-buttons { flex-direction: column; align-items: stretch; }
    .hitech-export-buttons > * { width: 100%; margin: 0.375rem 0; }
    .hitech-share-menu { position: static; width: 100%; box-shadow: none; border: 1px solid #eee; margin-top: 5px; }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .hitech-export-btn, .hitech-share-btn { background: #2d3748; color: #e2e8f0; }
    .hitech-share-menu { background: #2d3748; border-color: #4a5568; }
    .hitech-share-option { color: #e2e8f0 !important; }
    .hitech-share-option:hover { background: #4a5568; }
}