/**
 * Phone Exchange — PhoneCard Component Styles
 *
 * 1:1 replica of React PhoneCard component styling.
 * Card with image overlay badges, info section, price, and CTA button.
 *
 * @package Phone_Exchange_Child
 * @since   1.0.0
 */

/* ── Card Container ──────────────────────────────────────────── */

.pe-phone-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.pe-phone-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ── Favorites Button (inside image-wrap, bottom-right) ─────── */

.pe-phone-card__fav {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0 !important;
    background: hsla(var(--card), 0.85) !important;
    backdrop-filter: blur(4px);
    border: none !important;
    border-radius: 9999px;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    box-shadow: none !important;
    transition: color 0.15s ease;
}

.pe-phone-card__fav:hover {
    color: hsl(0, 72%, 51%); /* destructive red */
}

.pe-phone-card__fav--active {
    color: hsl(0, 72%, 51%);
}

.pe-phone-card__fav--active svg {
    fill: hsl(0, 72%, 51%);
}

/* ── Link wrapper ────────────────────────────────────────────── */

.pe-phone-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.pe-phone-card__link:hover {
    text-decoration: none;
    color: inherit;
}

/* ── Image Area ──────────────────────────────────────────────── */

.pe-phone-card__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: hsl(var(--muted));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pe-phone-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pe-phone-card:hover .pe-phone-card__img {
    transform: scale(1.05);
}

/* Grade badge – top left */
.pe-phone-card__grade {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    z-index: 5;
}

/* Discount badge – top right */
.pe-phone-card__discount {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    z-index: 5;
}

/* ── Info Area ────────────────────────────────────────────────── */

.pe-phone-card__info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

@media (min-width: 768px) {
    .pe-phone-card__info {
        padding: 1rem;
    }
}

.pe-phone-card__brand {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.pe-phone-card__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    margin: 0;
    color: hsl(var(--foreground));
}

@media (min-width: 768px) {
    .pe-phone-card__name {
        font-size: 1rem;
    }
}

/* Storage · Color row */
.pe-phone-card__specs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.pe-phone-card__dot {
    color: hsl(var(--muted-foreground));
}

/* Battery + Warranty row */
.pe-phone-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.pe-phone-card__meta svg {
    width: 0.875rem;
    height: 0.875rem;
    color: hsl(var(--accent));
    flex-shrink: 0;
}

.pe-phone-card__meta svg + svg {
    margin-left: 0.25rem;
}

/* Store city */
.pe-phone-card__store {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.pe-phone-card__store svg {
    width: 0.75rem;
    height: 0.75rem;
    color: hsl(var(--accent));
    flex-shrink: 0;
}

/* Price row */
.pe-phone-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding-top: 0.25rem;
    margin-top: auto; /* push to bottom of flex column */
}

.pe-phone-card__price {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: hsl(var(--foreground));
}

.pe-phone-card__original-price {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-decoration: line-through;
}

/* CTA button */
.pe-phone-card__btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Condition Badge utility classes ─────────────────────────── */
/* (These may also be in design-system.css but ensure they're here) */

.condition-badge-excellent {
    background: hsl(var(--condition-excellent));
    color: hsl(0, 0%, 100%);
}

.condition-badge-good {
    background: hsl(var(--condition-good));
    color: hsl(0, 0%, 15%);
}

.condition-badge-fair {
    background: hsl(var(--condition-fair));
    color: hsl(0, 0%, 15%);
}

/* ── Grade Switcher Pills ─────────────────────────────────────── */

.pe-phone-card__grades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.pe-phone-card__grade-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid hsl(var(--border));
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.pe-phone-card__grade-pill:hover {
    border-color: hsl(var(--accent));
    color: hsl(var(--accent));
}

.pe-phone-card__grade-pill--active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    cursor: default;
    pointer-events: none;
}
