/* Product Wrapper Styles */
.product-wrapper {
    position: relative;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-wrapper:hover .hidden,
.product-wrapper:hover .quick-add-btn.mobile-trigger,
.hidden,
.hidden:hover {
    display: none !important;
    visibility: hidden;
}

/* Color Variant Handling */
.color-variant.hidden {
    display: none !important;
}

@media (min-width: 992px) {
    .product-wrapper:hover .quick-add-btn {
        display: initial !important;
    }
    .mobile-quick-buy {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .product-wrapper:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Quick Add Button Styles */
.quick-add-btn {
    position: absolute;
    display: none !important;
    opacity: 0.8;
}

.quick-add-btn.simple-add-to-cart {
    top: 68%;
}

.quick-add-btn button,
button.quick-add-btn {
    background-color: rgba(174, 146, 108, 1) !important;
    color: white !important;
}

.quick-add-btn button:hover,
button.quick-add-btn:hover {
    opacity: 0.5;
    transition: opacity 0.3s;
    color: black !important;
}

div.quick-add-btn {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.quick-add-btn.quick-add-sizes {
    background-color: rgba(174, 146, 108, 1);
    padding: 5px 10px;
    border-radius: 3px;
    color: white;
    min-width: 45%;
    top: 58% !important;
}

@media (max-width: 991px) {
    .quick-add-btn.quick-add-sizes {
        display: none !important;
    }
}

/* Quick Add Title */
.quick-add-title {
    text-align: center;
}

/* Variation Holder */
.variation-holder {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Set all product images to sticky to top of container */
.product-wrapper .woocommerce-LoopProduct-link.woocommerce-loop-product__link {
    align-items: flex-start !important;
}

/* Quick Size Option */
.quick-size-option {
    padding-top: 5px !important;
}

.quick-size-option.out-of-stock {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    text-decoration: line-through;
    font-family: revert;
}

/* Mobile Size Selection Menu */
.mobile-size-selector {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

.mobile-size-title {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: rgba(174, 146, 108, 1);;
}

.mobile-size-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
    justify-content: center;
}

.mobile-size-option {
    background-color: rgba(174, 146, 108, 1);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.mobile-size-option.out-of-stock {
    opacity: 0.6;
    text-decoration: line-through;
    cursor: not-allowed;
}

@media (max-width: 991px) {
    .mobile-size-selector.active {
        visibility: visible;
        opacity: 1;
        bottom: 0;
    }
}

/* Mobile Close Button */
.mobile-close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* Mobile Quick Buy Button */
.mobile-quick-buy {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(174, 146, 108, 1);
    background: #dcdcdc80 !important;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: none;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    top: 60%;
    overflow: hidden;
    line-height: 0;
    text-align: center;
    vertical-align: middle;
}

/* Positioning of the mobile quick buy icon */
@media (max-width: 465px) { .mobile-quick-buy { top: 55%; } }
@media (max-width: 415px) { .mobile-quick-buy { top: 52%; } }
@media (max-width: 380px) { .mobile-quick-buy { top: 48%; } }

.mobile-quick-buy.hidden {
    display: none !important;
}

.mobile-quick-buy:active {
    transform: scale(0.95);
}

.mobile-quick-buy span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 0;
}

 /* Blog layout design */
.woocommerce-page .wrap-content-blog ul.products li.product .product-wrapper .mobile-quick-buy {
    top: 59%;
}

@media (max-width: 991px) {
    .mobile-quick-buy {
        display: block;
    }
}

/* Mobile Add Icon */
.mobile-add-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.mobile-add-icon svg {
    width: 23px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    color: #000;
}

.mobile-add-icon svg path {
    fill: currentColor;
}

@media (max-width: 991px) {
    .mobile-add-icon {
        display: flex !important;
    }
    
    .mobile-add-icon svg {
        width: 20px;
        height: 21px;
    }
}

/* Loading Spinner */
.lds-dual-ring,
.lds-dual-ring:after {
    box-sizing: border-box;
}

.lds-dual-ring {
    display: inline-block;
    width: 24px;
    height: 24px;
}

.lds-dual-ring:after {
    content: " ";
    display: block;
    width: 20px;
    height: 20px;
    margin: 2px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-color: currentColor transparent currentColor transparent;
    animation: lds-dual-ring 1.2s linear infinite;
}

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Quick Buy Button positioning within related products section */
section.related.products {
    .mobile-quick-buy {
        top: 42% !important;
    }

    .quick-add-btn.simple-add-to-cart {
        top: 64% !important;
    }

    .quick-add-btn.quick-add-sizes {
        top: 52% !important;
    }
}