/* Quick Order Page Styles */

.quick-order-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.quick-order-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Filter Buttons */
.quick-order-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-order-filter-btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.quick-order-filter-btn.active {
    font-weight: 600;
}

/* Controls Row */
.quick-order-controls {
    gap: 1rem;
}

.quick-order-search input {
    min-width: 250px;
}

/* Category Cards */
.quick-order-category {
    border-radius: 0.5rem;
    overflow: hidden;
}

.quick-order-category-header {
    background-color: #f8f9fa;
    font-size: 1rem;
}

.quick-order-category.hidden {
    display: none;
}

/* Product Table */
.quick-order-table {
    font-size: 0.875rem;
}

.quick-order-table th {
    font-weight: 600;
    white-space: nowrap;
    border-bottom-width: 2px;
}

.quick-order-table td {
    vertical-align: middle;
}

.quick-order-product-row.hidden {
    display: none;
}

.quick-order-product-row.selected {
    background-color: rgba(5, 150, 105, 0.08);
}

/* Product Image */
.quick-order-product-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
}

.quick-order-no-image {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

/* Product Link */
.quick-order-product-link {
    color: inherit;
    text-decoration: none;
}

.quick-order-product-link:hover {
    color: #059669;
    text-decoration: underline;
}

/* Points */
.quick-order-points {
    color: #059669 !important;
}

/* Quantity Input Group */
.quick-order-quantity-group {
    max-width: 120px;
    margin: 0 auto;
}

.quick-order-quantity-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
}

.quick-order-quantity-group input {
    text-align: center;
    font-weight: 600;
    padding: 0.25rem;
}

.quick-order-quantity-group input::-webkit-outer-spin-button,
.quick-order-quantity-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quick-order-quantity-group input[type="number"] {
    -moz-appearance: textfield;
}

/* Row Sum */
.quick-order-row-sum {
    font-weight: 600;
    color: #059669;
}

/* Sidebar */
.quick-order-sidebar {
    position: sticky;
    top: 1rem;
}

.quick-order-sidebar .card {
    border-radius: 0.5rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: none;
    overflow: hidden;
}

.quick-order-sidebar .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
}

.quick-order-sidebar .card-body {
    padding: 1.25rem;
}

.quick-order-sidebar .card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

/* Points Progress - PointBox Style */
.quick-order-points-progress {
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
}

.point-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.point-progress-text {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #374151;
    letter-spacing: -0.01em;
}

.point-progress-bar-wrapper {
    margin-bottom: 0.5rem;
}

.point-progress-bar-track {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.point-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
    border-radius: 100px;
    transition:
        width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.3s ease;
    position: relative;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.3);
}

.point-progress-message {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
}

/* Threshold Reached State */
.quick-order-points-progress.threshold-reached {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #a7f3d0;
}

.quick-order-points-progress.threshold-reached .point-progress-bar-fill {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.quick-order-points-progress.threshold-reached .point-progress-text,
.quick-order-points-progress.threshold-reached .point-progress-message {
    color: #047857;
}

/* Threshold Blocked State - matches PointBox plugin */
.quick-order-points-progress.threshold-blocked {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    border-left: 4px solid #fb923c;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.12);
}

.quick-order-points-progress.threshold-blocked .point-progress-text {
    color: #c2410c;
    font-weight: 500;
}

.quick-order-points-progress.threshold-blocked .point-progress-message {
    color: #c2410c;
}

/* Threshold Badge on Products - matches PointBox plugin */
.quick-order-threshold-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9a3412;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin-top: 0.3rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(251, 146, 60, 0.1);
}

/* Desktop: show badge in Punkte column, hide in Produkt column */
.quick-order-threshold-mobile {
    display: none;
}

/* Blocked Order Button - matches PointBox plugin */
#addToCartBtn.pointbox-blocked {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none !important;
}

/* Cart Items List */
#cartItemsList {
    max-height: 200px;
    overflow-y: auto;
}

#cartItemsList li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.875rem;
}

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

.cart-item-name {
    font-weight: 500;
}

.cart-item-details {
    color: #6c757d;
    font-size: 0.8125rem;
}

/* Summary */
.quick-order-summary {
    font-size: 0.9375rem;
}

/* Buttons */
#addToCartBtn:disabled {
    opacity: 0.5;
}

#addToCartBtn:not(:disabled) {
    background-color: #059669;
    border-color: #059669;
}

#addToCartBtn:not(:disabled):hover {
    background-color: #047857;
    border-color: #047857;
}

/* Responsive */
@media (max-width: 991.98px) {
    .quick-order-sidebar {
        position: static;
        margin-top: 2rem;
    }

    .quick-order-search input {
        min-width: 150px;
    }
}

@media (max-width: 767.98px) {
    .quick-order-controls {
        flex-direction: column;
        align-items: stretch !important;
    }

    .quick-order-search {
        margin-top: 0.5rem;
    }

    .quick-order-search input {
        width: 100%;
        min-width: unset;
    }

    /* Compact category filter buttons */
    .quick-order-filter-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Hide Bild, Art.-Nr., Summe columns on mobile */
    .quick-order-table th:nth-child(1),
    .quick-order-table td:nth-child(1),
    .quick-order-table th:nth-child(2),
    .quick-order-table td:nth-child(2),
    .quick-order-table th:nth-child(6),
    .quick-order-table td:nth-child(6) {
        display: none;
    }

    .quick-order-table {
        font-size: 0.8125rem;
    }

    /* Mobile: show badge under product name, hide in Punkte column */
    .quick-order-threshold-desktop {
        display: none !important;
    }

    .quick-order-threshold-mobile {
        display: block;
        margin-top: 0.25rem;
    }

    /* Compact sidebar on mobile */
    .quick-order-sidebar {
        margin-bottom: 1rem;
    }

    .quick-order-sidebar .card-body {
        padding: 0.75rem;
    }

    .quick-order-sidebar .card-header {
        padding: 0.6rem 0.75rem;
        font-size: 0.875rem;
    }

    .quick-order-sidebar .card-footer {
        padding: 0.6rem 0.75rem;
    }

    /* Hide cart items list on mobile — keep progress + summary + buttons */
    #quickOrderCartItems {
        display: none;
    }

    .quick-order-sidebar hr {
        display: none;
    }

    .quick-order-summary {
        font-size: 0.8125rem;
    }

    .quick-order-points-progress {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Loading State */
.quick-order-loading {
    opacity: 0.6;
    pointer-events: none;
}

.quick-order-loading::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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