/**
 * Shop Express Frontend Shipping & Delivery Selector
 */

.se-shipping-wrap {
    margin: 15px 0;
    padding: 12px 16px;
    background: #fbfbfb;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    box-sizing: border-box;
}

.se-shipping-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.se-shipping-label {
    font-weight: 600;
    color: #1e293b;
}

.se-shipping-summary {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.se-shipping-cost {
    font-weight: 700;
    color: #0f172a;
}

.se-shipping-to {
    color: #475569;
}

.se-shipping-via {
    color: #64748b;
}

.se-shipping-trigger {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.se-shipping-trigger:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.se-shipping-alert {
    color: #dc2626;
    font-weight: 600;
}

.se-shipping-delivery-date {
    margin-top: 4px;
    font-size: 13px;
    color: #059669;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.se-shipping-origin-select {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.se-origin-picker {
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    cursor: pointer;
}

/* Modal Popup */
.se-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.se-modal-backdrop.se-modal-active {
    opacity: 1;
    visibility: visible;
}

.se-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(15px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.se-modal-backdrop.se-modal-active .se-modal-dialog {
    transform: translateY(0);
}

.se-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.se-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.se-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.se-modal-close:hover {
    color: #0f172a;
}

.se-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.se-modal-field {
    margin-bottom: 20px;
}

.se-modal-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 8px;
}

.se-country-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    color: #0f172a;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.se-country-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.se-modal-section-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 12px;
}

.se-methods-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.se-methods-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.se-methods-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.se-methods-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.se-methods-table tr:last-child td {
    border-bottom: none;
}

.se-methods-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.se-methods-table tbody tr:hover {
    background-color: #f8fafc;
}

.se-methods-table tbody tr.se-row-selected {
    background-color: #eff6ff;
}

.se-col-radio {
    width: 32px;
    text-align: center;
}

.se-col-radio input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.se-tracking-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.se-tracking-badge.se-tracking-yes {
    background: #dcfce7;
    color: #15803d;
}

.se-free-cost {
    font-weight: 700;
    color: #15803d;
}

.se-methods-loading {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.se-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: se-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

.se-not-shippable-notice {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.se-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.se-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.se-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.se-btn-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.se-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.se-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

@media (max-width: 600px) {
    .se-modal-dialog {
        max-width: 100%;
        margin: 10px;
    }
    .se-methods-table th, .se-methods-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}
