/* Source: tpl/core/client/css/pix.css */
/*
    MerchStudio version 0.01 - Core File
    Copyright (c) 2026 MerchStudio Inc.
    Per-Image Transfers Client Styles
    @author      Hezekiah Dayson
    @version     tpl/core/client/css/pix.css - 0.01

    #included-by: client/css_load.tpl
*/

/* --- App Header & Logo Styles --- */
.app_header {
    height: 70px;
    background-color: var(--bg);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
}

.header_left,
.header_right {
    display: flex;
    align-items: center;
}

.header_left {
    gap: 0;
}

.header_right {
    gap: 20px;
}

.app_title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--accent);
}


/* --- Viewport & Layout Core --- */
.upload_hero {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload_card {
    background-color: var(--base);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.upload_card .merch_icon.huge {
    color: var(--accent);
    fill: currentColor;
    stroke: currentColor;
}

.upload_card h2 {
    color: var(--text);
    margin-top: 15px;
}

.staging_section {
    margin-top: 40px;
}

.staging_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 325px), 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Empty State Styling */
.empty_stage {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background-color: var(--base);
}

.empty_stage.hidden {
    display: none;
}

.card_preview {
    height: 200px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: var(--info_bg);
}

.card_preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card_meta {
    font-size: 0.85em;
    margin-bottom: 15px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Refined Dimension Form Inputs --- */
.card_dims.inline_input {
    display: flex;
    gap: 10px;
    width: 100%;
}

.card_dims .dim_input {
    flex: 1;
}

.card_dims .dim_input label {
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.card_dims .dim_input input {
    padding: 4px 8px;
    font-size: 12px;
    height: auto;
    text-align: center;
    width: 100%;
}

/* --- Quantity Controls --- */
.card_qty {
    display: flex;
    align-items: stretch;
    background-color: var(--base);
    border-radius: 6px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 1rem;
    height: 38px;
}

.card_qty .merch_button {
    background: var(--info_bg);
    color: var(--contrast);
    border: none;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: background 0.2s;
}

.card_qty .merch_button:hover {
    background-color: var(--hover);
}

.card_qty .qty_val {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    color: var(--contrast);
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
    margin: 0;
    border-radius: 0;
    -moz-appearance: textfield; /* Hides arrows in Firefox */
}

/* Hides arrows in Chrome/Safari/Edge */
.card_qty .qty_val::-webkit-outer-spin-button,
.card_qty .qty_val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Borderless, Text-Color-Only DPI Signage --- */
.card_dpi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0;
    font-size: 0.85em;
    font-weight: 600;
    color: #e02424;
}

.card_dpi.good {
    color: var(--accent_green);
}

/* --- Floating Action Button --- */
.merch_button.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;

    border-radius: 50px;
    margin: 0;

    width: max-content;
    min-width: max-content;
    height: 45px;
    padding: 0 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;
}

.merch_button.fab.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.merch_button.fab span {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.merch_button.fab .merch_icon {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* --- Checkerboard Pattern --- */
.checkerboard {
    background-color: #1a1a1a;
    background-image:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* --- Pix Grid & Cards --- */
.staging_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stage_card {
    background-color: var(--base);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 6px var(--shadow);
}

/* --- Optimistic UI & Failure States --- */
.stage_card.optimistic_loading {
    opacity: 0.8;
}

.stage_card.upload_failed img {
    filter: grayscale(100%) opacity(0.5);
}

.stage_card.upload_failed .card_dims,
.stage_card.upload_failed .card_qty {
    opacity: 0.5;
    pointer-events: none;
}

.card_preview {
    position: relative;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card_preview img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    z-index: 1;
}

/* --- Absolute Badges --- */
.pix_badge_price {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--highlight);
    color: #111;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
}

.pix_badge_delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--accent_red);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s ease;
}

.pix_badge_delete:hover {
    transform: scale(1.1);
}

.pix_badge_delete .merch_icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: currentColor;
}

.pix_badge_dpi {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.pix_badge_dpi.warning {
    color: var(--accent_red);
}

.pix_badge_dpi .merch_icon {
    width: 14px;
    height: 14px;
}

/* --- Inputs & Controls --- */
.card_meta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--contrast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1rem;
}

.card_dims {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card_dims .dim_input {
    flex: 1;
}

.card_dims label, .qty_label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.pix_input_field {
    width: 100%;
    background-color: var(--info_bg);
    border: 1px solid var(--line);
    color: var(--contrast);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.card_qty {
    display: flex;
    align-items: center;
    background-color: var(--info_bg);
    border-radius: 6px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card_qty .merch_button {
    background: transparent;
    color: var(--contrast);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    cursor: pointer;
}

.card_qty .merch_button:hover {
    background-color: var(--hover);
}

.card_qty .qty_val {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--contrast);
    font-size: 1rem;
    font-weight: 600;
}

.pix_add_cart_btn {
    width: 100%;
    background-color: var(--highlight);
    color: #111;
    border: none;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.pix_add_cart_btn:hover {
    opacity: 0.9;
}

.pix_add_cart_btn .merch_icon {
    width: 20px;
    height: 20px;
}

