/* --- SCOPED CSS FOR SELECT PURCHASED PRODUCTS PAGE --- */
.spp-wrapper {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin-bottom: 32px;
}

/* ── Page Header ── */
.spp-page-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.spp-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #1F2937;
    text-decoration: none;
    font-size: 18px;
    border-radius: 6px;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

    .spp-back-btn:hover {
        background-color: #F3F4F6;
    }

.spp-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.spp-page-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* ── Top Grid (Dealer + Progress) ── */
.spp-top-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

/* ── Dealer Card ── */
.spp-dealer-card {
    background: linear-gradient(135deg, #FAFFFB 0%, #ECFDF5 100%);
    border-right-color: darkgreen !important;
    border-right-width: 4px !important; 
    border: 1px solid #86EFAC;
    border-radius: 12px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spp-dealer-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.spp-dealer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.spp-dealer-info {
    flex: 1;
    min-width: 0;
}

    .spp-dealer-info h3 {
        font-size: 15px;
        font-weight: 700;
        color: #166534;
        margin: 0 0 8px 0;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }

.spp-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #D8F5E3;
    color: #059669;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border: 1px solid #A7F3D0;
}

    .spp-verified-badge i {
        font-size: 11px;
    }

.spp-dealer-address {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    margin-top: 12px;
    word-break: break-word;
}

    .spp-dealer-address i {
        color: #374151;
    }

.spp-contact-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.spp-contact-box {
    /* Very light green background fill matching the reference image */
    background-color: #F4FAF7;
    /* Soft border tint */
    border: 1px solid #D1E7DD;
    border-radius: 6px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2D3748;
    font-weight: 500;
    /* Keeps boxes identical or flexible */
    flex: 1;
}

.spp-contact-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #D1E7DD;
    padding-right: 10px;
    height: 100%;
}

.spp-contact-box i {
    color: #4A5568;
    font-size: 16px;
    flex-shrink: 0;
}


/* ── Progress Card ── */
.spp-progress-card {
    background-color: #166534;
    color: #FFFFFF;
    border-radius: 12px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    min-height: 200px;
    box-shadow: 0 4px 6px -1px rgba(22, 101, 52, 0.2);
}

.spp-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

    .spp-progress-head h4 {
        font-size: 14px;
        font-weight: 600;
        margin: 0;
    }

.spp-progress-trend {
    font-size: 11px;
    color: #A7F3D0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.spp-progress-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin-top: 8px;
}

.spp-progress-subtitle {
    font-size: 12px;
    color: #BBF7D0;
}

.spp-progress-track {
    height: 6px;
    background-color: #14532D;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 8px;
}

.spp-progress-fill {
    height: 100%;
    background-color: #A7F3D0;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.spp-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #A7F3D0;
    margin-top: 4px;
}

/* ── Products Section ── */
.spp-products-card {
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px 22px;
}

.spp-products-title {
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 16px 0;
}

.spp-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.spp-product-card {
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    padding: 10px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .spp-product-card:hover {
        border-color: #D1D5DB;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

.spp-product-image-area {
    position: relative;
    background-color: #FEF3C7;
    border-radius: 8px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

    .spp-product-image-area img {
        max-height: 90px;
        object-fit: contain;
        z-index: 1;
        filter: hue-rotate(320deg) brightness(1.2);
    }

    .spp-product-image-area::before {
        content: '';
        position: absolute;
        width: 80px;
        height: 80px;
        background-color: rgba(255, 255, 255, 0.4);
        border-radius: 50%;
        filter: blur(20px);
        z-index: 0;
    }

.spp-product-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #FFFFFF;
    color: #16A34A;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    border: 1px solid #DCFCE7;
}

.spp-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.spp-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.spp-qty-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.spp-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 3px;
}

.spp-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}

.spp-qty-plus {
    background-color: #3B82F6;
    color: #FFFFFF;
}

    .spp-qty-plus:hover {
        background-color: #2563EB;
    }

.spp-qty-minus {
    background-color: #FFFFFF;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

    .spp-qty-minus:hover {
        color: #1F2937;
        background-color: #F9FAFB;
    }

.spp-qty-value {
    font-size: 13px;
    font-weight: 700;
    color: #1F2937;
    min-width: 14px;
    text-align: center;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1280px) {
    .spp-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .spp-top-grid {
        grid-template-columns: 1fr;
    }

    .spp-progress-card {
        min-height: auto;
    }

    .spp-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .spp-page-title {
        font-size: 16px;
    }

    .spp-contact-row {
        grid-template-columns: 1fr;
    }

    .spp-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spp-dealer-card,
    .spp-progress-card,
    .spp-products-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .spp-product-grid {
        grid-template-columns: 1fr;
    }

    .spp-dealer-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .spp-dealer-info h3 {
        font-size: 14px;
    }

    .spp-dealer-address {
        justify-content: center;
        text-align: center;
    }
}
