/* ============================================
   POP-UP STYLES
   ============================================ */

/* Overlay */
.wpip-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: wpipFadeIn 0.2s ease-out;
}

@keyframes wpipFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Container */
.wpip-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wpipSlideUp 0.3s ease-out;
}

@keyframes wpipSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Popup Header */
.wpip-popup-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.wpip-popup-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

.wpip-popup-header p {
    margin: 4px 0 0;
    font-size: 14px;
    color: #6b7280;
}

.wpip-popup-close {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wpip-popup-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Popup Body */
.wpip-popup-body {
    padding: 24px;
}

/* Product Card */
.wpip-product-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.wpip-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.wpip-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px;
}

.wpip-product-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.wpip-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #3b82f6;
    min-width: 72px;
    text-align: right;
}

.wpip-tier-list {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.wpip-tier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
}

.wpip-tier-item strong {
    color: #111827;
    font-weight: 700;
    white-space: nowrap;
}

.wpip-tier-active {
    border-color: #01735c;
    background: #ecfdf5;
    color: #01735c;
}

.wpip-premium-popup {
    max-width: 440px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.16);
    max-height: calc(100vh - 24px);
}

.wpip-premium-popup-card {
    position: relative;
    padding: 20px 28px;
}

.wpip-premium-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 1px solid #ff4b2f;
    background: #fff;
    color: #ff4b2f;
    width: 28px;
    height: 28px;
}

.wpip-premium-close:hover {
    background: #fff5f2;
    color: #ff4b2f;
}

.wpip-premium-heading h3 {
    margin: 0 42px 0 0;
    color: #444;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 700;
}

.wpip-premium-section-title {
    margin: 18px 0 8px;
    color: #444;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.wpip-premium-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin: 0;
}

.wpip-premium-feature-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: #444;
    font-size: 13px;
    line-height: 1.1;
}

.wpip-premium-feature-list li i {
    color: #2fc926;
    font-size: 16px;
}

.wpip-premium-purchase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    background: transparent;
}

.wpip-premium-unit-price {
    color: #3f3f3f;
    font-size: 16px;
    min-width: 0;
    text-align: left;
}

.wpip-premium-quantity {
    margin: 0;
}

.wpip-premium-quantity .wpip-quantity-label {
    color: #444;
    font-size: 16px;
    font-weight: 700;
}

.wpip-premium-quantity .wpip-quantity-buttons {
    border-color: #aaa;
    border-radius: 4px;
    flex: 0 0 auto;
}

.wpip-premium-quantity .wpip-qty-btn {
    width: 34px;
    height: 34px;
    background: #fff;
    color: #555;
    font-size: 16px;
}

.wpip-premium-quantity .wpip-qty-input {
    width: 68px;
    height: 34px;
    color: #666;
    font-size: 14px;
    border-left: 0;
    border-right: 0;
}

.wpip-premium-tier-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.wpip-premium-tier-list .wpip-tier-item {
    width: auto;
    justify-content: center;
    gap: 4px;
    min-height: 30px;
    padding: 6px 11px;
    border-color: #ddd;
    color: #444;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.wpip-premium-tier-list .wpip-tier-item strong {
    color: inherit;
    font-weight: 700;
}

.wpip-premium-tier-list .wpip-tier-active {
    border-color: #b8eadf;
    background: #e6fbf5;
    color: #007f67;
}

.wpip-premium-total-section {
    background: transparent;
    margin: 18px 0 20px;
    padding: 0;
    border-radius: 0;
    display: block;
}

.wpip-premium-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    text-align: right;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ff631014;
}

.wpip-premium-total-section .wpip-total-label {
    color: #444;
    text-align: left;
}

.wpip-premium-total-section .wpip-total-label strong {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.wpip-premium-total-section .wpip-total-label small {
    color: #666;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.wpip-premium-total-section .wpip-total-amount {
    color: #444;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

.wpip-premium-footer {
    padding: 0;
    border-top: 0;
    justify-content: center;
}

.wpip-premium-footer .wpip-premium-pay-btn {
    flex: 0 1 260px;
    min-height: 50px;
    border-radius: 5px;
    background: #ff5a14;
    color: #fff;
    font-size: 20px;
}

.wpip-premium-footer .wpip-premium-pay-btn:hover:not(:disabled) {
    background: #f04f0f;
}

/* Quantity Control */
.wpip-quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpip-quantity-label {
    font-size: 14px;
    color: #6b7280;
}

.wpip-quantity-buttons {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.wpip-qty-btn {
    background: #f9fafb;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
    transition: background 0.2s;
}

.wpip-qty-btn:hover {
    background: #e5e7eb;
}

.wpip-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpip-qty-input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    height: 36px;
    font-size: 14px;
    font-weight: 600;
}

.wpip-qty-input:focus {
    outline: none;
}

/* Total Section */
.wpip-total-section {
    background: #eff6ff;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpip-total-label {
    font-size: 14px;
    color: #1e40af;
    font-weight: 500;
}

.wpip-total-label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #3b82f6;
}

.wpip-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1e40af;
}

