/* ==========================================================
   NeedSheep Game Cards — cards.css
   Uses CSS custom properties from base.html (:root / html.dark)
   Namespace: .gc-* (game-card)
   ========================================================== */

/* --- Row List Container --- */
.gc-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.gc-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.gc-list-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.gc-list-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
}

.gc-list-sort {
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 8px;
    background: var(--bg-card);
    cursor: pointer;
    font-weight: 500;
}

/* --- Horizontal Row Card --- */
.gc-row {
    display: grid;
    grid-template-columns: 72px 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 100ms ease-out;
    text-decoration: none;
    color: inherit;
}

.gc-row:last-child {
    border-bottom: none;
}

.gc-row:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
}

/* Thumbnail */
.gc-row-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    position: relative;
    flex-shrink: 0;
}

.gc-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gc-row-thumb .gc-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-row-thumb .gc-placeholder span {
    font-size: 1.8rem;
    font-weight: 700;
    user-select: none;
    opacity: 0.55;
}

/* Discount badge on thumbnail */
.gc-discount-badge {
    position: absolute;
    top: 3px;
    left: -2px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--red);
    padding: 2px 6px 2px 4px;
    border-radius: 0 4px 4px 0;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Game info column */
.gc-row-info {
    min-width: 0;
}

.gc-row-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gc-row-name a {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.gc-row-name a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Metadata line (players, time, rating, flags, runner-up) */
.gc-row-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.gc-row-meta .gc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.gc-row-meta .gc-meta-rating {
    font-weight: 600;
}

.gc-row-meta .gc-meta-sep {
    color: var(--border-strong);
}

.gc-row-meta .gc-runner {
    font-size: 10px;
}

.gc-row-meta .gc-runner-store {
    font-weight: 500;
    color: var(--text);
}

.gc-row-meta .gc-runner-price {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.gc-row-meta .gc-runner-more {
    color: var(--accent);
    font-weight: 500;
}

/* Tag pills */
.gc-tag {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid;
}

.gc-tag-bajada {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

html.dark .gc-tag-bajada {
    background: #0369a1;
    color: #fff;
    border-color: #0369a1;
}

.gc-tag-mejor {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

html.dark .gc-tag-mejor {
    background: #047857;
    color: #fff;
    border-color: #047857;
}

.gc-tag-nuevo {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

html.dark .gc-tag-nuevo {
    background: #6d28d9;
    color: #fff;
    border-color: #6d28d9;
}

/* Store + Price column */
.gc-row-price-col {
    text-align: right;
}

.gc-row-price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    justify-content: flex-end;
}

.gc-row-store {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.gc-row-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.gc-row-prev {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
    opacity: 0.6;
}

.gc-row-savings {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    text-align: right;
}

.gc-row-savings .gc-savings-pct {
    font-weight: 600;
    color: var(--green);
}

.gc-row-savings .gc-savings-eur {
    font-weight: 500;
}

/* CTA column */
.gc-row-cta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gc-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    text-decoration: none;
    transition: background 100ms ease-out;
    border: none;
    cursor: pointer;
}

.gc-cta-btn:hover {
    background: #047857;
    text-decoration: none;
    color: #fff;
}

html.dark .gc-cta-btn:hover {
    background: #10b981;
}

.gc-cta-btn svg {
    width: 15px;
    height: 15px;
}

/* --- Mini Card (mobile vertical) --- */
.gc-mini-grid {
    display: none;
}

.gc-mini {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 150ms ease-out;
    box-shadow: var(--shadow-sm);
}

.gc-mini:hover {
    border-color: var(--accent);
}

.gc-mini-img {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--bg);
    position: relative;
}

.gc-mini-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.gc-mini-img .gc-discount-badge {
    top: 4px;
    left: -3px;
    padding: 2px 7px 2px 5px;
    font-size: 10px;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.gc-mini-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3px 6px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
}

html.dark .gc-mini-overlay {
    background: rgba(26,29,39,0.88);
}

.gc-mini-body {
    padding: 8px 8px 10px;
}

.gc-mini-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.gc-mini-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 4px;
}

.gc-mini-price .gc-price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.gc-mini-price .gc-price-prev {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.gc-mini-store {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.gc-mini-cta {
    font-size: 10px;
    color: var(--accent);
    margin-top: 3px;
    font-weight: 500;
}

/* ==========================================================
   Standard Vertical Card (v9) — .gc-card
   Used for grid displays (explorar, homepage, featured)
   ========================================================== */

/* Grid container */
.gc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Card shell */
.gc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    display: flex;
    flex-direction: column;
}

.gc-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

/* Image area — 1:1 aspect */
.gc-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.gc-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.gc-card-img .gc-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-card-img .gc-placeholder span {
    font-size: 3rem;
    font-weight: 700;
    user-select: none;
    opacity: 0.45;
}

/* Discount ribbon on card image */
.gc-card-img .gc-discount-badge {
    top: 8px;
    left: -3px;
    font-size: 11px;
    padding: 3px 8px 3px 6px;
    border-radius: 0 5px 5px 0;
}

/* Tag badge (top-right) */
.gc-card-tag {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Metadata overlay bar (bottom of image) */
.gc-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    gap: 6px;
}

html.dark .gc-card-overlay {
    background: rgba(26, 29, 39, 0.9);
}

.gc-card-overlay .gc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.gc-card-overlay-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gc-card-overlay .gc-meta-rating {
    font-weight: 600;
}

/* Card body */
.gc-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Title — 2-line clamp, vertically centered */
.gc-card-title {
    display: flex;
    align-items: center;
    min-height: 2.7em;
    text-decoration: none;
    color: var(--text-heading);
}

.gc-card-title span {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gc-card-title:hover {
    color: var(--accent);
}

/* Price row: price + buy chip */
.gc-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.gc-card-price-left {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    flex-shrink: 0;
}

.gc-card-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.gc-card-prev {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

/* Buy chip — green pill button */
.gc-card-buy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--green);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 100ms ease-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.gc-card-buy:hover {
    background: #047857;
    color: #fff;
    text-decoration: none;
}

html.dark .gc-card-buy:hover {
    background: #10b981;
}

.gc-card-buy svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.gc-card-buy-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Secondary prices */
.gc-card-sec {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

.gc-card-sec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: background 80ms ease-out;
}

a.gc-card-sec-row:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.gc-card-sec-store {
    font-weight: 500;
}

.gc-card-sec-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gc-card-sec-price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Badges on secondary rows */
.gc-card-badge-mejor {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-dim);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.gc-card-badge-igual {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1px solid var(--yellow-dim);
}

/* Compare link at bottom */
.gc-card-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.gc-card-compare:hover {
    text-decoration: underline;
}

.gc-card-compare svg {
    width: 12px;
    height: 12px;
}

/* --- Rating color classes --- */
.gc-rating-good { color: var(--green); }
.gc-rating-mid  { color: var(--yellow); }
.gc-rating-low  { color: var(--red); }

/* --- SVG Icons inline sizing --- */
.gc-icon {
    width: 13px;
    height: 13px;
    vertical-align: -1px;
    flex-shrink: 0;
}

.gc-icon-star {
    width: 12px;
    height: 12px;
}

.gc-icon-cart {
    width: 15px;
    height: 15px;
}

/* --- Empty state --- */
.gc-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================================
   Responsive Breakpoints
   ========================================================== */

/* Medium: drop PVPR strikethrough */
@media (max-width: 900px) {
    .gc-row-prev { display: none; }
}

/* Narrow: drop runner-up, tags, full metadata → just rating + flags */
@media (max-width: 640px) {
    .gc-runner, .gc-meta-sep { display: none; }
    .gc-tag { display: none; }
    .gc-meta-players, .gc-meta-time { display: none; }
    .gc-row-price { font-size: 17px; }
    .gc-row-store { font-size: 12px; }
    .gc-row { gap: 10px; padding: 8px 12px; }
    .gc-row-thumb { width: 56px; height: 56px; }
    .gc-row { grid-template-columns: 56px 1fr auto auto; }
    .gc-row-price-line { gap: 4px; }
}

/* Tiny: drop all metadata, smaller thumb */
@media (max-width: 480px) {
    .gc-row-meta { display: none; }
    .gc-row-thumb { width: 48px; height: 48px; }
    .gc-row { grid-template-columns: 48px 1fr auto auto; }
    .gc-row-name a { font-size: 13px; }
    .gc-row-savings { display: none; }
}

/* Mini: switch to 2-col card grid */
@media (max-width: 375px) {
    .gc-list .gc-row { display: none; }
    .gc-list-header { display: none; }
    .gc-mini-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }
}

/* Standard card responsive */
@media (max-width: 640px) {
    .gc-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 10px;
    }
    .gc-card-title { font-size: 13px; }
    .gc-card-price { font-size: 18px; }
    .gc-card-buy { padding: 5px 10px; font-size: 11px; }
    .gc-card-overlay { font-size: 10px; padding: 4px 8px; }
    .gc-card-body { padding: 10px 10px 12px; }
}

@media (max-width: 375px) {
    .gc-card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .gc-card-price-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .gc-card-buy { width: 100%; justify-content: center; }
    .gc-card-sec { display: none; }
}
