/* ========================================
   UI Components
   ======================================== */

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-primary);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    min-height: 32px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
}

/* Hide menu toggle on desktop */
.menu-toggle {
    display: none;
}

/* ===== Form Inputs ===== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: var(--border-color-hover);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* Number Input Spinner Styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Custom number input with increment/decrement buttons */
.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input-wrapper .form-input {
    padding-right: 40px;
    text-align: center;
}

.number-input-wrapper .number-controls {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.number-input-wrapper .number-btn {
    width: 28px;
    height: 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
    font-size: 10px;
}

.number-input-wrapper .number-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.number-input-wrapper .number-btn:active {
    transform: scale(0.95);
}

.dimension-inputs {
    display: flex;
    gap: var(--space-xs);
}

.dimension-inputs .form-input {
    text-align: center;
    padding: var(--space-sm);
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
    padding-right: var(--space-xl);
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-bar svg {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar .form-input {
    padding-left: calc(var(--space-md) + 26px);
}

/* ===== Table ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    padding: 16px 24px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Remove bottom border for the last row to avoid double border with wrapper */
.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-glass);
}

/* Bigger 1:1 product images */
.table-img-cell {
    padding: 8px !important;
    width: 120px;
}

.table-img {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    aspect-ratio: 1/1;
    display: block;
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
}

.table-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}


/* ===== Mobile Product Cards ===== */
.mobile-product-cards {
    display: none;
    padding: var(--space-md);
}

.mobile-product-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-color);
}

.mobile-product-card:last-child {
    margin-bottom: 0;
}

.mobile-product-header {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* Bigger mobile product image */
.mobile-product-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-secondary);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.mobile-product-img:hover {
    transform: scale(1.02);
}

.mobile-product-info {
    flex: 1;
    min-width: 0;
}