.wpip-premium-total-section {
    display: block;
    background: transparent;
    padding: 0;
    margin: 18px 0 20px;
    border-radius: 0;
}

.wpip-premium-total-section .wpip-premium-purchase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    background: transparent;
}

.wpip-premium-total-section .wpip-premium-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ff631014;
}

.wpip-premium-total-section .wpip-total-label {
    color: #444;
    text-align: left;
}

.wpip-premium-total-section .wpip-total-label small {
    display: inline;
    margin-top: 0;
    color: #666;
}

.wpip-premium-total-section .wpip-total-amount {
    color: #444;
    text-align: right;
    margin-left: auto;
    white-space: nowrap;
}

/* Popup Footer */
.wpip-popup-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.wpip-popup-footer .wpip-btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
}

/* Itinerary Info (untuk perpanjangan) */
.wpip-itinerary-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.wpip-itinerary-info strong {
    display: block;
    color: #92400e;
    margin-bottom: 4px;
}

.wpip-itinerary-info small {
    color: #78350f;
    font-size: 13px;
}

/* Feature List */
.wpip-feature-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.wpip-feature-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.wpip-feature-list li i {
    color: #10b981;
    font-size: 18px;
}

/* ============================================
   AUTOSAVE INDICATOR
   ============================================ */
.wpip-autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: wpipSlideIn 0.3s ease-out;
}

@keyframes wpipSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wpip-autosave-indicator i {
    font-size: 16px;
}

.wpip-autosave-indicator.saving i {
    animation: spin 1s linear infinite;
}

.wpip-autosave-indicator.saved i {
    color: #10b981;
}

.wpip-autosave-indicator.error i {
    color: #ef4444;
}

.wpip-premium-feature-list li {
    gap: 6px;
    padding: 2px 0;
    color: #444;
    font-size: 13px;
}

.wpip-premium-feature-list li i {
    color: #2fc926;
    font-size: 16px;
}

@media (max-width: 640px) {
    .wpip-popup-overlay {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .wpip-premium-popup {
        max-width: 100%;
        margin: 0;
        max-height: calc(100vh - 24px);
    }

    .wpip-premium-popup-card {
        padding: 18px 14px 18px;
    }

    .wpip-premium-close {
        top: 16px;
        right: 16px;
    }

    .wpip-premium-heading h3 {
        margin-right: 38px;
        font-size: 22px;
    }

    .wpip-premium-section-title {
        margin: 14px 0 7px;
        font-size: 13px;
    }

    .wpip-premium-feature-list li,
    .wpip-premium-quantity .wpip-quantity-label,
    .wpip-premium-tier-list .wpip-tier-item {
        font-size: 12px;
    }

    .wpip-premium-feature-list {
        gap: 6px;
        margin: 0;
    }

    .wpip-premium-feature-list li {
        gap: 5px;
        padding: 2px 0;
    }

    .wpip-premium-purchase-row {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 10px;
    }

    .wpip-premium-quantity {
        justify-content: flex-end;
        gap: 8px;
    }

    .wpip-premium-quantity .wpip-qty-input {
        width: 62px;
    }

    .wpip-premium-tier-list {
        gap: 6px;
    }

    .wpip-premium-total-section {
        margin: 16px 0 18px;
    }

    .wpip-premium-total-section .wpip-premium-total-row {
        padding: 11px 12px;
    }

    .wpip-premium-total-section .wpip-total-label strong,
    .wpip-premium-total-section .wpip-total-amount {
        font-size: 16px;
    }

    .wpip-premium-total-section .wpip-total-label small {
        font-size: 12px;
    }

    .wpip-premium-footer .wpip-premium-pay-btn {
        flex-basis: 100%;
        width: 100%;
        min-height: 48px;
        font-size: 18px;
    }
}
