/* Main Container */
.wdof-container {
    background: #fdfdfd;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 500px;
    /* Prevent massive width */
    margin-left: 0;
    /* Align left like standard woo elements, or use auto for center */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

/* Hide standard WooCommerce Add to Cart BUTTON only */
/* form.cart must remain visible for variations/swatches */
.single_add_to_cart_button {
    display: none !important;
}

/* Hide Native Quantity (we use our own) */
form.cart .quantity {
    display: none !important;
}

/* Style the moved form to fit inside our container */
/* Force Standard Table Layout for Variations */
.wdof-container form.cart .variations {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 15px;
}

.wdof-container form.cart .variations tbody {
    display: table-row-group !important;
}

.wdof-container form.cart .variations tr {
    display: table-row !important;
    border-bottom: 1px solid #f0f0f0;
}

.wdof-container form.cart .variations td {
    display: table-cell !important;
    vertical-align: middle !important;
    padding: 10px 0 !important;
    background: transparent !important;
}

/* Main Container */
/* Force BLOCK layout for vertical stacking (Label top, Value bottom) */
.wdof-container form.cart .variations td.label {
    display: block !important;
    width: 100% !important;
    padding: 0 0 5px 0 !important;
    text-align: left;
    /* Language direction support */
}

/* Value Column (Right becomes Bottom) */
.wdof-container form.cart .variations td.value {
    display: block !important;
    width: 100% !important;
    text-align: left;
    margin-bottom: 15px;
    /* Space between variations */
}

/* 
   Fix Swatch Alignment:
   - Remove forced inline-block on generic children (broke flex).
   - Target UL specifically to force horizontal flex layout.
*/
.wdof-container form.cart .variations td.value>* {
    margin-bottom: 0 !important;
}

/* Force Swatch Lists (UL) to be Flexible Rows */
.wdof-container form.cart .variations td.value ul,
.wdof-container form.cart .variations ul.variable-items-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Ensure Label text Aligns */
.wdof-container form.cart .variations label {
    font-weight: 600;
    color: #444;
    margin: 0 !important;
    display: inline-block !important;
    font-size: 1rem;
}

/* Force any plugin spans inside label to be inline */
.wdof-container form.cart .variations label span {
    display: inline-block !important;
    margin-left: 5px;
    font-weight: normal;
    color: #666;
}

/* Reset Link specific fix */
.wdof-container form.cart .reset_variations {
    display: inline-block !important;
    margin-left: 10px;
    font-size: 0.85em;
    float: none !important;
}

/* Select Styling */
.wdof-container form.cart .variations select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0;
    vertical-align: middle;
}

.wdof-title {
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #6c5ce7;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* Form Fields */
.wdof-field-group {
    margin-bottom: 15px;
}

.wdof-field-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

.wdof-field-group input[type="text"],
.wdof-field-group input[type="tel"],
.wdof-field-group input[type="number"],
.wdof-field-group textarea,
.wdof-field-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    /* Important for width */
    font-size: 14px;
}

/* Quantity */
.wdof-quantity-wrapper {
    display: flex;
    align-items: center;
    max-width: 150px;
}

.wdof-qty-btn {
    background: #eee;
    border: 1px solid #ddd;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.wdof-quantity-wrapper input {
    text-align: center;
    border-left: 0;
    border-right: 0;
    margin: 0;
}

/* Radio Group */
.wdof-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wdof-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.wdof-radio-option:hover {
    background: #f0f0f0;
}

/* Summary */
.wdof-summary {
    background: #fafafe;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px dashed #ced6e0;
}

.wdof-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.wdof-summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-weight: bold;
    font-size: 1.2rem;
    color: #2d3436;
}

/* Submit Button */
.wdof-submit-btn {
    width: 100%;
    padding: 15px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wdof-submit-btn:hover {
    background: #4834d4;
}

/* Responsive */
@media (max-width: 768px) {
    .wdof-summary-row {
        font-size: 0.9rem;
    }
}

/* Promo */
.wdof-promo-wrapper {
    display: flex;
    gap: 5px;
}

.wdof-promo-wrapper button {
    background: #333;
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    border-radius: 4px;
}

#wdof-message {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}

#wdof-message.success {
    color: green;
}

#wdof-message.error {
    color: red;
}