/**
 * Multi Accessories Pro - Modern Card UI Stylesheet
 * Scoped to .hsma_accessory_grid, .hsma_accessory_card, and .hsma_dropdown_card
 * Layout: Compact Row with Thumbnail on Left, Checkbox Top-Right, Inline Actions Flow
 */

:root {
    --hsma-primary: #2fb5d2;
    --hsma-primary-light: #f0faff;
    --hsma-primary-border: #2fb5d2;
    --hsma-card-bg: #ffffff;
    --hsma-card-border: #e1e6eb;
    --hsma-card-radius: 6px;
    --hsma-card-gap: 8px;
    --hsma-card-padding: 12px 12px;
    --hsma-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --hsma-card-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.09);
    --hsma-text-color: #232323;
    --hsma-text-muted: #7a7a7a;
    --hsma-discount-bg: #e53935;
    --hsma-discount-color: #ffffff;
    --hsma-locked-bg: #fff3e0;
    --hsma-locked-color: #e65100;
}

/* Grid / List Container: vertical stack of compact rows */
.hsma_accessory_grid {
    display: flex;
    flex-direction: column;
    gap: var(--hsma-card-gap);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Accessory Card / Compact Row (Checkbox, Radio & Dropdown) */
.hsma_accessory_card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: var(--hsma-card-bg);
    border: 1px solid var(--hsma-card-border);
    border-radius: var(--hsma-card-radius);
    padding: var(--hsma-card-padding);
    box-shadow: var(--hsma-card-shadow);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    min-width: 0;
    width: 100%;
    margin-top: 5px;
}

.hsma_accessory_card:hover {
    border-color: #b8c3cd;
    box-shadow: var(--hsma-card-shadow-hover);
}

.hsma_accessory_card.is_selected {
    border-color: var(--hsma-primary-border);
    background-color: var(--hsma-primary-light);
    box-shadow: 0 2px 6px rgba(47, 181, 210, 0.12);
}

.hsma_accessory_card.is_selection_locked {
    border-color: #ffe0b2;
    background-color: #fffdfa;
}

.hsma_accessory_card.is_unavailable {
    background-color: #f9f9f9;
    border-color: #ececec;
    cursor: default;
}

.hsma_accessory_card:focus-within {
    outline: 2px solid var(--hsma-primary);
    outline-offset: 1px;
}

/* Card Media / Thumbnail on the Left */
.hsma_card_media {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}

@media (min-width: 768px) {
    .hsma_card_media {
        width: 56px;
        height: 56px;
    }
}

