/**
 * WooCommerce Product Customizer Styles
 * Supports unlimited color swatches and dropdown attributes
 */

/* ========================================
   WRAPPER & FIELDS
   ======================================== */

.kbwc-custom-wrapper {
    max-width: 600px;
    margin: 20px 0;
}

.kbwc-field {
    margin-bottom: 20px;
}

.kbwc-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}


/* ========================================
   COLOR SWATCHES
   ======================================== */

.kbwc-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0;
}

.kbwc-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kbwc-color-swatch:hover:not(.disabled) {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.kbwc-color-swatch.active {
    border: 3px solid #333;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kbwc-color-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.kbwc-color-swatch.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}


/* ========================================
   DROPDOWN ATTRIBUTES
   ======================================== */

.kbwc-attribute-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.kbwc-attribute-select:hover {
    border-color: #555;
}

.kbwc-attribute-select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.kbwc-attribute-select option:disabled {
    color: #ccc;
}


/* ========================================
   PRINT TYPE BUTTONS
   ======================================== */

.kbwc-print-type-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.kbwc-print-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.kbwc-print-btn:hover {
    border-color: #555;
    background: #000;
    color: white;
}

.kbwc-print-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}


/* ========================================
   QUANTITY INPUT
   ======================================== */

.kbwc-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 30px;
}

.kbwc-qty-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kbwc-qty-btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.kbwc-qty-input {
    width: 80px !important;
    height: 38px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.kbwc-qty-input:focus {
    outline: none;
    border-color: #000;
}

.kbwc-qty-input::-webkit-inner-spin-button,
.kbwc-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* ========================================
   CUSTOMIZE BUTTON
   ======================================== */

.kbwc-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: #000;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kbwc-btn:hover:not([disabled]) {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kbwc-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: #999 !important;
    border-color: #888 !important;
    color: #ddd !important;
    pointer-events: none;
    transform: none;
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .kbwc-custom-wrapper {
        max-width: 100%;
    }
    
    .kbwc-color-swatch {
        width: 32px;
        height: 32px;
    }
    
    .kbwc-print-type-group {
        gap: 8px;
    }
    
    .kbwc-print-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .kbwc-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .kbwc-color-palette {
        gap: 8px;
    }
    
    .kbwc-color-swatch {
        width: 28px;
        height: 28px;
    }
    
    .kbwc-qty-wrapper {
        justify-content: center;
    }
}


/* ========================================
   PRICE BOX WRAPPER
   ======================================== */

#kbwc-price-display {
    font-family: inherit;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Regular price (crossed out) */
.kbwc-regular-price {
    text-decoration: line-through;
    color: #9c9c9c;
    font-size: 20px;
    margin-right: 10px;
}

/* Sale price */
.kbwc-sale-price {
    color: #d00000;
    font-size: 26px;
    font-weight: bold;
}

/* Only regular price */
.kbwc-regular-only {
    font-size: 26px;
    font-weight: bold;
    color: #222;
}

/* Price animation (smooth update) */
#kbwc-price-display span {
    transition: all 0.25s ease;
    display: inline-block;
}
