/* ─────────────────────────────────────────────
   JAM Sample Service — v1.2
   ───────────────────────────────────────────── */

#jam-sample-service *,
#jam-sample-service *::before,
#jam-sample-service *::after {
    box-sizing: border-box;
}

#jam-sample-service {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 60px;
    font-family: inherit;
}

/* Intro */
.jam-sample-intro {
    text-align: center;
    margin-bottom: 36px;
}

.jam-sample-intro h2 {
    font-size: 1.5rem;
    margin: 0 0 10px;
    font-weight: 700;
}

.jam-sample-intro p {
    max-width: 640px;
    margin: 0 auto;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ─── Layout ─── */
.jam-sample-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.jam-sample-left {
    flex: 1 1 0;
    min-width: 0;
}

.jam-sample-right {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* ─── Tabs ─── */
.jam-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 30px;
}

.jam-tab {
    background: none !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    margin-bottom: -2px;
    padding: 10px 22px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #777 !important;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.jam-tab:hover {
    color: #222 !important;
    background: none !important;
}

.jam-tab.active {
    color: #1a1a1a !important;
    border-bottom-color: #1a1a1a !important;
    background: none !important;
}

/* ─── Loading / empty ─── */
.jam-loading,
.jam-no-products {
    color: #999;
    font-size: 0.88rem;
    padding: 16px 0;
}

/* ─── Product group ─── */
.jam-product-group {
    margin-bottom: 28px;
}

.jam-product-name {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #333 !important;
    margin: 0 0 10px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #e8e8e8 !important;
}

/* ─── Swatch grid ─── */
.jam-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.jam-swatch {
    /* Reset button defaults without using all:unset */
    appearance: none !important;
    -webkit-appearance: none !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font: inherit !important;
    color: inherit !important;
    /* Layout */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
    width: 70px !important;
    cursor: pointer !important;
}

.jam-swatch:focus {
    outline: none !important;
    box-shadow: none !important;
}

.jam-swatch img {
    display: block !important;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 2px !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: box-shadow 0.15s !important;
}

.jam-swatch:hover img {
    box-shadow: 0 0 0 2px #999 !important;
}

.jam-swatch.selected img {
    box-shadow: 0 0 0 3px #1a1a1a !important;
}





.jam-swatch-label {
    display: block !important;
    font-size: 0.65rem !important;
    color: #555 !important;
    text-align: center !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
    white-space: normal !important;
    width: 100% !important;
}

/* Disabled state when limit reached */
.jam-swatch.disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ─── Limit warning ─── */
.jam-limit-warning {
    font-size: 0.78rem;
    color: #c0392b;
    margin: 0 0 12px;
    padding: 8px 10px;
    background: #fdf0ef;
    border-left: 3px solid #c0392b;
    border-radius: 2px;
    display: none;
}

.jam-limit-warning.visible {
    display: block;
}

/* ─── Tray ─── */
.jam-tray {
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 5px;
    padding: 16px;
}

.jam-tray h3 {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #1a1a1a !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
}

.jam-tray-empty {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
    margin: 0;
}

/* Tray items */
.jam-tray-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.jam-tray-item:last-of-type {
    border-bottom: none;
}

.jam-tray-item img {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover !important;
    border-radius: 2px !important;
    flex-shrink: 0;
    border: none !important;
    margin-top: 1px;
}

.jam-tray-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
}

.jam-tray-product {
    font-size: 0.75rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
}

.jam-tray-color {
    font-size: 0.7rem;
    color: #888;
    display: block;
    line-height: 1.3;
}

/* Simple text × remove button */
.jam-tray-remove {
    all: unset !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    color: #999 !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    line-height: 1 !important;
    flex-shrink: 0;
    transition: color 0.15s !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    margin-top: 2px;
}

.jam-tray-remove:hover {
    color: #cc0000 !important;
    background: none !important;
}

/* Tray footer */
#jam-tray-footer {
    margin-top: 14px;
}

.jam-tray-count {
    font-size: 0.72rem;
    color: #888;
    margin: 0 0 8px;
    text-align: center;
}

#jam-order-btn {
    display: block !important;
    width: 100% !important;
    background: #1a1a1a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 11px 12px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    letter-spacing: 0.04em !important;
    text-align: center !important;
    transition: background 0.2s !important;
    box-shadow: none !important;
}

#jam-order-btn:hover {
    background: #333 !important;
}

#jam-order-btn:disabled {
    background: #999 !important;
    cursor: not-allowed !important;
}

.jam-tray-note {
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* Cart label */
.jam-sample-label {
    font-size: 0.8em;
    color: #777;
}

/* ─── Mobile sticky tray ─── */
#jam-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 2px solid #333;
    padding: 12px 14px 14px;
    z-index: 9999;
    box-shadow: 0 -3px 16px rgba(0,0,0,0.18);
    flex-direction: column;
    gap: 10px;
}

#jam-mobile-bar-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    margin: 0;
}

/* Tiles row: 5 equal columns */
#jam-mobile-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.jam-mobile-tile {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed #555;
    border-radius: 3px;
    background: #2a2a2a;
    overflow: hidden;
}

.jam-mobile-tile.filled {
    border: 2px solid #666;
}

.jam-mobile-tile img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
}

.jam-mobile-tile-remove {
    all: unset !important;
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 16px !important;
    height: 16px !important;
    background: rgba(0,0,0,0.65) !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-size: 0.65rem !important;
    line-height: 16px !important;
    text-align: center !important;
    cursor: pointer !important;
    display: block !important;
}

/* Footer: button LEFT, label right */
#jam-mobile-bar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}

#jam-mobile-order-btn {
    all: unset !important;
    display: inline-block !important;
    background: #fff !important;
    color: #1a1a1a !important;
    border-radius: 3px !important;
    padding: 10px 18px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    text-align: center !important;
    letter-spacing: 0.03em !important;
    flex-shrink: 0;
}

#jam-mobile-order-btn:disabled {
    background: #555 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

#jam-mobile-bar-label {
    font-size: 0.75rem;
    color: #aaa;
    flex: 1;
    line-height: 1.3;
    text-align: right;
}

/* Responsive */
@media (max-width: 820px) {
    .jam-sample-layout {
        flex-direction: column;
    }

    .jam-sample-right {
        display: none;
    }

    #jam-mobile-bar {
        display: flex;
    }

    #jam-sample-service {
        padding-bottom: 200px;
    }

    /* 4 swatches per row on mobile */
    .jam-swatches {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    .jam-swatch {
        width: 100% !important;
        align-items: flex-start !important;
    }

    .jam-swatch img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 !important;
    }

    .jam-swatch-label {
        text-align: left !important;
    }
}
