/**
 * Copyright © BYU. All rights reserved.
 */

.product-addons-container {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
    clear: both;
}

/* Hide the original add to cart button */
.product-info-main .box-tocart button[type="submit"][data-role="tocart"],
.product-info-main .box-tocart button.action.tocart,
.product-info-main form#product_addtocart_form button[type="submit"][data-role="tocart"],
.product-info-main .box-tocart button#product-addtocart-button {
    display: none !important;
}

/* Style the custom Add to Basket button */
.addons-add-to-cart-wrapper {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.addons-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.addons-qty-label {
    font-weight: 600;
    margin: 0;
}

.addons-qty-control {
    display: flex;
    align-items: center;
    gap: 0px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.addons-qty-control .edit-qty {
    cursor: pointer;
    padding: 16px 12px;
    background: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    user-select: none;
}

.addons-qty-control .edit-qty:hover {
    background: #e5e5e5;
}

.addons-qty-control .edit-qty.minus {
    border-right: 1px solid #ddd;
}

.addons-qty-control .edit-qty.plus {
    border-left: 1px solid #ddd;
}

.addons-qty-control .input-text.qty {
    width: 60px;
    text-align: center;
    padding: 8px 5px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 14px;
}


@media (min-width: 768px) {
    .column.main > .row > .col-md-6:first-child {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 180px !important;
        align-self: flex-start !important;
        max-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
    }
    
    .product.media {
        position: relative !important;
    }
    
    .column.main > .row {
        display: flex !important;
        align-items: flex-start !important;
    }

    body.page-product-configurable {
        overflow-x: clip !important;
    }
}

@media (max-width: 767px) {
    .column.main > .row > .col-md-6:first-child {
        position: static !important;
        max-height: none !important;
    }
}



.addons-add-to-cart {
    padding: 12px 30px;
    background: #00a8b0;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    min-width: 150px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.addons-add-to-cart:hover:not(:disabled) {
    background: #008a92;
}

.addons-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cart items will be reversed by JavaScript - no CSS needed */

@media (max-width: 768px) {
    .addons-add-to-cart-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .addons-qty-wrapper {
        justify-content: center;
    }
    
    .addons-add-to-cart {
        width: 100%;
    }
}

.addon-section {
    margin-bottom: 30px;
}

.addon-section:last-child {
    margin-bottom: 0;
}

.addon-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.addon-options {
    display: grid;
    gap: 15px;
}

.page-product-configurable .product-info-main .swatch-attribute-options .swatch-option.selected {
    border: solid #000000 4px;
}

.page-product-configurable .product-info-main .swatch-attribute-options .swatch-option {
    width: 56px !important;
    height: 56px !important;
}

/* Swatch option wrapper for displaying names */
.swatch-option-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
}

/* Swatch option name styling */
.swatch-option-name {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #333;
    text-align: center;
    line-height: 1.3;
    max-width: 70px;
    word-wrap: break-word;
    font-weight: normal;
}

/* Ensure swatch options container allows for names */
.page-product-configurable .product-info-main .swatch-attribute-options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Adjust spacing for swatch options with names */
.page-product-configurable .product-info-main .swatch-attribute-options .swatch-option-wrapper {
    margin-bottom: 15px;
}

.addon-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}


.addon-option:hover:not(.disabled):not(.out-of-stock) {
    border-color: #1979c3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.addon-option.selected {
    border-color: #1979c3;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(25, 121, 195, 0.2);
}

.addon-option.disabled,
.addon-option.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.addon-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.addon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.addon-image.placeholder {
    background: #e5e5e5;
    color: #999;
    font-weight: bold;
    font-size: 24px;
}

.addon-info {
    flex: 1;
    min-width: 0;
}

.addon-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
    word-wrap: break-word;
}

.addon-stock {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.addon-stock.in-stock {
    color: #008000;
}

.addon-stock.in-stock .stock-icon {
    color: #008000;
    font-weight: bold;
}

.addon-stock.out-of-stock {
    color: #999;
}

.addon-price {
    font-size: 14px;
    font-weight: bold;
    color: #e02b27;
    margin-left: 10px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .addon-options {
        grid-template-columns: 1fr;
    }
    
    .addon-option {
        flex-direction: column;
        text-align: center;
    }
    
    .addon-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .addon-price {
        margin-left: 0;
        margin-top: 10px;
    }
}

