/**
 * APD Deposit Pro - Public Styles
 */

/* ============================================
   Payment Plan Selector (Product Page)
   ============================================ */
.apd-payment-plan-selector {
    margin: 14px 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.apd-plan-selector-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border-bottom: 1px solid #e9d5ff;
    font-size: 14px;
    font-weight: 600;
    color: #581c87;
}
.apd-plan-options {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Radio option */
.apd-plan-radio-option {
    display: block;
    cursor: pointer;
    margin: 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all .2s ease;
}
.apd-plan-radio-option:hover {
    border-color: #c7d2fe;
}
.apd-plan-radio-option input[type="radio"] {
    display: none;
}
.apd-plan-radio-option input:checked ~ .apd-plan-radio-content {
    border-color: transparent;
}
.apd-plan-radio-option input:checked ~ .apd-plan-radio-content,
.apd-plan-radio-option input:checked ~ .apd-plan-schedule-preview {
    background: #eef2ff;
}
.apd-plan-radio-option input:checked ~ .apd-plan-radio-content .apd-plan-radio-circle {
    border-color: #6366f1;
}
.apd-plan-radio-option input:checked ~ .apd-plan-radio-content .apd-plan-radio-circle::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* When checked, show outer border */
.apd-plan-radio-option:has(input:checked) {
    border-color: #6366f1;
}

.apd-plan-radio-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.apd-plan-radio-circle {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all .15s;
}
.apd-plan-radio-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.apd-plan-radio-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.apd-plan-radio-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.apd-plan-radio-toggle {
    width: 10px;
    height: 10px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform .2s ease, border-color .2s ease;
    flex-shrink: 0;
    margin-right: 4px;
}
.apd-plan-radio-desc {
    font-size: 12px;
    color: #94a3b8;
}

/* Schedule preview */
.apd-plan-schedule-preview {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 16px;
    transition: max-height .28s ease, opacity .2s ease, padding .2s ease;
}
.apd-plan-radio-option input:checked ~ .apd-plan-schedule-preview {
    max-height: 320px;
    opacity: 1;
    padding: 0 16px 14px;
}
.apd-plan-radio-option input:checked ~ .apd-plan-radio-content .apd-plan-radio-toggle {
    transform: rotate(225deg);
    border-color: #6366f1;
}
.apd-plan-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 8px 36px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}
.apd-plan-schedule-item:last-child {
    border-bottom: none;
}
.apd-plan-item-amount {
    font-weight: 600;
    color: #334155;
}
.apd-plan-item-amount small {
    font-weight: 400;
    color: #94a3b8;
    margin-left: 4px;
}
.apd-plan-item-due {
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   Old Plan Info (keep backwards compat)
   ============================================ */
.apd-payment-plan-info {
    margin: 8px 0 0;
    padding: 12px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.apd-plan-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    color: #92400e;
}
.apd-plan-header .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.apd-plan-details {
    font-size: 13px;
}
.apd-plan-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #78350f;
}
.apd-plan-option input[type="checkbox"] {
    margin: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .apd-plan-schedule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding-left: 0;
    }
}
