/**
 * Product Delivery Modal Styles
 * Based on pspopup module style
 */

/* Overlay - ciemny, na środku */
.delivery-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.delivery-modal-overlay.delivery-modal-active {
    display: flex !important;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* Container - modal na środku */
.delivery-modal-container {
    position: relative;
    pointer-events: auto;
    animation: delivery-modal-fade-in 0.3s ease-out;
    background-color: #ffffff;
    color: #000000;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

@keyframes delivery-modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delivery-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #000;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-modal-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.delivery-modal-close svg {
    width: 16px;
    height: 16px;
}

.delivery-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.delivery-modal-header {
    padding: 32px 32px 0 32px;
    flex-shrink: 0;
}

.delivery-modal-title {
    color: #000;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 36px;
    margin: 0 0 16px 0;
}

.delivery-modal-description {
    color: #666;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    margin-bottom: 24px;
}

.delivery-modal-description p {
    margin: 0 0 8px 0;
}

.delivery-modal-description p:last-child {
    margin-bottom: 0;
}

.delivery-modal-content {
    padding: 0 32px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

/* Loading and Empty States */
.productdelivery-loading.delivery-options-loading,
.productdelivery-empty.delivery-options-empty {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
}

.productdelivery-loading.delivery-options-loading.is-visible,
.productdelivery-empty.delivery-options-empty.is-visible {
    display: block;
}

/* Delivery Options List */
.productdelivery-list.delivery-options-list {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.productdelivery-list.delivery-options-list.is-visible {
    display: flex;
}

.productdelivery-list-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-options-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E5E5;
}

.delivery-from-label {
    color: #666;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.delivery-country-name {
    color: #000;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.delivery-change-btn {
    margin-left: auto;
    color: var(--color-brand-one-1-base, #183030);
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.delivery-change-btn:hover {
    text-decoration: underline;
    color: var(--color-brand-one-2-base, #2a4a4a);
}

.delivery-options-back {
    margin-bottom: 8px;
}

.delivery-back-btn {
    color: var(--color-brand-one-1-base, #183030);
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.2s;
}

.delivery-back-btn:hover {
    text-decoration: underline;
    color: var(--color-brand-one-2-base, #2a4a4a);
}

#deliveryOptionsListContent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-option-item {
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.delivery-option-item:hover {
    border-color: #E4FD71;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.delivery-option-item--link {
    cursor: pointer;
}

.delivery-option-item--link:hover {
    border-color: var(--color-brand-one-1-base, #183030);
    background: #fafafa;
}

.delivery-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.delivery-option-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.delivery-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.delivery-option-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.delivery-option-name {
    color: #000;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.delivery-option-price {
    color: #000;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    margin-left: 16px;
}

.delivery-option-price--free {
    color: var(--color-brand-one-4, #6F884C);
}

.delivery-option-delay {
    color: #666;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    margin-top: 4px;
}

.delivery-modal-footer {
    padding: 24px 32px 32px 32px;
    border-top: 1px solid #E5E5E5;
    flex-shrink: 0;
    margin-top: auto;
}

.delivery-modal-footer p {
    margin: 0;
    color: #666;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 12px;
    line-height: 16px;
}

/* Responsive */
@media (max-width: 767px) {
    .delivery-modal-overlay {
        padding: 16px;
    }

    .delivery-modal-container {
        max-width: 100%;
        border-radius: 12px;
        max-height: 95vh;
    }

    .delivery-modal-header {
        padding: 24px 20px 0 20px;
    }

    .delivery-modal-title {
        font-size: 22px;
        line-height: 28px;
    }

    .delivery-modal-content {
        padding: 0 20px;
    }

    .delivery-modal-footer {
        padding: 20px;
    }
}

/* Hide body scroll when modal is open */
body.delivery-modal-open {
    overflow: hidden;
}

/* Delivery Form Styles */
.delivery-form {
    display: block !important;
    padding: 20px 0;
    border-bottom: 1px solid #E5E5E5;
    margin-bottom: 20px;
}

.delivery-options-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.delivery-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.delivery-options-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delivery-options-form label {
    color: #000;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    text-align: left;
}

.delivery-options-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-family: var(--font-family-family-primary, Sora), sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #000;
    background: #fff;
    transition: all 0.2s;
}

.delivery-options-form .form-control:focus {
    outline: none;
    border-color: var(--color-brand-one-1-base, #183030);
    box-shadow: 0 0 0 3px rgba(24, 48, 48, 0.1);
}

.delivery-options-form .form-control::placeholder {
    color: #999;
}

.delivery-options-form label {
    color: #000;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    text-align: left;
}

.delivery-options-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}


/* Info Note */
.productdelivery-info-note.delivery-info-note {
    margin-top: 20px;
    padding: 12px;
    background-color: transparent;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.productdelivery-info-note.delivery-info-note .productdelivery-info-note-text {
    display: block;
    margin-top: 1px;
    color: #888;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
}

.productdelivery-error-message.delivery-error-message {
    font-size: 12px;
    color: #999;
}

@media (max-width: 767px) {
    .delivery-form {
        padding: 16px 0;
    }
    
    .delivery-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

