/* ============================================================
   Custom Add Cart and Buy Now And Quantity Buttons — style.css
   v2.5
   ============================================================ */

/* 1. Container Layout */
form.cart:not(.variations_form),
.woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    align-items: stretch !important;
}

.woocommerce-variation-add-to-cart {
    margin-top: 15px !important;
}

/* 2. Quantity Box */
form.cart .quantity {
    display: flex !important;
    border: 1px solid #ccc !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    width: calc(50% - 7.5px) !important;
    margin: 0 !important;
}

form.cart .quantity .qty-btn {
    background: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

form.cart .quantity .qty-btn img {
    width: 25px;
}

form.cart .quantity .qty-btn:hover {
    background: #e8e8e8;
}

form.cart .quantity input.qty {
    border: none !important;
    text-align: center;
    flex: 1;
    padding: 10px;
    font-size: 20px;
    font-weight: 600;
    width: 100% !important;
    -moz-appearance: textfield;
    background: transparent;
    margin: 0 !important;
}

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

/* 3. Add to Cart Button */
form.cart .single_add_to_cart_button {
    width: calc(50% - 7.5px) !important;
    padding: 12px 24px !important;
    border: solid 1px #ccc !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: #0a0c37 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
}

form.cart .single_add_to_cart_button:hover {
    background: #f5f5f5 !important;
}

/* 4. Buy Now Button */
form.cart .custom-buy-now {
    width: 100% !important;
    order: 3 !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    background: #720014 !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    transition: all 0.3s ease;
}

form.cart .custom-buy-now:hover {
    background: #04093c !important;
}

form.cart .custom-buy-now img {
    width: 20px;
    margin-left: 20px;
    transition: all 0.5s ease-in-out;
}

form.cart .custom-buy-now:hover img {
    transform: translateX(10px);
}

.related.products > h2,
.woocommerce div.product form.cart {
    margin: 0 !important;
}

/* Fix WooCommerce clearfix pseudo-elements breaking Flexbox */
.woocommerce div.product form.cart::after,
.woocommerce div.product form.cart::before {
    display: none !important;
    content: none !important;
}

/* Hide "View Cart" link after AJAX add to cart */
form.cart .added_to_cart {
    display: none !important;
}

/* CSS Loader */
.custom-btn-loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 16px;
    height: 16px;
    -webkit-animation: custom-spin 1s linear infinite;
    animation: custom-spin 1s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.single_add_to_cart_button .custom-btn-loader {
    border: 2px solid rgba(10, 12, 55, 0.3);
    border-top: 2px solid #0a0c37;
}

@keyframes custom-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================
   NOTE: .variation-selector and .xpro_swatches are hidden via
   JavaScript (jQuery .hide()) in script.js — NOT via CSS.
   This is intentional: Xpro Swatches applies display:flex
   !important via its own stylesheet which CSS cannot override.
   JS inline style always wins regardless of CSS specificity.
   ============================================================ */

/* ============================================================
   CUSTOM ATTRIBUTE SELECTOR
   ============================================================ */

/* Outer wrapper — sits inside the variations table <td> */
.cpc-custom-attributes {
    margin-bottom: 4px;
}

/* Attribute name label */
.cpc-custom-attributes span {
    margin-bottom: 10px;
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0a0c37;
}

/* Pills list */
.cpc-custom-attributes ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

/* Individual pill */
.cpc-custom-attributes ul li {
    border-radius: 100px;
    box-shadow: 0 0 5px #ccc;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #0a0c37;
    background: #fff;
    transition: box-shadow 0.2s ease, background 0.2s ease,
                color 0.2s ease, transform 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.cpc-custom-attributes ul li:hover {
    box-shadow: 0 0 8px rgba(114, 0, 20, 0.4);
    color: #720014;
    transform: translateY(-1px);
}

/* Selected */
.cpc-custom-attributes ul li.is-selected {
    background: #720014;
    color: #fff;
    box-shadow: 0 2px 8px rgba(114, 0, 20, 0.35);
    font-weight: 600;
    transform: translateY(-1px);
}

.cpc-custom-attributes ul li.is-selected:hover {
    background: #5a0010;
    box-shadow: 0 2px 10px rgba(114, 0, 20, 0.45);
    color: #fff;
}

/* Unavailable / out-of-stock */
.cpc-custom-attributes ul li.is-unavailable {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: line-through;
}

/* Tighten variations table spacing */
.variations tr td,
.variations tr th {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    vertical-align: top;
}

/* Hide the <th> label column since our block renders the label inside the <td> */
.variations th.label {
    display: none !important;
}

/* "Clear" link */
.reset_variations {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
}