/* General styles (оставляем без изменений) */
:root {
    /* Dark Theme Colors */
    --background-dark: #1a1a2e;
    --background-light: #24243e;
    --card-background: #16213e; /* Default dark card background */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #0f3460;
    --accent-blue: #0f86ff; /* A slightly brighter blue */
    --accent-blue-dark: #0056b3;
    --accent-red: #ff497c;
    --accent-yellow-card: #f8c000; /* New color for yellow cards */
    --accent-white-card: #f0f0f0; /* New color for white cards */
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --input-background: #2b2b4d;
    --input-border: #3f4a6e;
    --modal-background: #1a1a2e;
}

html, body {
    height: 100%; /* Ensure html and body take full height */
    overflow: auto; /* Allow scrolling if content overflows */
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-dark);
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

#app {
    width: 100%;
    max-width: 1600px; /* Increased max-width for more content space */
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 18px;
    box-shadow: 0 10px 40px var(--shadow-dark);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex-shrink: 0; /* Prevent app from shrinking */
}

/* Header and Actions */
header {
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 60px;
    /* Добавляем минимальную ширину для flex-контейнера, чтобы он не сжимался слишком сильно */
    min-width: 0; /* Важно для flex-элементов */
}

header h1 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 2.8em;
    text-align: left;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    order: 1;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    order: 3;
}

.search-container {
    position: relative;
    flex-grow: 1;
    /* УДАЛЕНО: max-width: 400px; (как и в прошлый раз) */
    order: 2;
    margin: 0;
    /* НОВОЕ: Убедимся, что он не будет меньше 0, чтобы избежать переполнения */
    min-width: 0;
    /* НОВОЕ: Добавим padding-right, чтобы дать место для кнопок, если они встанут рядом */
    /* Это может быть избыточно, если flexbox сам правильно распределит пространство,
       но можно использовать как "страховку" */
    /* padding-right: 15px; */ /* Закомментировано, так как `gap` в `header-top` должен справиться */
}


.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1em;
}

#search-input {
    width: 100%;
    padding: 14px 18px 14px 45px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    font-size: 16px;
    background-color: var(--input-background);
    color: var(--text-primary);
    box-shadow: inset 0 2px 5px var(--shadow-dark);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* Убедимся, что padding и border включены в width */
}

#search-input::placeholder {
    color: var(--text-secondary);
}

#search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(15, 134, 255, 0.3), inset 0 2px 5px var(--shadow-dark);
    outline: none;
}

.primary-btn, .secondary-btn, .tertiary-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease-out;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.icon-btn {
    padding: 12px 20px;
    font-size: 15px;
}

.small-btn {
    padding: 8px 15px;
    font-size: 14px;
}

.primary-btn {
    background-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(15, 134, 255, 0.3);
}

.primary-btn:hover {
    background-color: var(--accent-blue-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(15, 134, 255, 0.4);
}

.secondary-btn {
    background-color: var(--input-background);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.secondary-btn:hover {
    background-color: rgba(15, 134, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(15, 134, 255, 0.2);
}

.tertiary-btn {
    background-color: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.tertiary-btn:hover {
    background-color: var(--input-background);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-light);
}


/* Navigation (оставляем без изменений) */
nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: inset 0 1px 5px var(--shadow-dark);
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 22px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background-color: rgba(15, 134, 255, 0.1);
    color: var(--accent-blue);
}

.nav-btn.active {
    font-weight: 700;
    color: white;
    background-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(15, 134, 255, 0.3);
}

.selection-controls {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Product Grid (оставляем без изменений) */
#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.product-card {
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-dark);
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    border-left: 6px solid transparent;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 0;
}


.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px var(--shadow-dark);
}

/* Card colors: Yellow for favorites, White for sales (оставляем без изменений) */
.product-card.is-favorite {
    background-color: var(--accent-yellow-card);
    border-left-color: #e0a800;
    color: #333;
}

.product-card.is-favorite .card-header h3,
.product-card.is-favorite .card-body p,
.product-card.is-favorite .card-body .old-price,
.product-card.is-favorite .card-footer,
.product-card.is-favorite .card-actions button {
    color: #333;
}
.product-card.is-favorite .card-body .price {
    color: #d82d3e;
}

.product-card.is-sale {
    background-color: var(--accent-white-card);
    border-left-color: #cccccc;
    color: #333;
}

.product-card.is-sale .card-header h3,
.product-card.is-sale .card-body p,
.product-card.is-sale .card-body .old-price,
.product-card.is-sale .card-footer,
.product-card.is-sale .card-actions button {
    color: #333;
}
.product-card.is-sale .card-body .price {
    color: #dc3545;
}


.product-card.is-selected {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(15, 134, 255, 0.3);
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.card-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: inherit;
    flex-grow: 1;
    line-height: 1.4;
    max-width: calc(100% - 80px);
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: 20px;
}

.card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: inherit;
    padding: 0;
    transition: color 0.2s ease, transform 0.1s ease-out;
}

.card-actions button:hover {
    color: var(--accent-blue);
    transform: scale(1.15);
}