.mobile-product-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-product-sku {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mobile-product-category {
    display: inline-block;
    font-size: var(--text-xs);
    padding: 2px 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.mobile-product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.mobile-product-detail {
    display: flex;
    flex-direction: column;
}

.mobile-product-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-product-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.mobile-product-value.price {
    color: var(--success);
}

.mobile-product-value.low-stock {
    color: var(--warning);
}

.mobile-product-value.out-of-stock {
    color: var(--danger);
}

.mobile-product-actions {
    display: flex;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.mobile-product-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Inline Edit */
.inline-edit {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.inline-edit:hover {
    background: var(--bg-glass);
}

.inline-edit.editing {
    background: var(--bg-tertiary);
}

.inline-edit input {
    width: 70px;
    padding: var(--space-xs);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-md);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal {
    transform: scale(1) translateY(0);
}

/* Small modal for delete confirmation */
.modal-sm {
    max-width: 400px;
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-close:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-body.text-center {
    text-align: center;
}

.modal-body h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.modal-body p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
}

/* Delete confirmation modal styling */
.delete-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    border-radius: 50%;
    background: var(--danger-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.delete-icon svg {
    width: 40px;
    height: 40px;
    color: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

/* Image Preview Modal */
.modal-image {
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    overflow: visible;
}

.modal-image img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    object-fit: contain;
    box-shadow: var(--shadow-lg);
}

.image-modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover,
.upload-zone:active {
    border-color: var(--accent-primary);
    background: var(--bg-glass);
}

.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.upload-zone svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.upload-zone p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

.upload-preview {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.upload-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: calc(100vw - 32px);
    width: 100%;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success svg {
    color: var(--success);
}

.toast.error svg {
    color: var(--danger);
}

.toast.info svg {
    color: var(--info);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-md);
    min-height: 400px;
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
}

.icon-circle {
    width: 100%;
    height: 100%;
    background: var(--bg-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px var(--accent-glow);
    animation: float 6s ease-in-out infinite;
}

.icon-circle svg {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.5));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.icon-particles span {
    position: absolute;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
}

.icon-particles span:nth-child(1) {
    width: 8px;
    height: 8px;
    top: 0;
    left: 20%;
    animation: particle 3s ease-out infinite 1s;
}

.icon-particles span:nth-child(2) {
    width: 6px;
    height: 6px;
    top: 20%;
    right: 10%;
    animation: particle 4s ease-out infinite 0.5s;
}

.icon-particles span:nth-child(3) {
    width: 10px;
    height: 10px;
    bottom: 10%;
    left: 10%;
    animation: particle 3.5s ease-out infinite 1.5s;
}

@keyframes particle {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translate(var(--mx, 20px), var(--my, -20px));
        opacity: 0;
    }
}

.empty-state h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
}

/* ===== Price Display ===== */
.price-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-original {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-sale {
    font-weight: 600;
    color: var(--success);
}

/* ========================================
   MOBILE COMPONENTS (max-width: 1023px)
   ======================================== */
@media (max-width: 1023px) {

    /* Show menu toggle on tablet/mobile */
    .menu-toggle {
        display: flex !important;
    }
}

/* ========================================
   MOBILE COMPONENTS (max-width: 767px)
   ======================================== */
@media (max-width: 767px) {

    /* Show mobile cards, hide table */
    .table-wrapper {
        display: none;
    }

    .mobile-product-cards {
        display: flex !important;
        flex-direction: column;
        gap: var(--space-md);
    }

    .mobile-product-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: var(--space-md);
    }

    .mobile-product-header {
        display: flex;
        gap: var(--space-md);
        margin-bottom: var(--space-md);
    }

    .mobile-product-img {
        width: 80px;
        height: 80px;
        border-radius: var(--radius-md);
        object-fit: cover;
        background: var(--bg-tertiary);
        flex-shrink: 0;
    }

    .mobile-product-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-product-name {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-product-sku {
        font-size: var(--text-xs);
        color: var(--text-muted);
        font-family: var(--font-mono);
        margin-bottom: 4px;
    }

    .mobile-product-category {
        display: inline-block;
        padding: 2px 8px;
        background: var(--bg-glass);
        border-radius: var(--radius-full);
        font-size: 10px;
        color: var(--text-secondary);
    }

    .mobile-product-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
        padding: var(--space-md) 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        margin-bottom: var(--space-md);
    }

    /* New expanded details grid */
    .mobile-product-details-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md) 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        margin-bottom: var(--space-md);
        background: var(--bg-tertiary);
        margin: 0 calc(var(--space-md) * -1);
        padding-left: var(--space-md);
        padding-right: var(--space-md);
        margin-bottom: var(--space-md);
    }

    .mobile-product-detail-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--space-sm);
    }

    .mobile-product-detail-row:last-child {
        grid-template-columns: 1fr 2fr;
    }

    .mobile-product-detail {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: var(--space-xs) 0;
    }

    .mobile-product-detail.full-width {
        grid-column: span 1;
    }

    .mobile-product-label {
        font-size: 10px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .mobile-product-value {
        font-weight: 600;
        color: var(--text-primary);
        font-size: var(--text-sm);
        word-break: break-word;
    }

    .mobile-product-value.original-price {
        color: var(--text-muted);
        text-decoration: line-through;
        font-weight: 500;
    }

    .mobile-product-value.price {
        color: var(--success);
    }

    .mobile-product-value.out-of-stock {
        color: var(--danger);
    }

    .mobile-product-value.low-stock {
        color: var(--warning);
    }

    .mobile-product-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

    .mobile-product-actions .btn {
        justify-content: center;
    }

    /* Form adjustments */
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Modal fullscreen on mobile */
    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(100%);
    }

    .modal-backdrop.open .modal {
        transform: translateY(0);
    }

    .modal-sm {
        max-height: auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Image modal on mobile */
    .modal-image {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-image img {
        max-height: 80vh;
        border-radius: 0;
    }

    .image-modal-close {
        top: var(--space-md);
        right: var(--space-md);
    }

    /* Toast at bottom */
    .toast-container {
        bottom: var(--space-md);
    }

    /* Empty state */
    .empty-state {
        padding: var(--space-xl);
    }

    .empty-state svg {
        width: 48px;
        height: 48px;
    }

    /* ===== Floating Search Button ===== */
    .floating-search-btn {
        display: flex;
        position: fixed;
        bottom: 90px;
        right: var(--space-md);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--accent-gradient);
        border: none;
        color: white;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg), 0 0 20px rgba(124, 58, 237, 0.4);
        cursor: pointer;
        z-index: 90;
        transition: all var(--transition-fast);
        animation: floatPulse 2s ease-in-out infinite;
    }

    .floating-search-btn svg {
        width: 24px;
        height: 24px;
    }

    .floating-search-btn:active {
        transform: scale(0.95);
    }

    .floating-search-btn.hidden {
        display: none;
    }

    @keyframes floatPulse {

        0%,
        100% {
            box-shadow: var(--shadow-lg), 0 0 20px rgba(124, 58, 237, 0.4);
        }

        50% {
            box-shadow: var(--shadow-lg), 0 0 30px rgba(124, 58, 237, 0.6);
        }
    }

    /* Hide header search bar on mobile products page */
    .header-actions .search-bar {
        display: none;
    }

    /* ===== Mobile Search Overlay ===== */
    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .mobile-search-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .mobile-search-container {
        padding: var(--space-md);
        padding-top: calc(var(--space-md) + env(safe-area-inset-top));
        transform: translateY(-100%);
        transition: transform var(--transition-normal);
    }

    .mobile-search-overlay.open .mobile-search-container {
        transform: translateY(0);
    }

    .mobile-search-bar {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-xl);
        padding: var(--space-sm) var(--space-md);
        box-shadow: var(--shadow-lg);
    }

    .mobile-search-bar>svg {
        width: 20px;
        height: 20px;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .mobile-search-bar .form-input {
        flex: 1;
        border: none;
        background: transparent;
        padding: var(--space-sm);
        font-size: var(--text-base);
        min-height: auto;
    }

    .mobile-search-bar .form-input:focus {
        box-shadow: none;
        border: none;
    }

    .mobile-search-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--bg-glass);
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        flex-shrink: 0;
        transition: all var(--transition-fast);
    }

    .mobile-search-close svg {
        width: 18px;
        height: 18px;
    }

    .mobile-search-close:active {
        background: var(--bg-glass-hover);
        color: var(--text-primary);
    }

    /* Adjust toast position when floating button is visible */
    .toast-container {
        bottom: 160px;
    }
}

/* Floating search button hidden on desktop */
.floating-search-btn {
    display: none;
}

.mobile-search-overlay {
    display: none;
}

@media (max-width: 767px) {
    .floating-search-btn {
        display: flex;
    }

    .mobile-search-overlay {
        display: block;
    }
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

/* Sync indicator */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.sync-indicator.online {
    background: var(--success-bg);
    color: var(--success);
}

.sync-indicator.offline {
    background: var(--warning-bg);
    color: var(--warning);
}

.sync-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-indicator.syncing::before {
    animation: pulse 1s infinite;
}