/* Price Comparison Pro - Frontend Styles */

/* ========== Compare Button ========== */
.pcp-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 10px 0;
    padding: 9px 18px;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pcp-open-btn:hover {
    background: linear-gradient(135deg, #0284c7, #0891b2);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.pcp-btn-icon { font-size: 15px; }

/* ========== Modal Overlay ========== */
.pcp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: pcp-fadeIn 0.25s ease;
}

@keyframes pcp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pcp-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: pcp-slideUp 0.3s ease;
}

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

/* ========== Modal Header ========== */
.pcp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.pcp-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.pcp-modal-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.pcp-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pcp-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ========== Our Price Banner ========== */
.pcp-our-price-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 24px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.pcp-our-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcp-our-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pcp-our-name {
    font-weight: 700;
    font-size: 15px;
    color: #166534;
}

.pcp-our-price-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcp-our-price {
    font-weight: 800;
    font-size: 22px;
    color: #16a34a;
}

.pcp-best-badge {
    background: #22c55e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

/* ========== Product Cards Grid ========== */
.pcp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 8px 24px 20px;
}

.pcp-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
}

.pcp-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Card Tag (e.g. "36% OFF") */
.pcp-card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #22c55e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
}

/* Card Image */
.pcp-card-image {
    width: 100%;
    height: 160px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pcp-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Card Body */
.pcp-card-body {
    padding: 12px;
}

.pcp-card-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price Row */
.pcp-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.pcp-card-price {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
}

.pcp-card-old-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}

/* Store Row */
.pcp-card-store-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.pcp-card-store-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pcp-card-store-logo {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: contain;
}

.pcp-card-store-name {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Rating */
.pcp-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.pcp-card-stars {
    font-size: 12px;
    color: #f59e0b;
    letter-spacing: -1px;
}

.pcp-card-reviews {
    font-size: 11px;
    color: #94a3b8;
}

/* Delivery */
.pcp-card-delivery {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* ========== Modal Footer ========== */
.pcp-modal-footer {
    padding: 14px 24px;
    background: linear-gradient(90deg, #f0fdf4, #dcfce7);
    border-top: 1px solid #bbf7d0;
    color: #166534;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 0 0 16px 16px;
}

.pcp-modal-footer strong {
    font-weight: 700;
    color: #15803d;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .pcp-modal {
        max-height: 90vh;
        border-radius: 12px;
    }

    .pcp-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 8px 16px 16px;
    }

    .pcp-card-image {
        height: 120px;
    }

    .pcp-modal-header {
        padding: 16px;
    }

    .pcp-our-price-banner {
        margin: 12px 16px;
        padding: 12px 14px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .pcp-our-price {
        font-size: 20px;
    }
}

@media (max-width: 380px) {
    .pcp-cards-grid {
        grid-template-columns: 1fr;
    }
}
