/* -------------------------------------------------------------
 * AnyDress Frontend Widget Styles
 * ------------------------------------------------------------- */
.anydress-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.anydress-btn:hover { opacity: 0.8; }

/* Target the exact wrappers for simple and variable products */
form.cart:not(.variations_form):not(.grouped_form), 
.woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important; /* Changed from 'stretch' to prevent weird height lines */
    gap: 10px !important;
}

/* Disable old classic theme clearfix hacks that break Flexbox */
form.cart:not(.variations_form):not(.grouped_form)::after, 
.woocommerce-variation-add-to-cart::after {
    display: none !important;
}

/* Strip hardcoded theme margins but KEEP the bottom spacing */
form.cart .quantity,
form.cart .single_add_to_cart_button,
form.cart .anydress-btn {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important; /* Creates the perfect breathing room above the theme's line */
}

/* Keep the buttons their natural, theme-defined width */
form.cart .single_add_to_cart_button, 
form.cart .anydress-btn {
    flex: 0 1 auto !important; /* Prevent buttons from stretching wider */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Theme Fix (Astra & others): Removes the thin link underline/border on the 'Login' version */
a.anydress-btn, 
.anydress-btn {
    border-bottom: none !important; /* Kills Astra's link border */
    text-decoration: none !important; 
    box-shadow: none !important; /* Kills Astra's link shadow */
}

/* Keep the quantity box its natural size */
form.cart .quantity {
    flex: 0 0 auto !important;
}

/* On mobile, stack them neatly */
@media screen and (max-width: 768px) {
    form.cart .single_add_to_cart_button, 
    form.cart .anydress-btn {
        flex: 1 1 100% !important; /* Force to full width ONLY on small screens */
    }
}

.anydress-modal { display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px); overflow-y: auto; }
.anydress-modal-content { margin: 5% auto 10%; padding: 30px 40px; border-radius: 12px; width: 90%; max-width: 500px; position: relative; box-shadow: 0px 10px 30px rgba(0,0,0,0.2); font-family: inherit; }
.anydress-close { color: #888; position: absolute; top: 15px; right: 25px; font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.anydress-close:hover { color: #000; }
.anydress-modal-content h2 { margin-top: 0; color: #222; font-size: 24px; }
.anydress-modal-content p { color: #555; margin-bottom: 25px; line-height: 1.5; }

.anydress-upload-group { margin-bottom: 20px; background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #eee; }
.anydress-upload-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; }
.anydress-upload-group input[type="file"] { width: 100%; font-size: 14px; }

.anydress-btn-main { background-color: #222; color: #fff; padding: 15px; border: none; border-radius: 6px; width: 100%; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.3s; margin-top: 10px; display:block; text-align:center;}
.anydress-btn-main:hover { background-color: #444; }
.anydress-btn-main:disabled { background-color: #888; cursor: not-allowed; }

.anydress-text-link { display: block; text-align: center; margin-top: 15px; color: #666; text-decoration: underline; cursor: pointer; font-size: 14px; }
.anydress-text-link:hover { color: #000; }

#anydress-result-area { text-align: center; margin-top: 20px; display: none; padding-bottom: 15px; }
.anydress-watermark { position: absolute; bottom: 10px; right: 15px; font-size: 8px; color: #aaa; text-decoration: none; letter-spacing: 0.5px; transition: color 0.3s; }
.anydress-watermark:hover { color: #555; }

/* Custom Checkbox Styles */
.anydress-custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    margin: 3px 0 0 0;
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0; /* Prevents shrinking if the text wraps to multiple lines */
}

/* The Tick/Checkmark (Hidden by default) */
.anydress-custom-checkbox::after {
    content: "";
    width: 4px;
    height: 9px;
    border: solid #fff; /* Default tick color */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: none;
    margin-bottom: 2px;
}

/* Show the tick and change background when checked */
.anydress-custom-checkbox:checked::after {
    display: block;
}

.anydress-custom-checkbox:checked {
    background-color: #222; /* Default background */
    border-color: #222; /* Default border */
}