/* Modern Delivery Check Widget - Product Page */
.delivery-check-container {
    background: var(--wp--preset--color--background, inherit);
    border: 1px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: var(--wp--custom--border-radius, 8px);
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--wp--custom--shadow, 0 1px 3px rgba(0, 0, 0, 0.1));
    font-family: inherit;
}

.delivery-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.delivery-icon {
    width: 32px;
    height: 32px;
    background: var(--wp--preset--color--primary, currentColor);
    border-radius: var(--wp--custom--border-radius-small, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--background, #fff);
    flex-shrink: 0;
}

.delivery-icon svg {
    width: 18px;
    height: 18px;
}

.delivery-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--wp--preset--color--text, inherit);
    margin: 0;
    line-height: 1.3;
}

.delivery-input-group {
    margin-bottom: 16px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.delivery-pincode-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: var(--wp--custom--border-radius-small, 8px);
    font-size: 16px;
    color: var(--wp--preset--color--text, inherit);
    background: var(--wp--preset--color--background, inherit);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.delivery-pincode-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, currentColor);
    box-shadow: 0 0 0 3px var(--wp--preset--color--primary-light, rgba(0, 0, 0, 0.1));
}

.delivery-pincode-input::placeholder {
    color: var(--wp--preset--color--text-light, rgba(0, 0, 0, 0.5));
}

.delivery-check-btn {
    background: var(--wp--preset--color--primary, currentColor);
    color: var(--wp--preset--color--background, #fff);
    border: none;
    border-radius: var(--wp--custom--border-radius-small, 8px);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 48px;
    position: relative;
}

.delivery-check-btn:hover {
    background: var(--wp--preset--color--primary-dark, var(--wp--preset--color--primary, currentColor));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--wp--preset--color--primary-shadow, rgba(0, 0, 0, 0.2));
}

.delivery-check-btn:active {
    transform: translateY(0);
}

.delivery-check-btn:disabled {
    background: var(--wp--preset--color--disabled, #888);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    display: block;
}

.delivery-check-btn:disabled .btn-text {
    display: none;
}

.btn-spinner {
    display: none;
}

.delivery-check-btn:disabled .btn-spinner {
    display: block;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--wp--preset--color--spinner-track, rgba(255, 255, 255, 0.3));
    border-radius: 50%;
    border-top-color: var(--wp--preset--color--background, #fff);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.delivery-result {
    display: none;
    background: var(--wp--preset--color--surface-light, rgba(0, 0, 0, 0.03));
    border-radius: var(--wp--custom--border-radius-small, 8px);
    padding: 16px;
    margin-top: 16px;
    border-left: 4px solid;
    align-items: flex-start;
    gap: 12px;
}

.delivery-result.success {
    border-left-color: var(--wp--preset--color--success, #090);
    background: var(--wp--preset--color--success-bg, var(--wp--preset--color--surface-light, rgba(0, 0, 0, 0.03)));
}

.delivery-result.success.show {
    display: flex !important;
}

.delivery-result.error {
    border-left-color: var(--wp--preset--color--error, #c00);
    background: var(--wp--preset--color--error-bg, var(--wp--preset--color--surface-light, rgba(0, 0, 0, 0.03)));
}

.delivery-result.error.show {
    display: flex !important;
}

.result-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-icon.success {
    background: var(--wp--preset--color--success-light, rgba(0, 153, 0, 0.1));
    color: var(--wp--preset--color--success, #090);
}

.result-icon.error {
    background: var(--wp--preset--color--error-light, rgba(204, 0, 0, 0.1));
    color: var(--wp--preset--color--error, #c00);
}

.result-icon svg {
    width: 14px;
    height: 14px;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.delivery-status {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.delivery-result.success .delivery-status {
    color: var(--wp--preset--color--success, #090);
}

.delivery-result.error .delivery-status {
    color: var(--wp--preset--color--error, #c00);
}

.delivery-eta {
    font-size: 15px;
    font-weight: 500;
    color: var(--wp--preset--color--primary, inherit);
    margin-bottom: 4px;
}

.delivery-note {
    font-size: 14px;
    color: var(--wp--preset--color--text-light, rgba(0, 0, 0, 0.5));
    line-height: 1.4;
}

/* Default Info Message */
.delivery-info-default {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--wp--preset--color--surface-light, rgba(0, 0, 0, 0.03));
    border-radius: var(--wp--custom--border-radius-small, 8px);
    border-left: 4px solid var(--wp--preset--color--neutral, #888);
    margin-top: 16px;
}

.info-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    background: var(--wp--preset--color--neutral-light, rgba(0, 0, 0, 0.1));
    color: var(--wp--preset--color--neutral, #888);
}

.info-icon svg {
    width: 14px;
    height: 14px;
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--wp--preset--color--heading, inherit);
    margin-bottom: 2px;
    line-height: 1.3;
}

.info-text {
    font-size: 14px;
    color: var(--wp--preset--color--text-light, rgba(0, 0, 0, 0.5));
    line-height: 1.4;
}

/* Tracking button styles in My Account > Orders */
.woocommerce-orders-table__cell-order-actions .button.track {
    background-color: var(--wp--preset--color--primary, #4169e1);
    color: white;
    margin-left: 5px;
}

.woocommerce-orders-table__cell-order-actions .button.track:hover {
    background-color: var(--wp--preset--color--secondary, #2a4cb4);
    color: white;
}

/* Styling for tracking section in order details */
.woocommerce-order-tracking {
    margin-top: 2em;
    padding: 1.5em;
    background-color: var(--wp--preset--color--background, #f7f7f7);
    border-radius: var(--wp--custom--border-radius, 8px);
    border: 1px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
}

.woocommerce-order-tracking h2 {
    margin-top: 0;
    font-size: 1.5em;
    color: var(--wp--preset--color--heading, inherit);
}

.delhivery-tracking-details {
    margin-top: 1em;
}

.delhivery-tracking-details p {
    margin-bottom: 0.75em;
}

.delhivery-tracking-details .button {
    margin: 0.5em 0.5em 0.5em 0;
    padding: 0.5em 1em;
}

/* Admin tracking info styles */
.delhivery-tracking-info {
    margin-top: 1em;
    padding: 1em;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.delhivery-tracking-info h4 {
    margin-top: 0;
    margin-bottom: 0.75em;
    font-size: 14px;
}

.delhivery-tracking-info p {
    margin-bottom: 0.5em;
}

.delhivery-tracking-info .button.button-primary {
    background-color: #4169e1;
    border-color: #4169e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .delivery-check-container {
        padding: 20px;
        margin: 20px 0;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .delivery-check-btn {
        width: 100%;
    }
    
    .delivery-title {
        font-size: 16px;
    }
    
    .delivery-pincode-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Integration with WooCommerce themes */
.woocommerce div.product .delivery-check-container {
    margin-top: 20px;
}

/* Focus states for accessibility */
.delivery-check-container *:focus {
    outline: 2px solid var(--wp--preset--color--primary, currentColor);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .delivery-check-container {
        border-color: currentColor;
    }
    
    .delivery-pincode-input {
        border-color: currentColor;
    }
    
    .delivery-check-btn {
        background: currentColor;
        color: var(--wp--preset--color--background, #fff);
    }
}


