/*
 * Mugsocks – simple UI polish
 * - Red +/- qty buttons
 * - Nicer colour picker
 */

/* =======================
 * 1. QUANTITY CONTROLS
 * =====================*/

.mugsocks-qty-wrapper {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    border: 1px solid #e5e7eb; /* light grey */
    overflow: hidden;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.mugsocks-qty-input {
    width: 3.2em;
    text-align: center;
    border: none;
    font-size: 15px;
    padding: 6px 4px;
    line-height: 1.2;
}

.mugsocks-qty-input:focus {
    outline: none;
}

.mugsocks-qty-btn {
    border: none;
    background: #ef4444;       /* red */
    color: #ffffff;
    padding: 0 12px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.06s ease;
}

.mugsocks-qty-btn:hover {
    background: #dc2626;       /* darker red */
}

.mugsocks-qty-btn:active {
    background: #b91c1c;
    transform: scale(0.96);
}

/* Small tweak so it doesn’t blow out cart tables */
.woocommerce .product-quantity .mugsocks-qty-wrapper {
    max-width: 130px;
}

/* =======================
 * 2. COLOUR PICKER
 * =====================*/

/* Wrap row neatly (your PHP already outputs .mugsocks-colour-row) */
.mugsocks-colour-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Make the native <input type="color"> look like a nice round swatch */
#mugsocks_sock_colour,
#mugsocks_sock_colour.mugsocks-colour-input {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    background: transparent;
}

#mugsocks_sock_colour::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 999px;
}

#mugsocks_sock_colour::-webkit-color-swatch,
#mugsocks_sock_colour::-moz-color-swatch {
    border-radius: 999px;
    border: none;
}

/* Helper text next to the swatch */
.mugsocks-colour-row-text {
    font-size: 14px;
    color: #4b5563;
}

/* Preset swatches row injected by JS */
.mugsocks-colour-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mugsocks-colour-swatch {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    padding: 0;
    outline: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.mugsocks-colour-swatch:active {
    transform: scale(0.96);
}

.mugsocks-colour-swatch.is-selected {
    box-shadow:
        0 0 0 2px #ffffff,
        0 0 0 4px #3b82f6; /* blue ring */
}


/* =======================
 * Custom colour wheel UI
 * =======================*/

.mugsocks-colour-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}

.mugsocks-colour-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.mugsocks-colour-wheel {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mugsocks-colour-wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 999px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.06),
        0 10px 15px -3px rgba(15, 23, 42, 0.18);
}

.mugsocks-colour-wheel-pointer {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.4),
        0 4px 6px -1px rgba(15, 23, 42, 0.25);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.mugsocks-colour-current {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
}