.product-card.is-favorite .card-actions button.favorite,
.product-card.is-sale .card-actions button.favorite {
    color: #333;
}
.product-card.is-favorite .card-actions button:hover,
.product-card.is-sale .card-actions button:hover {
    color: #555;
}


.updated-badge {
    font-size: 0.8em;
    background-color: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-right: 8px;
    box-shadow: 0 2px 5px rgba(40,167,69,0.3);
    white-space: nowrap;
}

.card-body p {
    margin: 8px 0;
    font-size: 1em;
    color: inherit;
    word-break: break-word;
}

.card-body .price {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--accent-red);
    display: flex;
    align-items: baseline;
    font-family: 'Roboto Mono', monospace;
    margin-top: 15px;
}
/* Styling for price decimal part (now 50% of main price font size) */
.price .decimal-part {
    font-size: 0.5em;
    vertical-align: super;
    position: relative;
    top: -0.1em;
    margin-left: 0.05em;
    font-weight: inherit;
}
/* Styling for currency symbol (now 100% of main price font size, placed after decimal) */
.price .currency-symbol {
    font-size: 1em;
    font-weight: inherit;
    margin-left: 0.2em;
}


.card-body .old-price {
    text-decoration: line-through;
    color: inherit;
    font-size: 0.8em;
    margin-left: 15px;
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
}
/* Styling for old price decimal part and currency symbol - applying same 2:1 ratio */
.old-price .decimal-part {
    font-size: 0.5em;
    vertical-align: super;
    position: relative;
    top: -0.1em;
    margin-left: 0.05em;
    font-weight: inherit;
}

.old-price .currency-symbol {
    font-size: 1em;
    font-weight: inherit;
    margin-left: 0.2em;
}


.card-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--input-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    color: inherit;
    font-size: 0.9em;
}

/* Adjust border-top for colored cards */
.product-card.is-favorite .card-footer,
.product-card.is-sale .card-footer {
    border-top-color: rgba(0,0,0,0.1);
}


.select-checkbox {
    transform: scale(1.8);
    cursor: pointer;
    margin-left: 10px;
    accent-color: var(--accent-blue);
    width: 24px;
    height: 24px;
}

/* Loader (оставляем без изменений) */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 25px;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.loader {
    border: 8px solid var(--input-background);
    border-radius: 50%;
    border-top: 8px solid var(--accent-blue);
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(15, 134, 255, 0.5);
}

.loader-text {
    font-size: 1.4em;
    color: var(--text-primary);
    font-weight: 600;
    text-shadow: 0 1px 3px var(--shadow-dark);
}

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

/* Modals (оставляем без изменений) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 990;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--modal-background);
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 12px 40px var(--shadow-dark);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.modal-content.wide {
    max-width: 95vw;
}

.modal-content.small {
    max-width: 450px;
    text-align: center;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease-out;
}

.modal-close-btn:hover {
    color: var(--accent-red);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--accent-blue);
    text-align: center;
    font-size: 2.2em;
    font-weight: 700;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Editor Specific Styles (оставляем без изменений) */
#editor-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    background-color: var(--input-background);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    border: 1px solid var(--input-border);
    box-shadow: inset 0 2px 5px var(--shadow-dark);
}

#editor-toolbar select,
#editor-toolbar input[type="number"],
#editor-toolbar input[type="color"],
#editor-toolbar button {
    border-radius: 8px;
    border: 1px solid var(--input-border);
    padding: 10px 15px;
    font-size: 16px;
    background-color: var(--background-dark);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

#editor-toolbar button {
    min-width: 45px;
    cursor: pointer;
    background-color: var(--background-dark);
    color: var(--text-secondary);
}
#editor-toolbar button i {
    font-size: 1.1em;
}

#editor-toolbar button.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(15, 134, 255, 0.3);
}

#editor-toolbar input[type="color"] {
    padding: 8px;
    height: 44px;
    min-width: 60px;
    cursor: pointer;
}
/* For Firefox */
input[type="color"]::-moz-color-swatch {
    border-radius: 6px;
    border: none;
}
/* For Chrome/Safari */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: none;
}

#editor-toolbar select:focus,
#editor-toolbar input:focus,
#editor-toolbar button:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(15, 134, 255, 0.3);
}

.editor-body {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.editor-canvas-container {
    flex-grow: 1;
    background-color: var(--background-dark);
    border: 2px solid var(--border-color);
    min-height: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 15px var(--shadow-dark), 0 5px 20px var(--shadow-dark);
}

#editor-canvas {
    display: block;
    border-radius: 10px;
    background-color: white;
}