.hsma_card_media img.accessory_image,
.hsma_card_media img.product_img_link {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Card Body (holds header + action row) */
.hsma_card_body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Row 1: Header (Title on left, Checkbox on right) */
.hsma_card_header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.hsma_card_title {
    cursor: default;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: var(--hsma-text-color);
    flex: 1 1 auto;
    min-width: 0;
    word-break: normal;
    overflow-wrap: break-word;
}

.hsma_card_title a.ma_accessory_name {
    color: inherit;
    text-decoration: none;
}

.hsma_card_title a.ma_accessory_name:hover {
    color: var(--hsma-primary);
    text-decoration: underline;
}

/* Checkbox / Radio Selector at Top Right */
.hsma_card_selector {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px;
}

.hsma_card_selector input.accessory_item {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

/* Row 2: Controls & Pricing Flow: [Qty] -> [Combinations] -> [Price] -> [Custom/Pack/Cart] */
.hsma_card_row_actions,
.hsma_card_actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Quantity Input Block */
.hsma_accessory_card .ma_block_qty,
.hsma_dropdown_card .ma_block_qty {
    display: inline-flex;
    align-items: stretch;
    position: relative;
    height: 34px;
    vertical-align: middle;
    width: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    float: none;
    flex-shrink: 0;
}

.hsma_accessory_card .ma_block_qty input.custom_quantity,
.hsma_accessory_card .ma_block_qty input.hsma_qty_input,
.hsma_dropdown_card .ma_block_qty input.custom_quantity,
.hsma_dropdown_card .ma_block_qty input.hsma_qty_input {
    width: 44px;
    height: 34px;
    line-height: 32px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px 0 0 4px;
    padding: 0 4px;
    margin: 0;
    box-sizing: border-box;
    background: #fff;
    color: var(--hsma-text-color, #232323);
    float: left;
    box-shadow: none;
}

.hsma_accessory_card .ma_block_qty input:disabled,
.hsma_accessory_card .ma_block_qty input[disabled],
.hsma_dropdown_card .ma_block_qty input:disabled,
.hsma_dropdown_card .ma_block_qty input[disabled] {
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 34px;
    position: relative;
    float: left;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    vertical-align: top;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 17px;
    flex: 1 1 50%;
    min-height: 0;
    line-height: 1;
    padding: 0;
    margin: 0 0 0 -1px;
    border: 1px solid #ced4da;
    background: #f8f9fa;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    outline: none;
    box-shadow: none;
    overflow: hidden;
    float: none;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:not(:disabled):not([disabled]):hover,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:not(:disabled):not([disabled]):hover {
    background: #e9ecef;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:disabled,
.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin[disabled],
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:disabled,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin[disabled] {
    cursor: not-allowed;
    background: #f8f9fa;
    opacity: 0.65;
    pointer-events: auto;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-up,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-up {
    border-radius: 0 4px 0 0;
    border-bottom: 0;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-down,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-down {
    border-radius: 0 0 4px 0;
    margin-top: 0;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical i,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical i {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    color: #555;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:disabled i,
.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin[disabled] i,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:disabled i,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin[disabled] i {
    cursor: not-allowed;
    color: #888;
}

.hsma_accessory_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:not(:disabled):not([disabled]):hover i,
.hsma_dropdown_card .ma_block_qty .ma_block_qty_vertical .btn-touchspin:not(:disabled):not([disabled]):hover i {
    color: #111;
}

/* Combinations Dropdown */
.hsma_card_combinations {
    display: inline-flex;
    align-items: center;
}

.hsma_card_combinations select.product-combination {
    width: auto;
    min-width: 120px;
    max-width: 260px;
    height: 34px;
    line-height: 32px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 2px 6px;
    background-color: #fff;
    color: var(--hsma-text-color);
    box-sizing: border-box;
    vertical-align: middle;
}

.hsma_card_combinations .dd-container {
    margin-bottom: 0;
}

.hsma_card_combinations .dd-select {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 24px 0 8px;
    line-height: normal;
    border-radius: 4px;
    box-sizing: border-box;
}

.hsma_card_combinations .dd-selected {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 0;
    margin: 0;
    line-height: normal;
    box-sizing: border-box;
}

.hsma_card_combinations .dd-selected label,
.hsma_card_combinations .dd-selected .dd-selected-text {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: normal;
}

/* Pricing Region */
.hsma_card_pricing {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.3;
}

.hsma_price_base {
    color: var(--hsma-text-color);
    font-weight: 500;
}

.hsma_price_base.line_though {
    text-decoration: line-through;
    color: var(--hsma-text-muted);
}

.hsma_price_final {
    color: #e53935;
    font-weight: 700;
}

.hsma_badge_discount {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 5px;
    background: linear-gradient(135deg, #f03e3e 0%, #d32f2f 100%);
    color: #ffffff;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(211, 47, 47, 0.28);
    white-space: nowrap;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hsma_badge_discount::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.hsma_badge_discount:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(211, 47, 47, 0.35);
}

.hsma_accessory_card .hsma_badge_discount,
.hsma_dropdown_card .hsma_badge_discount,
.hsma_dropdown_card .dd-container .hsma_badge_discount,
.hsma_dropdown_card .dd-option .hsma_badge_discount,
.hsma_dropdown_card .dd-selected .hsma_badge_discount {
    display: none !important;
}

/* Corner Notch Discount Tag - Attached directly to card border */
.hsma_corner_discount_tag {
    position: absolute;
    top: -1px;
    left: -1px;
    z-index: 5;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px 3px 7px;
    background: linear-gradient(135deg, #f03e3e 0%, #d32f2f 100%);
    color: #ffffff;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
    border-top-left-radius: var(--hsma-card-radius, 6px);
    border-bottom-right-radius: 6px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    box-shadow: 1px 1px 4px rgba(211, 47, 47, 0.35);
    white-space: nowrap;
}

.hsma_corner_discount_tag::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Slider Corner Discount Tag: Top-Right */
.accessory_silder .slide .hsma_slider_discount_tag {
    top: 0;
    right: 0;
    left: auto;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 6px;
    border-top-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: -1px 1px 4px rgba(211, 47, 47, 0.35);
}

[dir="rtl"] .accessory_silder .slide .hsma_slider_discount_tag {
    right: auto;
    left: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 4px;
    border-bottom-right-radius: 6px;
    box-shadow: 1px 1px 4px rgba(211, 47, 47, 0.35);
}

.hsma_badge_locked {
    display: inline-block;
    padding: 1px 6px;
    background: var(--hsma-locked-bg);
    color: var(--hsma-locked-color);
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* Actions: Customization & Package Links */
.hsma_customize,
.hsma_package {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #008000;
    font-weight: 500;
    line-height: normal;
    height: auto;
    text-decoration: none;
    cursor: pointer;
    gap: 3px;
}

.hsma_customize:hover,
.hsma_package:hover {
    color: #004d00;
    background: transparent;
    border: none;
    text-decoration: none;
}

.hsma_accessory_card [class*="hsma_customize_group_"],
.hsma_accessory_card [class*="hsma_package_group_"],
.hsma_dropdown_card [class*="hsma_customize_group_"],
.hsma_dropdown_card [class*="hsma_package_group_"] {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Required Customization Warning Icon */
#group_accessories .hsma_accessory_card span.hsma_warning_red,
#group_accessories .hsma_dropdown_card span.hsma_warning_red {
    display: inline-block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0 0 0 3px;
    vertical-align: middle;
    background: url("../img/required.gif") no-repeat center center;
    background-size: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

#group_accessories span.hsma_warning_red.hide,
#group_accessories .hide span.hsma_warning_red {
    display: none;
}

#group_accessories .hsma_accessory_card span.hsma_warning,
#group_accessories .hsma_dropdown_card span.hsma_warning {
    display: inline-block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0 0 0 3px;
    vertical-align: middle;
    background: url("../img/warning.png") no-repeat center center;
    background-size: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

/* ============================================================
   Dropdown Display Style (Modern Card Row)
   ============================================================ */
.hsma_dropdown_grid {
    display: flex;
    flex-direction: column;
    gap: var(--hsma-card-gap);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.hsma_dropdown_card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    background: var(--hsma-card-bg);
    border: 1px solid var(--hsma-card-border);
    border-radius: var(--hsma-card-radius);
    padding: var(--hsma-card-padding);
    box-shadow: var(--hsma-card-shadow);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.hsma_dropdown_card:hover {
    border-color: #b8c3cd;
    box-shadow: var(--hsma-card-shadow-hover);
}

.hsma_dropdown_card.is_selected {
    border-color: var(--hsma-primary-border);
    background-color: var(--hsma-primary-light);
    box-shadow: 0 2px 6px rgba(47, 181, 210, 0.12);
}

.hsma_dropdown_card .dropdown-image.hsma_card_media {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    padding: 0;
    margin-top: 2px;
}

@media (min-width: 768px) {
    .hsma_dropdown_card .dropdown-image.hsma_card_media {
        width: 56px;
        height: 56px;
    }
}

.hsma_dropdown_card .dropdown-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.hsma_dropdown_card .hsma_card_body.dropdown-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: none;
}

.hsma_dropdown_card .accessory_dropdown_wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

/* Row 1: Quantity Box + Customization + Package Content */
.hsma_dropdown_card .hsma_dropdown_meta_row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    min-height: 0;
}

/* Dropdown Controls Width and container sizing */
.hsma_dropdown_card select.accessories_group,
.hsma_dropdown_card .accessories_group_combination,
.hsma_dropdown_card [id^="combination_"],
.hsma_dropdown_card .display_combination,
.hsma_dropdown_card select.product-combination,
.hsma_dropdown_card .product-combination {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ddSlick JS sets inline width (style="width: 260px;").
   We override inline width strictly here so dropdown adapts responsively to card container. */
.hsma_dropdown_card .accessory_dropdown_wrap .dd-container,
.hsma_dropdown_card .accessory_dropdown_wrap .dd-select,
.hsma_dropdown_card .accessory_dropdown_wrap .dd-options {
    width: 100% !important;
    max-width: 100% !important;
}

/* Override legacy multiaccessoriespro.min.css styles */
.hsma_dropdown_card .accessory_dropdown_wrap.has_input_quantity select.accessories_group,
.hsma_dropdown_card .accessory_dropdown_wrap.has_input_quantity select.product-combination,
.hsma_dropdown_card .accessory_dropdown_wrap select.accessories_group,
.hsma_dropdown_card .accessory_dropdown_wrap select.product-combination,
.hsma_dropdown_card .accessory_dropdown_wrap .accessories_group_combination select.product-combination,
.hsma_dropdown_card .accessory_dropdown_wrap [id^="combination_"] select {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* ddSlick Component Styling */
.hsma_dropdown_card .dd-container {
    position: relative;
    margin: 0;
    box-sizing: border-box;
}

.hsma_dropdown_card .dd-select {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 32px 0 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    position: relative;
    cursor: pointer;
    margin: 0;
}

.hsma_dropdown_card .dd-selected {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 0;
    margin: 0;
    line-height: normal;
    font-weight: 500;
    color: var(--hsma-text-color, #232323);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.hsma_dropdown_card .dd-selected:hover,
.hsma_dropdown_card .dd-selected:focus {
    text-decoration: none;
}

.hsma_dropdown_card .dd-selected label,
.hsma_dropdown_card .dd-selected .dd-selected-text {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: normal;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    gap: 4px;
}

.hsma_dropdown_card .dd-selected span {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0 2px;
    line-height: normal;
    vertical-align: middle;
}

.hsma_dropdown_card .dd-selected span.discount_price,
.hsma_dropdown_card .dd-selected .discount_price {
    color: #e07b39;
    font-weight: 600;
}

.hsma_dropdown_card .dd-selected-image {
    margin-right: 6px;
    vertical-align: middle;
    max-height: 22px;
    max-width: 22px;
    flex-shrink: 0;
}

.hsma_dropdown_card .dd-pointer {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    border-bottom: none;
}

.hsma_dropdown_card .dd-pointer.dd-pointer-up {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #333;
    border-top: none;
}

.hsma_dropdown_card .dd-options {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border: 1px solid #ced4da;
    border-radius: 6px;
    max-height: 320px;
    box-sizing: border-box;
    overflow-y: auto;
    width: 100% !important;
}

.hsma_dropdown_card .dd-options::-webkit-scrollbar {
    width: 6px;
}

.hsma_dropdown_card .dd-options::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 3px;
}

.hsma_dropdown_card .dd-options::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}

.hsma_dropdown_card .dd-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    min-height: 56px;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
    box-sizing: border-box;
    position: relative;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.hsma_dropdown_card .dd-options > li:last-child > .dd-option {
    border-bottom: none;
}

.hsma_dropdown_card .dd-option:hover {
    background-color: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

.hsma_dropdown_card .dd-option-selected {
    background-color: #f0f7f9;
}

.hsma_dropdown_card .dd-option label,
.hsma_dropdown_card .dd-option .dd-option-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
    line-height: 1.45 !important;
    font-weight: 500;
    color: var(--hsma-text-color, #232323);
    cursor: pointer;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.hsma_dropdown_card .dd-option .dd-product-name {
    display: inline;
    white-space: normal;
}

.hsma_dropdown_card .dd-option .dd-price-wrap {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 4px;
    vertical-align: baseline;
    margin-left: 2px;
}

.hsma_dropdown_card .dd-option span {
    display: inline-block;
    vertical-align: baseline;
    line-height: normal;
}

.hsma_dropdown_card .dd-option span[style*="line-through"] {
    color: #8c8c8c !important;
    margin-right: 4px;
    font-size: 0.95em;
}

.hsma_dropdown_card .dd-option span.discount_price {
    color: #e07b39;
    font-weight: 600;
}

.hsma_dropdown_card .dd-option-image {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
    margin: 0 12px 0 0;
    float: none;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Out of Stock & Warning Icons */
span.forbidden_ordering,
span.warning_out_of_stock {
    display: inline-block;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0 0 0 6px;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 16px 16px;
    box-sizing: border-box;
    flex-shrink: 0;
    line-height: 1;
}

span.forbidden_ordering {
    background-image: url("../img/forbidden.png");
    cursor: not-allowed;
}

span.warning_out_of_stock {
    background-image: url("../img/warning.png");
    cursor: default;
}

/* Prohibited ordering state */
.forbidden_ordering,
span.forbidden_ordering,
.hsma_dropdown_card .dd-option.forbidden_ordering,
.hsma_dropdown_card .dd-option.dd-option-disabled,
select.accessories_group option.forbidden_ordering,
select.accessories_group option.sforbidden_ordering,
select.product-combination option.forbidden_ordering,
select.product-combination option.sforbidden_ordering {
    cursor: not-allowed;
}

.hsma_dropdown_card .dd-option.forbidden_ordering,
.hsma_dropdown_card .dd-option.dd-option-disabled {
    opacity: 0.65;
    background-color: #fafafa;
}

.hsma_dropdown_card .dd-option.forbidden_ordering:hover,
.hsma_dropdown_card .dd-option.dd-option-disabled:hover {
    background-color: #f1f3f5;
}

/* Native Select Styling (when ddSlick is not used) */
.hsma_dropdown_card select.accessories_group,
.hsma_dropdown_card select.product-combination,
.hsma_dropdown_card .accessories_group_combination select.product-combination,
.hsma_dropdown_card [id^="combination_"] select {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 36px;
    padding: 0 32px 0 10px;
    line-height: 34px;
    font-weight: 500;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    color: var(--hsma-text-color, #232323);
    box-sizing: border-box;
    vertical-align: middle;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%226%22%20viewBox%3D%220%200%2010%206%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M0%200l5%206%205-6z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 8px 5px;
}

/* Row 3 Container */
.hsma_dropdown_card .accessories_group_combination,
.hsma_dropdown_card [id^="combination_"],
.hsma_dropdown_card .display_combination {
    margin: 0;
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

.hsma_dropdown_card .accessories_group_combination:empty,
.hsma_dropdown_card [id^="combination_"]:empty {
    display: none;
}

/* Radio None Card */
.hsma_card_none {
    align-items: center;
    padding: 8px 12px;
}

.hsma_card_none .ma_none_option {
    font-weight: 600;
    color: var(--hsma-text-muted);
}

/* RTL Support */
[dir="rtl"] .hsma_accessory_card {
    text-align: right;
}

[dir="rtl"] .hsma_card_selector {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .hsma_card_row_actions,
[dir="rtl"] .hsma_card_actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .hsma_dropdown_card .accessory_dropdown_wrap {
    flex-direction: column;
    align-items: stretch;
}

[dir="rtl"] .hsma_dropdown_card .hsma_dropdown_meta_row {
    flex-direction: row-reverse;
}

[dir="rtl"] .ma_block_qty input.custom_quantity,
[dir="rtl"] .ma_block_qty input.hsma_qty_input {
    border-radius: 0 4px 4px 0;
    float: right;
}

[dir="rtl"] .ma_block_qty .ma_block_qty_vertical {
    float: right;
}

[dir="rtl"] .ma_block_qty .ma_block_qty_vertical > .btn,
[dir="rtl"] .ma_block_qty .ma_block_qty_vertical .btn-touchspin {
    margin-left: 0;
    margin-right: -1px;
}

[dir="rtl"] .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-up {
    border-radius: 4px 0 0 0;
}

[dir="rtl"] .ma_block_qty .ma_block_qty_vertical .bootstrap-touchspin-down {
    border-radius: 0 0 0 4px;
}

[dir="rtl"] .hsma_dropdown_card select.accessories_group,
[dir="rtl"] .hsma_dropdown_card select.product-combination,
[dir="rtl"] .hsma_dropdown_card .accessories_group_combination select.product-combination,
[dir="rtl"] .hsma_dropdown_card [id^="combination_"] select {
    padding: 0 10px 0 32px;
    background-position: left 12px center;
}

[dir="rtl"] .hsma_dropdown_card .dd-select {
    padding: 0 10px 0 32px;
}

[dir="rtl"] .hsma_dropdown_card .dd-pointer {
    right: auto;
    left: 12px;
}

[dir="rtl"] .hsma_dropdown_card .dd-option-image {
    margin-left: 12px;
    margin-right: 0;
}

[dir="rtl"] span.forbidden_ordering,
[dir="rtl"] span.warning_out_of_stock {
    margin: 0 6px 0 0;
}
