/**
 * Shipment Request - Frontend CSS
 *
 * Styles for the "Request Shipment" button, preview modal, and notices.
 * Follows existing YYD theme patterns and shelf-qty-return modal styles.
 *
 * @package YID
 * @version 1.0.0
 */

/* === Button === */
#yyd-request-shipment-btn {
    font-weight: 600;
    letter-spacing: 0.02em;
}

#yyd-request-shipment-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Notices === */
.yid-sr-notice {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 3px;
    font-size: 0.85em;
    line-height: 1.4;
}

.yid-sr-notice-error {
    color: #c0392b;
    background: #fdf0ef;
    border: 1px solid #f5c6cb;
}

.yid-sr-notice-success {
    color: #27ae60;
    background: #eafaf1;
    border: 1px solid #a3d9a5;
}

/* === Modal Overlay === */
.yid-sr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Modal Card === */
.yid-sr-modal {
    background: #fff;
    border-radius: 4px;
    padding: 28px;
    max-width: 640px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.yid-sr-title {
    margin: 0 0 20px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #1a1a1a;
}

/* === Table === */
.yid-sr-table-wrap {
    overflow-y: auto;
    max-height: 50vh;
    margin-bottom: 20px;
}

.yid-sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.yid-sr-table thead th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #1a1a1a;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.yid-sr-table tbody tr {
    border-bottom: 1px solid #eee;
}

.yid-sr-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.yid-sr-table tbody td {
    padding: 8px 10px;
    vertical-align: middle;
}

.yid-sr-td-product {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yid-sr-td-qty,
.yid-sr-td-total {
    text-align: right;
    white-space: nowrap;
}

.yid-sr-table thead th:nth-child(2),
.yid-sr-table thead th:nth-child(3) {
    text-align: right;
}

.yid-sr-partial {
    display: inline-block;
    font-size: 0.8em;
    color: #e67e22;
    margin-left: 4px;
}

/* === Footer === */
.yid-sr-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.yid-sr-summary {
    font-size: 0.95em;
    color: #333;
}

.yid-sr-actions {
    display: flex;
    gap: 10px;
}

.yid-sr-actions .button {
    min-width: 100px;
    text-align: center;
}

.yid-sr-confirm {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
}

.yid-sr-confirm:hover {
    background: #333 !important;
}

.yid-sr-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Responsive === */
@media (max-width: 600px) {
    .yid-sr-modal {
        width: 96%;
        padding: 20px;
        max-height: 90vh;
    }

    .yid-sr-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .yid-sr-actions {
        justify-content: stretch;
    }

    .yid-sr-actions .button {
        flex: 1;
    }

    .yid-sr-td-product {
        max-width: 180px;
    }
}

/* === Dashboard Widgets === */
.yyd-dashboard-shipping-widget,
.yyd-dashboard-stocklist-widget {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.yyd-dashboard-shipping-widget h3,
.yyd-dashboard-stocklist-widget h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.2em;
}

.yyd-dashboard-stock-info {
    font-size: 1.05em;
    margin-bottom: 12px;
}

.yyd-dashboard-items-details {
    margin-bottom: 16px;
}

.yyd-dashboard-items-details summary {
    cursor: pointer;
    color: #2271b1;
    margin-bottom: 8px;
}

.yyd-dashboard-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.yyd-dashboard-items-table th,
.yyd-dashboard-items-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e4e7;
    vertical-align: middle;
}

.yyd-dashboard-items-table .yyd-col-thumb {
    width: 40px;
    padding: 4px 6px;
}

.yyd-dashboard-items-table .yyd-col-thumb img {
    width: 36px;
    height: 36px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    max-width: none;
}

.yyd-dashboard-items-table th {
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.yyd-dashboard-threshold-notice {
    color: #996800;
    font-size: 0.9em;
    margin-top: 8px;
}

.yyd-dashboard-no-stock {
    color: #666;
    font-style: italic;
}

.yyd-dashboard-preorder-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e4e7;
}

.yyd-dashboard-preorder-summary h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
}

/* Stocklist buttons */
.yyd-stocklist-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .yyd-stocklist-buttons {
        flex-direction: column;
    }

    .yyd-dashboard-items-table {
        font-size: 0.8em;
    }
}
