/* =============================================
   Definitive Card Styles (for Blog & Products)
   ============================================= */

.unified-card {
    /* Frosty Glass Effect */
    background-color: rgba(var(--bg-primary-rgb), 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    overflow: hidden;

    /* Flexbox structure for consistent height */
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

/*
 * DEFINITIVE FIX: Force unified-card styles over subject-card-new.
 * When an element has both classes, this rule will completely reset all styles
 * from .subject-card-new and then re-apply the base .unified-card styles.
 * This is necessary to resolve specificity conflicts on the cart page.
*/
.subject-card-new.unified-card {
    all: unset; /* Annihilate all styles from .subject-card-new */

    /* Re-apply the core .unified-card styles */
    background-color: rgba(var(--bg-primary-rgb), 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--border-color), 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.unified-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

/* Dark mode compatibility */
body.dark-mode .unified-card {
    background-color: rgba(var(--bg-secondary-rgb), 0.5);
}

.unified-card .card-img-container {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.unified-card .card-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.unified-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.unified-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.unified-card .card-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

/* =============================================
   Compact Card Modifier
   ============================================= */

.unified-card[data-layout="compact"] {
    max-width: 190px; /* Make the card narrower */
    text-align: center;
}

.unified-card[data-layout="compact"] [data-part="image-container"] {
    height: 130px; /* Slightly more room for the image */
    padding: 0.5rem;
}

.unified-card[data-layout="compact"] [data-part="body"] {
    padding: 0.75rem; /* Reduced padding */
}

.unified-card[data-layout="compact"] [data-part="title"] {
    font-size: 0.9rem; /* Smaller title */
}

.unified-card[data-layout="compact"] [data-part="price"] {
    font-size: 0.85rem; /* Smaller price */
}