/**
 * Solutioo LiveStock - Frontend Styles
 */

/* ============================================
   Warehouse Stock Block
   ============================================ */

.livestock-warehouse-stock {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.livestock-stock-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.livestock-stock-summary .stock-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}

.livestock-stock-summary .stock-status.in-stock {
    color: #2e7d32;
}

.livestock-stock-summary .stock-status.backorder {
    color: #f57c00;
}

.livestock-stock-summary .stock-status.out-of-stock {
    color: #c62828;
}

.livestock-stock-summary .stock-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stock-status.in-stock .stock-icon {
    background-color: #2e7d32;
}

.stock-status.backorder .stock-icon {
    background-color: #f57c00;
}

.stock-status.out-of-stock .stock-icon {
    background-color: #c62828;
}

.livestock-stock-summary .delivery-date {
    color: #666;
    font-size: 13px;
}

/* Toggle Button */
.livestock-toggle-details {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
}

.livestock-toggle-details:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.livestock-toggle-details .toggle-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    transition: transform 0.2s ease;
}

.livestock-toggle-details.is-open .toggle-icon {
    transform: rotate(180deg);
}

/* Details Table */
.livestock-details {
    margin-top: 15px;
}

.livestock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.livestock-table th,
.livestock-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.livestock-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.livestock-table tbody tr:hover {
    background: #fafafa;
}

.livestock-table tbody tr.has-stock .warehouse-stock {
    color: #2e7d32;
}

.livestock-table tbody tr.backorder .warehouse-stock {
    color: #f57c00;
}

.livestock-table tbody tr.no-stock .warehouse-stock {
    color: #999;
}

.livestock-table .qty {
    font-weight: 600;
}

.livestock-table .label {
    color: #666;
    font-size: 12px;
    margin-left: 4px;
}

.livestock-table .backorder-message {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.livestock-table .express-delivery {
    display: block;
    font-size: 12px;
    color: #1976d2;
    margin-top: 3px;
}

/* ============================================
   Delivery Estimate Widget
   ============================================ */

.livestock-delivery-estimate-widget {
    margin: 15px 0;
}

.livestock-delivery-estimate-widget .delivery-estimate-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 13px;
}

.livestock-delivery-estimate-widget .loader {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: livestock-spin 0.8s linear infinite;
}

@keyframes livestock-spin {
    to {
        transform: rotate(360deg);
    }
}

.livestock-estimate-summary {
    padding: 12px 15px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
}

