/* ===================================
   Subproduct Display Styling
   =================================== */

/* ===================================
   Filter Selects with Choices.js
   =================================== */

.filter-selects-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.filter-separator {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding: 0 8px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 6px;
}

.filter-price-header {
    min-height: 32px;
    display: flex;
    align-items: center;
}

/* Choices.js custom styling for filters */
.filter-choices {
    width: 100%;
    max-width: none;
    margin-bottom: 0;
    flex: 1;
    position: relative;
}

.filter-choices__inner {
    min-height: 32px;
    padding: 3px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    display: flex;
    align-items: center;
}

.filter-choices.is-open .filter-choices__inner,
.filter-choices.is-focused .filter-choices__inner {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-choices .choices__list--single {
    padding: 0;
}

.filter-choices .choices__item {
    font-size: 14px;
    color: #495057;
}

.filter-choices .choices__list--dropdown {
    border: 1px solid #007bff;
    border-radius: 4px;
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.filter-choices .choices__list--dropdown .choices__item {
    padding: 6px 10px;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.filter-choices .choices__list--dropdown .choices__item--selectable {
    padding-right: 10px;
}

.filter-choices .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #007bff;
    color: #fff;
}

.filter-choices .choices__item--selectable:hover {
    background-color: #f8f9fa;
}

.filter-choices .choices__item--selectable.is-highlighted:hover {
    background-color: #0056b3;
}

/* Arrow icon */
.filter-choices[data-type*="select-one"]::after {
    content: "";
    height: 0;
    width: 0;
    border-style: solid;
    border-color: #333 transparent transparent;
    border-width: 5px 5px 0;
    position: absolute;
    right: 10px;
    top: 13px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.filter-choices[data-type*="select-one"].is-open::after {
    transform: rotate(180deg);
}

/* Mobile specific adjustments */
@media (max-width: 575px) {
    .filter-selects-wrapper {
        gap: 8px;
    }

    .filter-choices__inner {
        min-height: 38px;
        font-size: 15px;
        padding: 6px 12px;
    }

    .filter-choices .choices__list--dropdown .choices__item {
        padding: 8px 12px;
        font-size: 15px;
    }

    .filter-separator {
        font-size: 16px;
        padding-top: 8px;
    }

    .filter-choices[data-type*="select-one"]::after {
        top: 16px;
    }

    .filter-price-header {
        min-height: 38px;
    }
}

/* Tablet specific adjustments */
@media (min-width: 576px) and (max-width: 767px) {
    .filter-choices__inner {
        min-height: 34px;
        padding: 4px 10px;
    }

    .filter-separator {
        padding-top: 7px;
    }

    .filter-price-header {
        min-height: 34px;
    }

    .filter-choices .choices__list--dropdown .choices__item {
        padding: 7px 10px;
    }

    .filter-choices[data-type*="select-one"]::after {
        top: 14px;
    }
}

/* Main subproduct row container */
.subproduct-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    gap: 10px;
}

/* Main info section (image + dimensions + price) */
.subproduct-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Image placeholder */
.subproduct-image {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    transition: background 0.2s;
}

.subproduct-image:hover {
    background: #e8e8e8;
}

.subproduct-image a {
    color: #666;
    font-size: 20px;
    text-decoration: none;
}

.subproduct-image a:hover {
    color: #333;
}

/* Dimensions */
.subproduct-dimensions {
    font-size: 17px !important;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Price sections */
.subproduct-price-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    margin-left: auto;
}

.subproduct-price-mobile .money,
.subproduct-price-mobile .price-discount {
    font-size: 17px !important;
}

.subproduct-price-mobile .price-regular-striked {
    font-size: 15px !important;
}

.subproduct-price-desktop {
    display: none;
}

/* Attributes section */
.subproduct-attributes {
    width: 100%;
    order: 3;
}

/* Action button */
.subproduct-action {
    order: 4;
    width: 100%;
}

.subproduct-action .btn {
    width: 100%;
    padding: 10px;
}

/* ===================================
   Attribute Styling
   =================================== */

.subproduct-attribute-group {
    margin-bottom: 10px;
}

.subproduct-attribute-group:last-child {
    margin-bottom: 0;
}

.attribute-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Non-user-defined attributes - inline display */
.attribute-value {
    font-size: 13px;
    color: #333;
    padding-left: 0;
    display: inline;
}

/* Make non-user-defined attribute groups inline */
.subproduct-attribute-group:has(.attribute-value) .attribute-label {
    display: inline;
    margin-bottom: 0;
    margin-right: 6px;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
    .subproduct-attribute-group .attribute-label {
        display: inline-block;
        margin-right: 6px;
    }

    .subproduct-attribute-group .attribute-label:only-child {
        display: block;
        margin-right: 0;
    }
}

.attribute-option {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    position: relative;
}

.attribute-option:last-child {
    margin-bottom: 0;
}

/* Hide default checkbox and radio */
.attribute-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom checkbox/radio styling */
.attribute-label-option {
    display: flex;
    align-items: center;
    padding-left: 24px;
    position: relative;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
    line-height: 1.4;
}

/* Custom checkbox box (square) */
input[type="checkbox"].attribute-input + .attribute-label-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: #fff;
    transition: all 0.2s;
}

/* Checkmark for checkbox */
input[type="checkbox"].attribute-input + .attribute-label-option::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg) scale(0);
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transition: transform 0.2s;
}

