/* ═══════════════════════════════════════════════════════
   PARFUMILYA DZ Shipping — Checkout CSS
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* ── Wrapper ── */
.pfly-dz-wrapper {
    margin: 0 0 20px;
}

/* ── Field Group ── */
.pfly-field-group {
    margin-bottom: 16px;
    position: relative;
}

/* ── Label ── */
.pfly-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 7px;
    letter-spacing: .2px;
}
.pfly-label abbr {
    color: #D91F2B;
    border: none;
    text-decoration: none;
    margin-left: 2px;
}

/* ── Select ── */
.pfly-select-wrap {
    position: relative;
}

.pfly-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 42px 12px 14px;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #111111;
    cursor: pointer;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.pfly-select:disabled {
    background: #FAF7F2;
    color: #999999;
    cursor: not-allowed;
    border-color: #EAEAEA;
}
.pfly-select:focus {
    border-color: #D91F2B;
    box-shadow: 0 0 0 3px rgba(217,31,43,.1);
}
.pfly-select:hover:not(:disabled) {
    border-color: #cccccc;
}

.pfly-select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #777777;
    display: flex;
    align-items: center;
}
.pfly-select-icon svg {
    width: 16px;
    height: 16px;
}

/* ── Delivery Options ── */
.pfly-delivery-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.pfly-delivery-card {
    border: 2px solid #EAEAEA;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all .2s ease;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.pfly-delivery-card:hover {
    border-color: #F5E6E8;
    background: #FFF8F8;
}
.pfly-delivery-card.active {
    border-color: #D91F2B;
    background: #FFF1F1;
}

.pfly-delivery-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pfly-delivery-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #FAF7F2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s ease;
}
.pfly-delivery-icon svg {
    width: 18px;
    height: 18px;
    color: #777777;
    transition: color .2s ease;
}

.pfly-delivery-card.active .pfly-delivery-icon {
    background: #F5E6E8;
}
.pfly-delivery-card.active .pfly-delivery-icon svg {
    color: #D91F2B;
}

.pfly-delivery-info {
    flex: 1;
    min-width: 0;
}
.pfly-delivery-label {
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    display: block;
    margin-bottom: 2px;
}
.pfly-delivery-price {
    font-size: 13px;
    font-weight: 500;
    color: #D91F2B;
}

.pfly-delivery-check {
    width: 20px;
    height: 20px;
    border: 2px solid #EAEAEA;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s ease;
}
.pfly-delivery-card.active .pfly-delivery-check {
    background: #D91F2B;
    border-color: #D91F2B;
}
.pfly-delivery-check svg {
    width: 10px;
    height: 10px;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity .2s ease;
}
.pfly-delivery-card.active .pfly-delivery-check svg {
    opacity: 1;
}

/* ── Delivery Summary Badge ── */
.pfly-delivery-summary {
    margin-top: 8px;
}
.pfly-delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
}
.pfly-delivery-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Loading state ── */
.pfly-select.pfly-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D91F2B' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    animation: pflyRotate .8s linear infinite;
}

@keyframes pflyRotate {
    to { background-position: right 14px center; }
}

/* ── WooCommerce notices integration ── */
.pfly-dz-wrapper + .woocommerce-invalid .pfly-select {
    border-color: #D91F2B;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .pfly-delivery-options {
        grid-template-columns: 1fr;
    }
}