.estimate-delivery {
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-delivery .delivery-icon {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232e7d32"><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/></svg>') no-repeat center;
    background-size: contain;
}

.estimate-delivery .delivery-text {
    color: #2e7d32;
    font-weight: 600;
}

.estimate-delivery .express-option {
    font-weight: 400;
    color: #1976d2;
    font-size: 12px;
}

.estimate-source {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.estimate-backorder {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff3e0;
    border-color: #ffe0b2;
}

.estimate-backorder .delivery-icon {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f57c00"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>') no-repeat center;
    background-size: contain;
}

.estimate-backorder .backorder-text {
    color: #e65100;
    font-weight: 600;
}

/* ============================================
   Cart Delivery Schedule (Enhanced)
   ============================================ */

.livestock-cart-delivery {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* Header */
.lcd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: #fff;
}

.lcd-icon { display: flex; align-items: center; }
.lcd-icon svg { fill: #fff; }

.lcd-summary { flex: 1; }

.lcd-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.lcd-order-date {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.lcd-order-date strong { font-weight: 700; }

.lcd-split-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.lcd-split-badge svg { fill: #fff; }

/* Alerts */
.lcd-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    line-height: 1.4;
}

.lcd-alert svg { flex-shrink: 0; margin-top: 1px; }

.lcd-alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-bottom: 1px solid #bbdefb;
}

.lcd-alert-info svg { fill: #1565c0; }

.lcd-alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-bottom: 1px solid #ffe0b2;
}

.lcd-alert-warning svg { fill: #e65100; }

/* PLZ Section (Cart) */
.lcd-plz-section {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.lcd-plz-form { display: flex; flex-direction: column; gap: 6px; }

.lcd-plz-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.lcd-plz-label svg { fill: #1976d2; }

.lcd-plz-input-group { display: flex; gap: 8px; }

.lcd-plz-field {
    width: 100px;
    padding: 7px 10px;
    border: 2px solid #d0d5dd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    transition: border-color 0.2s;
}

.lcd-plz-field:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.lcd-plz-field.invalid { border-color: #c62828; }

.lcd-plz-btn {
    padding: 7px 16px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.lcd-plz-btn:hover { background: #1565c0; }

.lcd-plz-active {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 13px;
    border-bottom: 1px solid #bbdefb;
}

.lcd-plz-active svg { fill: #1565c0; }

/* Delivery Timeline */
.lcd-timeline {
    padding: 16px 18px;
}

.lcd-timeline-group {
    display: flex;
    gap: 16px;
    min-height: 60px;
}

.lcd-timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20px;
    flex-shrink: 0;
}

.lcd-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1976d2;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #1976d2;
    flex-shrink: 0;
    z-index: 1;
}

.lcd-timeline-dot.first {
    background: #2e7d32;
    box-shadow: 0 0 0 2px #2e7d32;
}

.lcd-timeline-line {
    width: 2px;
    flex: 1;
    background: #e0e0e0;
    margin: 4px 0;
}

.lcd-timeline-content {
    flex: 1;
    padding-bottom: 16px;
}

.lcd-timeline-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.lcd-date-formatted {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.lcd-date-relative {
    font-size: 12px;
    color: #1976d2;
    font-weight: 600;
}

.lcd-timeline-items { display: flex; flex-direction: column; gap: 6px; }

.lcd-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    gap: 12px;
}

.lcd-item-in_stock { border-left: 3px solid #2e7d32; }
.lcd-item-backorder { border-left: 3px solid #f57c00; }
.lcd-item-out_of_stock { border-left: 3px solid #c62828; }
.lcd-item-unavailable { border-left: 3px solid #999; }

.lcd-item-info { flex: 1; min-width: 0; }

.lcd-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    font-size: 11px;
    color: #888;
}

.lcd-item-qty { font-weight: 700; color: #555; }

.lcd-item-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

/* Badges */
.lcd-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.lcd-badge-stock { background: #e8f5e9; color: #2e7d32; }
.lcd-badge-backorder { background: #fff3e0; color: #e65100; }
.lcd-badge-oos { background: #ffebee; color: #c62828; }

.lcd-express-tag {
    font-size: 11px;
    color: #1976d2;
    font-weight: 600;
    white-space: nowrap;
}

/* Per-item table */
.lcd-items-table {
    padding: 0 18px 16px;
}

.lcd-items-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lcd-items-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #888;
    border-bottom: 2px solid #e0e0e0;
}

.lcd-items-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.lcd-items-table tr:last-child td { border-bottom: none; }

.lcd-product-name { font-weight: 600; color: #333; }
.lcd-qty { color: #888; font-size: 12px; }

.lcd-delivery-date { font-weight: 600; color: #2e7d32; }
.lcd-express-note { display: block; font-size: 11px; color: #1976d2; margin-top: 2px; }
.lcd-backorder-date { color: #f57c00; font-style: italic; }
.lcd-no-date { color: #ccc; }

.lcd-row-in_stock {}
.lcd-row-backorder td { background: #fffbf5; }
.lcd-row-out_of_stock td { opacity: 0.6; }
.lcd-row-unavailable td { opacity: 0.5; }

/* Footer / Order Summary */
.lcd-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f5f7fa;
    border-top: 1px solid #e0e0e0;
    gap: 12px;
}

.lcd-footer-label {
    font-size: 12px;
    color: #666;
}

.lcd-footer-date {
    font-size: 16px;
    font-weight: 700;
    color: #1565c0;
}

.lcd-footer-relative {
    font-size: 12px;
    color: #888;
}

.lcd-footer-right { text-align: right; }

.lcd-first-items {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
}

/* ============================================
   Cart Stock Reservation Info
   ============================================ */

.lcd-reservations {
    margin: 0 18px 16px;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    overflow: hidden;
    background: #f8fbff;
}

.lcd-reservations-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #e3f2fd;
    font-size: 12px;
    font-weight: 700;
    color: #1565c0;
    border-bottom: 1px solid #bbdefb;
}

/* Live countdown timer */
.lcd-reservation-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 10px;
    background: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.lcd-reservation-countdown.countdown-ok {
    color: #2e7d32;
    background: #e8f5e9;
}

.lcd-reservation-countdown.countdown-warn {
    color: #e65100;
    background: #fff3e0;
    animation: lcd-pulse-warn 2s ease-in-out infinite;
}

.lcd-reservation-countdown.countdown-danger {
    color: #c62828;
    background: #ffebee;
    animation: lcd-pulse-danger 1s ease-in-out infinite;
}

@keyframes lcd-pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes lcd-pulse-danger {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Expired state */
.lcd-reservations-header-expired {
    background: #fff3e0 !important;
    color: #e65100 !important;
    border-bottom-color: #ffe0b2 !important;
}

.lcd-reservations-expired-body {
    padding: 14px;
    text-align: center;
}

.lcd-expired-text {
    margin: 0 0 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.lcd-recalculate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lcd-recalculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lcd-recalculate-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.lcd-recalc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: livestock-spin 0.6s linear infinite;
}

@keyframes livestock-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Expired container state */
.lcd-reservation-expired-state {
    border-color: #f57c00 !important;
}

.lcd-reservation-expired-state .lcd-header {
    background: linear-gradient(135deg, #e65100, #f57c00) !important;
}

.lcd-header-attention {
    animation: lcd-header-pulse 2s ease-in-out 3;
}

@keyframes lcd-header-pulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.3); }
}

.lcd-reservations-list {
    padding: 8px 14px;
}

.lcd-reservation-item {
    padding: 6px 0;
    border-bottom: 1px solid #e3f2fd;
}

.lcd-reservation-item:last-child { border-bottom: none; }

.lcd-reservation-sku {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 4px;
}

.lcd-reservation-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lcd-reservation-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #555;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.lcd-res-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2e7d32;
    flex-shrink: 0;
}

.lcd-reservation-source strong {
    color: #1565c0;
}

/* ============================================
   Checkout Delivery Summary (KnockoutJS)
   ============================================ */

.livestock-checkout-delivery {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.lcd-checkout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: #fff;
}

.lcd-checkout-header svg { fill: #fff; }

.lcd-checkout-title {
    font-size: 14px;
    font-weight: 700;
}

.lcd-checkout-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #888;
    font-size: 13px;
}

.lcd-loader {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: livestock-spin 0.8s linear infinite;
}

.lcd-checkout-error {
    padding: 12px 16px;
    background: #fff3e0;
    color: #e65100;
    font-size: 13px;
}

.lcd-checkout-plz-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 12px;
    border-bottom: 1px solid #bbdefb;
}

.lcd-checkout-plz-badge svg { fill: #1565c0; }

/* Checkout alerts */
.lcd-checkout-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
}

.lcd-checkout-alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-bottom: 1px solid #bbdefb;
}

.lcd-checkout-alert-info svg { fill: #1565c0; }

.lcd-checkout-alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-bottom: 1px solid #ffe0b2;
}

.lcd-checkout-alert-warning svg { fill: #e65100; }

/* Checkout per-item list */
.lcd-checkout-items {
    padding: 8px 0;
}

.lcd-checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 16px;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

.lcd-checkout-item:last-child { border-bottom: none; }

.lcd-checkout-item-left {
    flex: 1;
    min-width: 0;
}

.lcd-checkout-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-checkout-item-qty {
    font-size: 11px;
    color: #888;
}

.lcd-checkout-item-right {
    flex-shrink: 0;
    text-align: right;
}

.lcd-checkout-item-delivery {}

.lcd-checkout-date {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
}

.lcd-checkout-relative {
    display: block;
    font-size: 11px;
    color: #1976d2;
    font-weight: 600;
}

.lcd-checkout-express {
    display: block;
    font-size: 11px;
    color: #1976d2;
    margin-top: 2px;
}

.lcd-checkout-item-backorder {}

.lcd-checkout-bo-label {
    font-size: 11px;
    font-weight: 700;
    color: #e65100;
    text-transform: uppercase;
}

.lcd-checkout-bo-date {
    display: block;
    font-size: 12px;
    color: #f57c00;
}

.lcd-checkout-oos {
    font-size: 11px;
    font-weight: 700;
    color: #c62828;
    text-transform: uppercase;
}

.lcd-checkout-source {
    display: block;
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
}

/* Checkout order total delivery */
.lcd-checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f5f7fa;
    border-top: 1px solid #e0e0e0;
}

.lcd-checkout-total-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.lcd-checkout-total-date {
    font-size: 15px;
    font-weight: 700;
    color: #1565c0;
}

/* ============================================
   Customer Reserved Stock
   ============================================ */

.livestock-reserved-stock {
    margin-bottom: 30px;
}

.livestock-reserved-stock .block-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.livestock-reserved-stock .block-title strong {
    font-size: 18px;
    font-weight: 600;
}

.livestock-reserved-stock .reserved-stock-intro {
    margin-bottom: 15px;
    color: #666;
}

.table-reserved-stock {
    width: 100%;
    border-collapse: collapse;
}

.table-reserved-stock th,
.table-reserved-stock td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table-reserved-stock th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.table-reserved-stock tbody tr:hover {
    background: #fafafa;
}

.table-reserved-stock tbody tr.expired {
    opacity: 0.6;
}

.table-reserved-stock .status-active {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.table-reserved-stock .status-expired {
    display: inline-block;
    padding: 3px 8px;
    background: #ffebee;
    color: #c62828;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.livestock-reserved-stock .reserved-stock-info {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.livestock-reserved-stock .reserved-stock-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* ============================================
   PLZ Input Section
   ============================================ */

.livestock-plz-section {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f5f7fa;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
}

.livestock-plz-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.livestock-plz-label .plz-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231976d2"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>') no-repeat center;
    background-size: contain;
}

.livestock-plz-form {
    display: flex;
    gap: 8px;
}

.livestock-plz-input {
    flex: 0 0 120px;
    padding: 8px 12px;
    border: 2px solid #d0d5dd;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    transition: border-color 0.2s;
}

.livestock-plz-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.livestock-plz-input.invalid {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.livestock-plz-submit {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
}

/* Address Dropdown (logged-in customers) */
.livestock-address-selector {
    margin-bottom: 6px;
}

.livestock-address-dropdown {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #d0d5dd;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 8px center;
    background-size: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.livestock-address-dropdown:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.livestock-address-dropdown option {
    padding: 6px;
    font-size: 13px;
}

/* Manual PLZ fallback (with back button) */
.livestock-plz-manual {
    gap: 6px;
}

.livestock-plz-back {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.livestock-plz-back:hover {
    background: #eee;
    color: #333;
}

/* ============================================
   PLZ Enforcement (block add-to-cart)
   ============================================ */

/* Highlight animation on PLZ section when enforcement is active */
.livestock-plz-highlight {
    border-color: #1565c0 !important;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
    animation: livestock-plz-attention 2s ease-in-out 3;
}

@keyframes livestock-plz-attention {
    0%, 100% { box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(21, 101, 192, 0.25); }
}

/* Prompt box above add-to-cart */
.livestock-plz-enforce-prompt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e3f2fd, #f0f7ff);
    border: 2px solid #90caf9;
    border-radius: 8px;
    animation: livestock-prompt-fadein 0.4s ease-out;
}

@keyframes livestock-prompt-fadein {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.livestock-enforce-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #1565c0;
    border-radius: 50%;
    margin-top: 2px;
}

.livestock-enforce-icon svg {
    fill: #fff !important;
}

.livestock-enforce-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.livestock-enforce-text strong {
    font-size: 14px;
    color: #1565c0;
}

.livestock-enforce-text span {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

/* Locked add-to-cart button */
button.livestock-cart-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    position: relative;
}

button.livestock-cart-locked span {
    font-size: 12px !important;
}

/* PLZ Badge */
.livestock-plz-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e3f2fd;
    border-radius: 20px;
    font-size: 13px;
    color: #1565c0;
    margin-bottom: 12px;
}

.plz-badge-icon {
    font-size: 14px;
}

/* ============================================
   Best Estimate Highlight
   ============================================ */

.livestock-best-estimate {
    margin-bottom: 16px;
    border: 2px solid #2e7d32;
    border-radius: 8px;
    overflow: hidden;
}

.best-estimate-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #2e7d32;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.best-estimate-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 14px 16px;
    background: #e8f5e9;
}

.best-source {
    font-weight: 700;
    font-size: 14px;
    color: #1b5e20;
}

.best-delivery {
    font-size: 13px;
    color: #333;
}

.best-delivery-label {
    color: #666;
    font-size: 12px;
}

.best-express {
    color: #1976d2;
    font-size: 12px;
}

.best-stock {
    text-align: right;
    font-size: 13px;
    color: #2e7d32;
}

.best-stock .stock-qty {
    font-weight: 700;
    font-size: 18px;
}

/* ============================================
   Multi-Source Table
   ============================================ */

.livestock-sources-table {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.sources-table-header {
    padding: 10px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.livestock-multisource-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.livestock-multisource-table th {
    padding: 8px 10px;
    text-align: left;
    background: #fafafa;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths (5-col layout: warehouse / stock / standard / express / status) */
.livestock-multisource-table .col-warehouse,
.livestock-multisource-table th:first-child { width: 25%; }
.livestock-multisource-table .col-stock { width: 15%; text-align: center; }
.livestock-multisource-table .col-delivery { width: 25%; }
.livestock-multisource-table .col-express { width: 18%; }
.livestock-multisource-table .col-status { width: 17%; text-align: center; }

/* Matching th widths */
.livestock-multisource-table thead th:nth-child(2) { text-align: center; }
.livestock-multisource-table thead th:last-child { text-align: center; }

.livestock-multisource-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 13px;
}

.livestock-multisource-table tr:last-child td {
    border-bottom: none;
}

.livestock-multisource-table tr:hover {
    background: #fafafa;
}

.livestock-multisource-table tr.is-best {
    background: #f1f8e9;
}

.livestock-multisource-table tr.is-best:hover {
    background: #e8f5e9;
}

.livestock-multisource-table .best-badge {
    color: #f9a825;
    font-size: 14px;
}

.livestock-multisource-table .col-warehouse {
    font-weight: 600;
    word-break: break-word;
}

.livestock-multisource-table .stock-available {
    display: inline-block;
    padding: 2px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    min-width: 28px;
}

.livestock-multisource-table .stock-zero {
    display: inline-block;
    padding: 2px 10px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    min-width: 28px;
}

.livestock-multisource-table .col-express .express-date {
    color: #1976d2;
    font-weight: 600;
    font-size: 12px;
}

.livestock-multisource-table .col-express {
    font-size: 12px;
}

.livestock-multisource-table .backorder-date {
    color: #f57c00;
    font-style: italic;
}

.livestock-multisource-table .backorder-msg {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-instock {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-backorder {
    background: #fff3e0;
    color: #e65100;
}

.status-oos {
    background: #ffebee;
    color: #c62828;
}

/* Error / Empty states */
.livestock-estimate-error,
.livestock-estimate-empty {
    padding: 12px 16px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 4px;
    color: #e65100;
    font-size: 13px;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .livestock-warehouse-stock {
        padding: 12px;
    }

    .livestock-stock-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .livestock-table th,
    .livestock-table td {
        padding: 8px;
        font-size: 12px;
    }

    .table-reserved-stock th,
    .table-reserved-stock td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .table-reserved-stock thead {
        display: none;
    }

    .table-reserved-stock tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
    }

    .table-reserved-stock tbody td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #f0f0f0;
    }

    .table-reserved-stock tbody td:before {
        content: attr(data-th);
        font-weight: 600;
        margin-right: 10px;
    }

    .table-reserved-stock tbody td:last-child {
        border-bottom: none;
    }

    /* Multi-Source Table responsive */
    .best-estimate-body {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .best-stock {
        text-align: left;
    }

    .livestock-multisource-table thead {
        display: none;
    }

    .livestock-multisource-table tbody tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 10px;
    }

    .livestock-multisource-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .livestock-multisource-table tbody td:before {
        content: attr(data-th);
        font-weight: 600;
        color: #666;
        font-size: 12px;
    }

    .livestock-multisource-table tbody td:last-child {
        border-bottom: none;
    }

    .livestock-plz-form {
        flex-direction: column;
    }

    .livestock-plz-input {
        flex: 1;
    }

    /* Cart delivery responsive */
    .lcd-header {
        flex-wrap: wrap;
    }

    .lcd-split-badge {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .lcd-items-table thead { display: none; }

    .lcd-items-table tbody tr {
        display: block;
        margin-bottom: 8px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 8px;
    }

    .lcd-items-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .lcd-items-table tbody td:before {
        content: attr(data-th);
        font-weight: 600;
        color: #666;
        font-size: 12px;
    }

    .lcd-items-table tbody td:last-child { border-bottom: none; }

    .lcd-footer {
        flex-direction: column;
        text-align: center;
    }

    .lcd-footer-right { text-align: center; }

    .lcd-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .lcd-item-status {
        align-items: flex-start;
        margin-top: 4px;
    }

    /* Checkout delivery responsive */
    .lcd-checkout-item {
        flex-direction: column;
        gap: 4px;
    }

    .lcd-checkout-item-right {
        text-align: left;
    }
}