/* Custom radio button (circle) */
input[type="radio"].attribute-input + .attribute-label-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    transition: all 0.2s;
}

/* Radio button inner circle (filled dot) */
input[type="radio"].attribute-input + .attribute-label-option::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

/* Checked state - Checkbox */
input[type="checkbox"].attribute-input:checked + .attribute-label-option::before {
    background: #007bff;
    border-color: #007bff;
}

input[type="checkbox"].attribute-input:checked + .attribute-label-option::after {
    transform: translateY(-50%) rotate(45deg) scale(1);
}

/* Checked state - Radio */
input[type="radio"].attribute-input:checked + .attribute-label-option::before {
    background: #007bff;
    border-color: #007bff;
}

input[type="radio"].attribute-input:checked + .attribute-label-option::after {
    transform: translateY(-50%) scale(1);
}

/* Focus state */
.attribute-input:focus + .attribute-label-option::before {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Hover state */
.attribute-label-option:hover::before {
    border-color: #007bff;
}

/* Attribute price */
.attribute-price {
    font-weight: 600;
    margin-left: 4px;
    color: #28a745;
}

/* ===================================
   Price Display with Discount
   =================================== */

.price-regular-striked {
    text-decoration: line-through;
    color: #999;
    font-size: 15px !important;
}

.price-discount {
    color: #ff6600;
    font-weight: 700;
    font-size: 17px;
}

.money {
    color: #333;
    font-size: 17px;
}

/* ===================================
   Cart & Checkout Price Display
   =================================== */

/* Mini cart price display */
.mini-cart__product__quantity .price-regular-striked {
    font-size: 13px !important;
    margin-right: 4px;
}

.mini-cart__product__quantity .price-discount {
    font-size: 14px;
    font-weight: 700;
}

/* Main cart table price display */
.product-price-wrapper .price-regular-striked {
    font-size: 14px !important;
    margin-bottom: 2px;
}

.product-price-wrapper .price-discount {
    font-size: 16px;
    font-weight: 700;
    color: #ff6600 !important;
}

.product-price-wrapper .d-block {
    display: block;
}

/* Checkout order details - total price display */
.checkout-price-total {
    text-align: right;
}

.checkout-price-total .price-regular-striked {
    font-size: 14px !important;
    margin-bottom: 4px;
}

.checkout-price-total .price-discount {
    font-size: 16px;
    font-weight: 700;
    color: #ff6600 !important;
}

/* ===================================
   Inline Attribute Price Display
   =================================== */

/* Inline attribute price styling - shows directly after attribute value */
.attribute-inline-price {
    color: #ff6600;
    font-weight: 600;
    font-size: 11px;
    margin-left: 4px;
}

/* Mini cart specific */
.mini-cart__product__content .attribute-inline-price {
    font-size: 10px;
}

/* Cart table specific */
.product-name .attribute-inline-price {
    font-size: 11px;
}

/* Checkout specific */
.checkout-title + .table-content .attribute-inline-price {
    font-size: 10px;
}

/* Attribute option indentation - indent options under attribute name */
.attribute-option-indent {
    display: inline-block;
    padding-left: 15px;
}

/* Mini cart specific indent */
.mini-cart__product__content .attribute-option-indent {
    padding-left: 12px;
}

/* Cart table specific indent */
.product-name .attribute-option-indent {
    padding-left: 15px;
}

/* Checkout specific indent */
.checkout-title + .table-content .attribute-option-indent {
    padding-left: 12px;
}

/* ===================================
   Mini Cart Close Buttons Fix
   =================================== */

/* Main close button for mini cart */
.mini-cart .btn-close,
.mini-cart-wrapper .btn-close {
    color: #333 !important;
    right: 2rem;
    z-index: 10;
    cursor: pointer;
    background: transparent;
    border: none;
}

.mini-cart .btn-close i,
.mini-cart-wrapper .btn-close i {
    font-style: normal;
    font-family: 'FontAwesome';
    font-weight: normal;
}

.mini-cart .btn-close:hover,
.mini-cart-wrapper .btn-close:hover {
    color: #ff6600 !important;
}

/* Remove from cart button for each product */
.mini-cart__product .remove-from-cart {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
    background: transparent;
    border: none;
    text-decoration: none;
}

.mini-cart__product .remove-from-cart i {
    font-style: normal;
    font-family: 'FontAwesome';
    font-weight: normal;
}

.mini-cart__product .remove-from-cart:hover {
    color: #ff0000;
}

.mini-cart__product {
    position: relative;
}

/* ===================================
   Desktop Styles (SM and up)
   =================================== */

@media (min-width: 576px) {
    .subproduct-row {
        padding: 16px 0;
        gap: 15px;
    }

    .subproduct-main-info {
        flex: 0 0 auto;
        width: auto;
    }

    .subproduct-image {
        width: 50px;
        height: 50px;
    }

    .subproduct-dimensions {
        font-size: 17px !important;
        min-width: 100px;
    }

    .subproduct-price-mobile {
        display: none;
    }

    .subproduct-price-desktop {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        font-size: 20px;
        font-weight: 600;
        order: 3;
    }

    /* Desktop price styling */
    .subproduct-price-desktop .money,
    .subproduct-price-desktop .price-discount {
        font-size: 20px !important;
    }

    .subproduct-price-desktop .price-regular-striked {
        font-size: 15px !important;
    }

    .subproduct-price-desktop .price-discount {
        font-size: 20px !important;
        font-weight: 700;
    }

    .subproduct-attributes {
        flex: 1;
        width: auto;
        order: 2;
        min-width: 0;
    }

    .subproduct-action {
        flex: 0 0 auto;
        width: auto;
        order: 4;
        min-width: 80px;
    }

    .subproduct-action .btn {
        width: auto;
        min-width: 80px;
    }

    .attribute-label {
        font-size: 14px;
    }

    .attribute-label-option {
        font-size: 13px;
    }

    .attribute-value {
        font-size: 13px;
    }
}

/* ===================================
   Medium Desktop Styles (MD and up)
   =================================== */

@media (min-width: 768px) {
    .subproduct-row {
        gap: 20px;
    }

    .subproduct-dimensions {
        min-width: 120px;
    }

    .subproduct-action {
        min-width: 100px;
    }

    .subproduct-action .btn {
        min-width: 100px;
    }
}

/* ===================================
   Compact Mobile Optimization
   =================================== */

@media (max-width: 575px) {
    /* Make main info more prominent on mobile */
    .subproduct-dimensions {
        font-size: 17px !important;
    }

    .subproduct-price-mobile {
        font-size: 17px !important;
    }

    /* Keep selects compact on mobile */
    .filter-choices__inner {
        min-height: 38px;
        padding: 6px 12px;
    }

    /* Make attributes more compact */
    .subproduct-attribute-group {
        margin-bottom: 8px;
        padding: 10px;
        background: #f9f9f9;
        border-radius: 6px;
    }

    .attribute-option {
        margin-bottom: 6px;
    }

    .attribute-label {
        font-size: 14px;
    }

    .attribute-label-option {
        font-size: 13px;
    }

    .attribute-value {
        font-size: 13px;
    }

    /* Tighter spacing */
    .subproduct-row {
        padding: 10px 0;
    }
}