.editor-controls {
    flex-basis: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    background-color: var(--card-background);
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.editor-controls h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: var(--accent-blue);
    font-size: 1.3em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group label {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1em;
    color: var(--text-primary);
}

.form-group input,
.editor-controls textarea,
.form-group select {
    padding: 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    resize: vertical;
    min-height: 50px;
    background-color: var(--input-background);
    color: var(--text-primary);
}

/* New style for attribute input container (оставляем без изменений) */
.attributes-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.attribute-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attribute-input-group input {
    flex-grow: 1;
    min-height: 40px;
    padding: 10px;
}

.attribute-input-group .remove-attribute-btn {
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.attribute-input-group .remove-attribute-btn:hover {
    background-color: #c0392b;
}

/* Added for lineHeight control (оставляем без изменений) */
.line-height-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.line-height-control label {
    margin-bottom: 0;
    white-space: nowrap;
}
.line-height-control input {
    width: 80px;
    flex-shrink: 0;
}


.form-group input:focus,
.editor-controls textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(15, 134, 255, 0.3);
}

.form-group small {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.4;
}

.editor-controls hr {
    border: none;
    border-top: 1px dashed var(--input-border);
    margin: 15px 0;
}

/* Mapping Modal Specific Styles (оставляем без изменений) */
#mapping-modal .modal-content {
    max-width: 650px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-group.span-2 {
        grid-column: span 2;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #app {
        padding: 20px;
    }
    .editor-body {
        flex-direction: column;
        gap: 20px;
    }
    .editor-controls {
        flex-basis: auto;
        width: 100%;
    }
    .editor-canvas-container {
        min-height: 450px;
    }
}

@media (max-width: 900px) {
    body {
        padding: 10px;
    }
    #app {
        padding: 15px;
        margin: 10px auto;
    }
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 20px;
        justify-content: flex-start;
        /* НОВОЕ: Убедимся, что header-top сам не выходит за границы. */
        width: 100%;
        box-sizing: border-box;
    }
    header h1 {
        font-size: 2.2em;
        text-align: center;
        width: 100%;
        margin-bottom: 15px;
        order: 1;
    }
    .search-container {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0 0 15px 0;
        /* НОВОЕ: Убедимся, что search-container не выходит за пределы,
                   добавив max-width, который рассчитывается с учетом паддинга родителя. */
        max-width: 100%; /* Убедимся, что он не будет шире родителя */
        box-sizing: border-box; /* Важно, чтобы паддинги учитывались в width */
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 0;
        order: 3;
    }
    .header-actions > button {
        flex-grow: 1;
        min-width: 120px;
    }
}


/* PDF Preview Modal (оставляем без изменений) */
#pdf-preview-modal .modal-content {
    max-width: 1000px;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pdf-controls button {
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 8px;
}

.pdf-viewer-container {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px var(--shadow-dark), 0 5px 20px var(--shadow-dark);
    margin-bottom: 25px;
    overflow: hidden;
    border-radius: 10px;
    background-color: var(--background-dark);
}

#pdf-viewer {
    width: 100%;
    height: 100%;
}

/* Section Modals (оставляем без изменений) */
#section-modal .modal-content,
#add-to-section-modal .modal-content {
    max-width: 550px;
}

.section-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.section-input-group input {
    flex-grow: 1;
}

#section-list,
#add-to-section-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-background);
}

#section-list li,
#add-to-section-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

#section-list li:last-child,
#add-to-section-list li:last-child {
    border-bottom: none;
}

#section-list li .section-actions button,
#brand-list li .brand-actions button {
    background: none;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    margin-left: 8px;
}

#section-list li .section-actions button:hover,
#brand-list li .brand-actions button:hover {
    color: var(--accent-blue);
}

#section-list li .section-actions .delete-section-btn:hover,
#brand-list li .brand-actions .delete-brand-btn:hover {
    color: var(--accent-red);
}

#add-to-section-list li button.toggle-product-section-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-color: var(--accent-blue);
    color: white;
    border: none;
}

#add-to-section-list li button.toggle-product-section-btn.active {
    background-color: var(--accent-red);
}

#add-to-section-list li button.toggle-product-section-btn:hover {
    opacity: 0.8;
}

/* Brand Modals (оставляем без изменений) */
#brands-modal .modal-content {
    max-width: 600px;
}

.brand-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.brand-input-group input[type="text"] {
    flex-grow: 1;
}

#new-brand-logo-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

#brand-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-background);
}

#brand-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

#brand-list li:last-child {
    border-bottom: none;
}

#brand-list li .brand-logo-preview {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    background-color: white;
}

#brand-list li .brand-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

#brand-list li .brand-actions {
    display: flex;
    gap: 5px;
}


/* Toast Notifications - FIX (оставляем без изменений) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    align-items: flex-end;
}

.toast {
    background-color: var(--card-background);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeInOutToast 3s forwards;
    min-width: 250px;
    max-width: 350px;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
    font-size: 0.95em;
    font-weight: 500;
    pointer-events: auto;
}

.toast.info {
    border-left: 5px solid var(--accent-blue);
}

.toast.success {
    border-left: 5px solid #28a745;
}

.toast.warning {
    border-left: 5px solid #ffc107;
    color: #333;
    background-color: #f8e090;
}

.toast.error {
    border-left: 5px solid var(--accent-red);
}

@keyframes fadeInOutToast {
    0% { opacity: 0; transform: translateX(100%); }
    10% { opacity: 1; transform: translateX(0); }
    90% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}
