/**
 * Catalogue Styles - Product Deletion UI
 * Mobile-first design with tactile-friendly buttons
 */

/* ========================================
   CATALOGUE TOOLBAR
   ======================================== */

.catalogue-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface, #ffffff);
    border-radius: 12px;
    margin: 1rem 0;
}

/* Row 1: Selection button and search bar */
.catalogue-toolbar-row-1 {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-selection-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    /* White background */
    color: #03A5F5;
    /* Blue text */
    border: 2px solid #03A5F5;
    /* Blue border */
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-selection-mode:active {
    transform: scale(0.98);
}

.btn-selection-mode.active {
    background: #03A5F5;
    /* Blue background when active */
    color: white;
    border-color: #03A5F5;
}

.btn-selection-mode svg {
    flex-shrink: 0;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-delete-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--danger, #ef4444);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-delete-selected:hover:not(:disabled) {
    background: var(--danger-dark, #dc2626);
}

.btn-delete-selected:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-delete-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cancel-selection {
    padding: 0.75rem 1rem;
    background: var(--surface-light, #f3f4f6);
    color: var(--text-secondary, #6b7280);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-cancel-selection:active {
    transform: scale(0.98);
}

/* Search Container */
.search-container {
    position: relative;
    flex: 1 1 auto;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.product-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s ease;
    min-height: 44px;
}

.product-search-input:focus {
    outline: none;
    border-color: #03A5F5;
    box-shadow: 0 0 0 3px rgba(3, 165, 245, 0.1);
}

.product-search-input::placeholder {
    color: #9ca3af;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.clear-search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ========================================
   PRODUCTS LIST
   ======================================== */

.products-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 0 1rem 0;
    min-height: 200px;
}

/* Loading and Empty States */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary, #6b7280);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary, #1f2937);
}

.empty-state .hint {
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
}

.error-state {
    color: var(--danger, #ef4444);
}

/* ========================================
   PRODUCT CARD - Mobile First - SIMPLIFIED
   ======================================== */

.product-card {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    /* Pure white background */
    border-radius: 12px;
    align-items: center;
    min-height: 80px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    /* Light border for definition */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-card:active {
    transform: scale(0.99);
}

/* Checkbox */
.product-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #03A5F5;
    /* Blue accent */
    flex-shrink: 0;
}

/* Product Image */
.product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9fafb;
    padding: 4px;
    flex-shrink: 0;
}

/* Product Info - SIMPLIFIED */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #000000;
    /* Pure black text */
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* Hide brand, price, and channel - only show title */
.product-brand,
.product-meta,
.product-channel,
.product-price {
    display: none !important;
}

/* Delete Button - Tactile Friendly */
.btn-delete-product {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--danger-light, #fee2e2);
    color: var(--danger, #ef4444);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    justify-self: end;
}

.btn-delete-product:hover {
    background: var(--danger, #ef4444);
    color: white;
    transform: scale(1.05);
}

.btn-delete-product:active {
    transform: scale(0.95);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--surface, #ffffff);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-primary, #1f2937);
}

.modal-content p {
    margin: 0 0 1.5rem 0;
    color: #ffffff; /* White text for readability on dark background */
    line-height: 1.5;
}

.modal-content small {
    font-size: 0.85rem;
    color: var(--text-secondary, #9ca3af);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    background: var(--danger, #ef4444);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-danger:hover {
    background: var(--danger-dark, #dc2626);
}

.btn-danger:active {
    transform: scale(0.98);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--surface-light, #f3f4f6);
    color: var(--text-secondary, #6b7280);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-secondary:hover {
    background: var(--surface-dark, #e5e7eb);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-light, #f3f4f6);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #6366f1), var(--primary-dark, #4f46e5));
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ========================================
   DESKTOP ADJUSTMENTS
   ======================================== */

@media (min-width: 768px) {
    .products-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1rem;
    }

    .product-card {
        cursor: default;
    }

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .catalogue-toolbar {
        flex-wrap: nowrap;
    }

    .modal-content {
        max-width: 500px;
    }
}

/* ========================================
   COLOR VARIABLES (if not defined)
   ======================================== */

:root {
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #fee2e2;
    --surface-dark: #e5e7eb;
}