/* Vloerkleed Configurator - Exact same style as Traprenovatie */

/* Hide default WooCommerce elements for vloerkleed products */
.vloerkleed-product-wrapper + .quantity,
.vloerkleed-product-wrapper ~ .quantity,
.vloerkleed-product-wrapper .quantity {
    display: none !important;
}

/* Hide default price on single product page */
.single-product .product .vloerkleed-product-wrapper ~ .price {
    display: none;
}

/* Ensure add to cart button is visible and styled */
.vloerkleed-product-wrapper form.cart {
    margin-top: 0;
}

/* Main Container */
.vloerkleed-configurator {
    background: transparent;
    border: none;
    padding: 0;
    margin: 20px 0;
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 100%;
}

.vloerkleed-configurator * {
    position: relative;
    z-index: 1;
}

/* Title */
.vloerkleed-configurator h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

/* Input Grid */
.config-row {
    margin-bottom: 20px;
}

.config-row label {
    display: block;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Dimensions Row - Breedte & Lengte naast elkaar */
.dimensions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.dimensions-row .config-row {
    margin-bottom: 0;
}

.config-help {
    display: none;
}

/* Number Input with +/- buttons */
.number-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 47px;
    position: relative;
    z-index: 999;
}

.number-input-wrapper .btn-decrease,
.number-input-wrapper .btn-increase {
    width: 42px;
    height: 100%;
    border: none !important;
    background: #f5f5f5 !important;
    color: #666 !important;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer !important;
    transition: all 0.2s;
    flex-shrink: 0;
    pointer-events: auto !important;
    position: relative;
    z-index: 999;
    user-select: none;
}

.number-input-wrapper .btn-decrease {
    border-right: 1px solid #e0e0e0 !important;
}

.number-input-wrapper .btn-increase {
    border-left: 1px solid #e0e0e0 !important;
}

.number-input-wrapper .btn-decrease:hover,
.number-input-wrapper .btn-increase:hover {
    background: #e8e8e8 !important;
    color: #333 !important;
}

.number-input-wrapper .config-input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.number-input-wrapper .config-input::-webkit-inner-spin-button,
.number-input-wrapper .config-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper .config-input:focus {
    outline: none;
}

/* Select Dropdown */
.config-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

.config-select:focus {
    outline: none;
    border-color: #333;
}

/* Button Groups */
.config-row-buttons .button-group {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 999;
}

/* Afwerking Options - 2 Column Grid - Volledige breedte */
.afwerking-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
    z-index: 999;
    width: 100%;
}

/* Afwerking Buttons - Real Images, No Hover Effect */
.afwerking-button {
    padding: 15px 10px;
    background: white !important;
    color: #666 !important;
    border: 2px solid #ddd !important;
    border-radius: 4px;
    cursor: pointer !important;
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.2s;
    text-align: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 999;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 140px;
    width: 100%;
}

.afwerking-button img {
  width: 70%;
  height: 110px;
  margin-bottom: 0px;
  border-radius: 3px;
  object-fit: cover;
  object-position: center;
}

.afwerking-button.active {
    background: white !important;
    border-color: #000 !important;
    color: #000 !important;
    font-weight: 600;
}

/* Anti-slip Buttons - Simple Text Buttons */
.config-button {
    flex: 1;
    padding: 10px 15px;
    background: white !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    cursor: pointer !important;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 999;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.config-button:hover {
    border-color: #999 !important;
    background: #f5f5f5 !important;
}

.config-button.active {
    background: #000 !important;
    border-color: #000 !important;
    color: white !important;
}

.config-button.active:hover {
    background: #222 !important;
}

/* Shape selection - 4 Column Grid - Volledige breedte */
.shape-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    position: relative;
    z-index: 999;
    width: 100%;
}

.shape-button {
    padding: 15px 10px;
    background: white !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    cursor: pointer !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 999;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    width: 100%;
}

.shape-button img {
    max-width: 40px;
    max-height: 40px;
    margin-bottom: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.shape-button:hover {
    border-color: #999 !important;
    background: #f5f5f5 !important;
}

.shape-button:hover img {
    opacity: 1;
}

.shape-button.active {
    background: #000 !important;
    border-color: #000 !important;
    color: white !important;
}

.shape-button.active img {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.shape-button.active:hover {
    background: #222 !important;
}

/* Price Summary */
.price-summary {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0 15px 0;
    transition: opacity 0.3s ease;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 14px;
}

.price-row:last-of-type {
    margin-bottom: 5px;
}

/* Breakdown items */
.breakdown-item {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.breakdown-label {
    flex: 1;
}

.breakdown-label small {
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

.breakdown-price {
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

/* Total price */
.total-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #333;
    font-weight: 700;
    font-size: 16px;
}

.total-label {
    font-weight: 600;
    color: #333;
}

.total-price {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Loading state for price - Loader naast de prijs */
.total-price.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.price-value {
    font-weight: 600;
    color: #333;
}

.btw-notice {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #999;
}

/* Stock Status */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5cb85c;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.stock-icon {
    width: 16px;
    height: 16px;
    background: #5cb85c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Add to Cart Button */
form.cart button[type="submit"].single_add_to_cart_button {
    width: 100%;
    padding: 12px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
}

form.cart button[type="submit"].single_add_to_cart_button:hover {
    background: #222;
}

form.cart button[type="submit"].single_add_to_cart_button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Hidden inputs */
input[type="hidden"] {
    display: none;
}

/* Info message */
.woocommerce-info {
    background: #f8f9fa;
    border-left: 4px solid #000;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: #666;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .vloerkleed-configurator {
        padding: 0;
    }

    .button-group {
        flex-direction: column;
    }

    .config-button {
        width: 100%;
    }

    .afwerking-options {
        grid-template-columns: 1fr;
    }

    .shape-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .dimensions-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .price-row {
        font-size: 13px;
    }

    .total-price {
        font-size: 18px;
    }

    .breakdown-label small {
        font-size: 11px;
    }
}

/* Loading State */
.vloerkleed-configurator.loading {
    opacity: 0.6;
    pointer-events: none;
}
