/**
 * TJ Organics - Smart Variation Cards Styling
 * Matches competitor D2C Shopify UI
 */

/* Hide native variation table cleanly */
.tj-smart-cards-enabled form.variations_form table.variations {
    display: none !important;
}

.tj-smart-variation-section {
    margin-top: 15px;
    margin-bottom: 22px;
    width: 100%;
}

/* Grid Layout: 3 columns desktop, 2 tablet, 2/1 mobile */
.tj-smart-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .tj-smart-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tj-smart-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Individual Card */
.tj-smart-card {
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 95px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.tj-smart-card:hover {
    border-color: #9ca3af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Selected / Active Card (Matches screenshot grey gradient) */
.tj-smart-card.is-selected {
    background: linear-gradient(145deg, #e5e7eb 0%, #cbd5e1 55%, #9ca3af 100%) !important;
    border: 2px solid #374151 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* Top Row: Pill & Discount Badge */
.tj-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    width: 100%;
}

.tj-variant-pill {
    background: #f1f3f5;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.3;
    display: inline-block;
    transition: background 0.2s ease;
}

.tj-smart-card.is-selected .tj-variant-pill {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Discount Badge */
.tj-discount-badge {
    background: #f59e0b; /* Amber/Yellow default */
    color: #111827;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1.3;
    transition: all 0.2s ease;
}

/* Selected card gets the Red badge like in screenshot */
.tj-smart-card.is-selected .tj-discount-badge {
    background: #e53935 !important;
    color: #ffffff !important;
}

/* Pricing Row */
.tj-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
    line-height: 1.2;
}

.tj-sale-price {
    font-size: 19px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.3px;
}

.tj-regular-price {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: line-through;
}

/* Unit Rate */
.tj-unit-price {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.2;
}

.tj-smart-card.is-selected .tj-unit-price {
    color: #111827;
    font-weight: 600;
}

/* Out of stock card styling */
.tj-smart-card.tj-out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.tj-smart-card.tj-out-of-stock:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
}

.tj-sold-out-overlay {
    display: inline-block;
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
}
