/* ============================================
   Custom Variant for Product — Frontend Styles
   ============================================ */

.cv-shortcode-wrapper {
    margin-bottom: 30px;
}

.custom-variation-wrapper {
    margin-top: 20px;
}

/* Section heading */
.filter-heading {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 15px;
    display: block;
    color: #222;
}

/* Option row */
.variation-custom-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    align-items: flex-start;
}

/* ── Button style ────────────────────────────── */
.custom-variation-button {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    user-select: none;
    line-height: 1;
}

.custom-variation-button:hover {
    border-color: #888;
    background-color: #f5f5f5;
}

.custom-variation-button.active {
    border-color: #111;
    background-color: #111;
    color: #fff;
}

/* ── Dropdown style ──────────────────────────── */
.custom-variation-select {
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    background-color: #fff;
}

.custom-variation-select:focus {
    outline: none;
    border-color: #555;
}

/* ── Image + Name style ─────────────────────── */
.variation-type-image_name {
    gap: 12px;
}

.custom-variation-image-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    min-width: 72px;
    max-width: 100px;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-variation-image-card:hover {
    border-color: #888;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.custom-variation-image-card.active {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.custom-variation-image-card img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.cv-image-placeholder {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 20px;
    font-weight: 700;
    color: #aaa;
}

.cv-image-label {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    word-break: break-word;
}

/* ── Quantity Selector ─────────────────────── */
.cv-quantity-wrapper {
    margin-bottom: 20px;
}

.quantity-heading {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: #222;
}

.cv-quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 2px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.cv-quantity-selector.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.cv-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-qty-btn:hover:not(:disabled) {
    background: #e5e5e5;
}

.cv-qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.cv-quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.cv-quantity-input::-webkit-outer-spin-button,
.cv-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cv-quantity-input:disabled {
    background: #f9f9f9;
    cursor: not-allowed;
}

.cv-quantity-input-static {
    width: 80px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.cv-quantity-input-static:focus {
    border-color: #111;
    outline: none;
}

.cv-quantity-input-static:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── Add to Cart Button ────────────────────── */
.cv-add-to-cart-wrapper {
    margin-bottom: 20px;
}

.cv-atc-button {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cv-atc-button:hover:not(:disabled):not(.disabled) {
    background: #333;
}

.cv-atc-button:disabled,
.cv-atc-button.disabled,
.cv-atc-button.out-of-stock {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.cv-atc-button.loading {
    position: relative;
    color: transparent;
}

.cv-atc-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cv-spin 0.6s linear infinite;
}

@keyframes cv-spin {
    to { transform: rotate(360deg); }
}

/* ── Stock Display ─────────────────────────── */
.cv-stock-wrapper {
    margin-bottom: 15px;
    font-size: 14px;
}

.cv-stock-status-wrapper {
    margin-bottom: 20px;
}

.cv-stock-status {
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-block;
    font-size: 14px;
    margin: 0;
}

.cv-stock-status.in-stock {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cv-stock-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cv-stock-qty {
    margin-left: 8px;
    color: #666;
    font-weight: 400;
}

/* ── Stock Count ───────────────────────────── */
.cv-stock-count-wrapper {
    margin-bottom: 20px;
}

.stock-count-heading {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: #222;
}

.cv-stock-count-input {
    width: 100px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.cv-stock-count-input:focus {
    border-color: #111;
    outline: none;
}

.cv-stock-count-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.cv-stock-count-display {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* ── Custom Price ──────────────────────────── */
.cv-price-wrapper {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.cv-price-display {
    color: #111;
}

.cv-price-placeholder {
    color: #999;
    font-style: italic;
    font-size: 18px;
}
