/* Inline SVG icon base — inherits text color via currentColor */
.hiacp-icon{
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -0.18em;
    line-height: 1;
    pointer-events: none;
}
.hiacp-icon path,
.hiacp-icon circle,
.hiacp-icon line{
    vector-effect: non-scaling-stroke;
}

.hiaddtocart{
    position: relative;
    text-align: center;
    width: 100%;
    top: -.25em;
    padding-top: .475rem;
    min-height: 3.5rem;
    background: #fff;
}
.hiaddtocart .product-quantity:not(.wk-product-quantity):not(.hi-quantity-wrapper){
    width: 50px;
}

/* Quantity wrapper with +/- buttons */
.hiaddtocart .product-quantity.hi-quantity-wrapper{
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    border-radius: 6px;
    overflow: visible !important;
    border: 1px solid #e0e0e0;
    background: #fff;
    transition: border-color 0.2s ease;
}
.hiaddtocart .product-quantity.hi-quantity-wrapper > *{
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}
.hiaddtocart .product-quantity.hi-quantity-wrapper:hover{
    border-color: #d0d0d0;
}
.hiaddtocart .product-quantity.hi-quantity-wrapper:focus-within{
    border-color: #e0e0e0;
}

/* Quantity +/- buttons */
.hiaddtocart .hi-qty-btn{
    flex: 0 0 28px !important;
    height: 36px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: #f5f5f5 !important;
    color: #555 !important;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box !important;
}
.hiaddtocart .hi-qty-btn:hover{
    background: #e8e8e8 !important;
    color: #222 !important;
}
.hiaddtocart .hi-qty-btn:active{
    background: #ddd;
    transform: scale(0.92);
}
.hiaddtocart .hi-qty-btn:focus{
    outline: none;
}
.hiaddtocart .hi-qty-btn.disabled,
.hiaddtocart .hi-qty-btn:disabled{
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: #f9f9f9;
}

/* Plus/minus icon styling */
.hiaddtocart .hi-qty-icon{
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: 15px;
    line-height: 1;
}

/* Separator lines between buttons and input */
.hiaddtocart .hi-qty-down{
    border-right: 1px solid #e0e0e0;
    border-radius: 6px 0 0 6px;
}
.hiaddtocart .hi-qty-up{
    border-left: 1px solid #e0e0e0;
    border-radius: 0 6px 6px 0;
}

/* Quantity input field */
.hiaddtocart .product-quantity.hi-quantity-wrapper input.hi-quantity{
    flex: 0 0 auto;
    width: 34px;
    height: 36px;
    padding: 4px 2px;
    margin: 0;
    border: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.hiaddtocart .product-quantity.hi-quantity-wrapper input.hi-quantity::-webkit-inner-spin-button,
.hiaddtocart .product-quantity.hi-quantity-wrapper input.hi-quantity::-webkit-outer-spin-button{
    -webkit-appearance: none;
    margin: 0;
}
.hiaddtocart .product-quantity.hi-quantity-wrapper input.hi-quantity:focus{
    outline: none;
    background: #f8f9fa;
}

/* Legacy quantity input (without wrapper) */
.hiaddtocart .product-quantity:not(.hi-quantity-wrapper) input.hi-quantity{
    padding: 10px 2px 12px 5px;
    text-align: center;
    background: #eee;
    border: none;
    height: 42px;
}
.hiaddtocart .product-quantity input:focus,
.hiaddtocart .product-quantity input:active{
    outline: none;
}
#products article.product-miniature.js-product-miniature,
article.product-miniature.js-product-miniature{
    margin-bottom: 30px;
}
.hiaddtocart button.btn-primary {
    padding: 0.5rem 0.75rem;
    text-transform: none;
    max-width: calc(100% - 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease;
}
.hiaddtocart button.btn-primary:hover {
    transform: translateY(-1px);
}
.hiaddtocart button.btn-primary:active,
.hiaddtocart button.btn-primary:focus {
    transform: translateY(0);
    outline: none;
    box-shadow: none;
}
.hiaddtocart .hiaddtocart-button-wrapper > .product-quantity.hi-quantity-wrapper + button.btn-primary{
    max-width: none;
    flex: 1 1 auto;
}
.hiaddtocart a.btn-primary {
    text-transform: none;
    height: 34px;
    min-height: 34px;
    padding: 0.5rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: normal;
}
.hiaddtocart a.btn-primary:hover {
    transform: translateY(-1px);
}
.hiaddtocart a.btn-primary:active,
.hiaddtocart a.btn-primary:focus {
    transform: translateY(0);
    outline: none;
    box-shadow: none;
}
/* Disabled / out-of-stock listing buttons — dim for a clear disabled cue */
.hiaddtocart .btn-primary:disabled,
.hiaddtocart .btn-primary.disabled{
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.hiaddtocart button.btn-primary i,
.hiaddtocart button.btn-primary .hiacp-icon {
    margin: 0;
}
.hiaddtocart .bootstrap-touchspin input.hi-quantity{
    height: 2.75rem;
    width: 2.5rem;
}
.hiaddtocart .product-availability{
    display: none;
}
.hiaddtocart .product-availability .product-unavailable{
    color: #ff9a52;
    width: 1.1em;
    height: 1.1em;
}
/* Hide native spin buttons only for quantity wrapper (we have custom +/- buttons) */
.hiaddtocart .hi-quantity-wrapper input[type=number]::-webkit-inner-spin-button,
.hiaddtocart .hi-quantity-wrapper input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hiaddtocart .hi-quantity-wrapper input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Oleafo quantity — full-width info bar above controls row */
.hiaddtocart .hi-oleafoq-bar{
    flex: 0 0 100%;
    order: -1;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    padding: 2px 0 4px;
    line-height: 1.2;
}
.hiaddtocart .hi-oleafoq-wrapper input.hi-quantity-oleafoq{
    flex: 0 0 auto;
    width: 34px;
    height: 36px;
    padding: 4px 2px;
    margin: 0;
    border: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.hiaddtocart .hi-oleafoq-wrapper input.hi-quantity-oleafoq::-webkit-inner-spin-button,
.hiaddtocart .hi-oleafoq-wrapper input.hi-quantity-oleafoq::-webkit-outer-spin-button{
    -webkit-appearance: none;
    margin: 0;
}
.hiaddtocart .hi-oleafoq-wrapper input.hi-quantity-oleafoq:focus{
    outline: none;
    background: #f8f9fa;
}
.hiaddtocart .hi-oleafoq-qty-down{
    border-right: 1px solid #e0e0e0;
    border-radius: 6px 0 0 6px;
}
.hiaddtocart .hi-oleafoq-qty-up{
    border-left: 1px solid #e0e0e0;
    border-radius: 0 6px 6px 0 !important;
}

.hiaddtocart-button-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
}

/* Force all children in quantity wrapper to be inline */
.hiaddtocart .hi-quantity-wrapper .hi-qty-btn,
.hiaddtocart .hi-quantity-wrapper input.hi-quantity {
    display: inline-flex !important;
    float: none !important;
    position: relative !important;
    vertical-align: middle !important;
}

/* Reset any bootstrap/theme button styles */
.hiaddtocart .hi-qty-btn.btn {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Icon-only Add to Cart button */
.hiaddtocart button.btn-primary.hi-icon-only {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    flex: 0 0 38px !important;
    border-radius: 50%;
    border: none;
    position: relative;
    overflow: hidden;
}
.hiaddtocart button.btn-primary.hi-icon-only::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}
.hiaddtocart button.btn-primary.hi-icon-only i,
.hiaddtocart button.btn-primary.hi-icon-only .hiacp-icon {
    font-size: 18px;
    width: 20px;
    height: 20px;
    margin: 0;
    transition: transform 0.2s ease;
    position: relative;
    z-index: 1;
}
.hiaddtocart button.btn-primary.hi-icon-only:hover {
    transform: translateY(-2px);
}
.hiaddtocart button.btn-primary.hi-icon-only:hover i,
.hiaddtocart button.btn-primary.hi-icon-only:hover .hiacp-icon {
    transform: scale(1.1);
}
.hiaddtocart button.btn-primary.hi-icon-only:active,
.hiaddtocart button.btn-primary.hi-icon-only:focus {
    transform: translateY(0) scale(0.95);
    outline: none;
    box-shadow: none;
}

/* Ensure button text doesn't wrap */
/* .hiaddtocart button.btn-primary .hi-btn-text,
.hiaddtocart a.btn-primary {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
} */

/* ============================================
   Listing Add-to-Cart — Loading / Success
   ============================================ */
.hiaddtocart button.btn-primary{
    position: relative;
}
.hi-btn-content{
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s ease;
}
.hi-btn-spinner{
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hiacpListSpin 0.6s linear infinite;
    position: absolute;
}
@keyframes hiacpListSpin{
    to{ transform: rotate(360deg); }
}
.hiaddtocart button.btn-primary.hiacp-btn-loading{
    pointer-events: none;
    opacity: 0.85;
}
.hiaddtocart button.btn-primary.hiacp-btn-loading .hi-btn-content{
    opacity: 0;
}
.hiaddtocart button.btn-primary.hiacp-btn-loading .hi-btn-spinner{
    display: block;
}
.hiaddtocart button.btn-primary.hiacp-btn-success{
    pointer-events: none;
}
.hiaddtocart button.btn-primary.hiacp-btn-success .hi-btn-content{
    opacity: 0;
}
.hiaddtocart button.btn-primary.hiacp-btn-success::after{
    content: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='18'%20height='18'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffff'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E");
    display: inline-flex;
    line-height: 0;
    position: absolute;
}

/* ============================================
   Sticky Add to Cart Bar — Product Pages
   ============================================ */
.hiacp-sticky-bar{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.10);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
    pointer-events: none;
    will-change: transform, opacity;
}
.hiacp-sticky-bar.hiacp-sb-visible{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.hiacp-sb-inner{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 1260px;
    margin: 0 auto;
    padding: 10px 20px;
    position: relative;
}

/* Product image */
.hiacp-sb-image{
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
}
.hiacp-sb-image img{
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* Product name + price */
.hiacp-sb-info{
    flex: 0 1 auto;
    min-width: 0;
    max-width: 220px;
}
.hiacp-sb-name{
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.hiacp-sb-price-wrapper{
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 1px;
}
.hiacp-sb-regular-price{
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}
.hiacp-sb-price{
    font-size: 15px;
    font-weight: 700;
    color: #232323;
}

/* Expand/collapse button (mobile only) */
.hiacp-sb-expand{
    display: none;
}

/* Drawer (mobile expandable attributes panel) — hidden by default */
.hiacp-sb-drawer{
    display: none;
}

/* Desktop inline attributes */
.hiacp-sb-attributes-desktop{
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    justify-content: center;
}
.hiacp-sb-attributes-desktop::-webkit-scrollbar{
    height: 3px;
}
.hiacp-sb-attributes-desktop::-webkit-scrollbar-thumb{
    background: #ccc;
    border-radius: 3px;
}
.hiacp-sb-compact-mode .hiacp-sb-attributes-desktop{
    overflow: visible;
}
.hiacp-sb-attribute-group{
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}
.hiacp-sb-attribute-label{
    font-size: 12px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    margin: 0;
}
.hiacp-sb-attribute-select{
    height: 34px;
    padding: 0 28px 0 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
    transition: border-color 0.2s ease;
    min-width: 80px;
}
.hiacp-sb-attribute-select:hover{
    border-color: #bbb;
}
.hiacp-sb-attribute-select:focus{
    outline: none;
    border-color: #2fb5d2;
    box-shadow: 0 0 0 2px rgba(47,181,210,0.15);
}

/* Custom compact dropdown */
.hiacp-sb-compact-dd{
    position: relative;
    min-width: 200px;
    max-width: 380px;
}
.hiacp-sb-compact-trigger{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}
.hiacp-sb-compact-trigger:hover{
    border-color: #bbb;
}
.hiacp-sb-compact-dd.hiacp-sb-compact-open .hiacp-sb-compact-trigger{
    border-color: #2fb5d2;
    box-shadow: 0 0 0 2px rgba(47,181,210,0.15);
}
.hiacp-sb-compact-trigger-text{
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hiacp-sb-compact-arrow{
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666;
    transition: transform 0.2s ease;
}
.hiacp-sb-compact-dd.hiacp-sb-compact-open .hiacp-sb-compact-arrow{
    transform: rotate(180deg);
}

/* Options panel — drops UP from sticky bar */
.hiacp-sb-compact-list{
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin: 0 0 4px 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    z-index: 10;
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: max-content;
    min-width: 100%;
    max-width: min(580px, 90vw);
}
.hiacp-sb-compact-dd.hiacp-sb-compact-open .hiacp-sb-compact-list{
    display: block;
}
.hiacp-sb-compact-item{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.hiacp-sb-compact-item:hover{
    background: #f5f7f9;
}
.hiacp-sb-compact-item.hiacp-sb-compact-active{
    background: #f0f8fa;
}
.hiacp-sb-compact-item-label{
    flex: 1 1 auto;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hiacp-sb-compact-item-prices{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.hiacp-sb-compact-item-price{
    font-size: 14px;
    font-weight: 700;
    color: #232323;
}
.hiacp-sb-compact-item-regular{
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}
.hiacp-sb-compact-item-discount{
    display: inline-block;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #21b18a;
    border-radius: 4px;
    line-height: 1.4;
}

/* Out of stock items */
.hiacp-sb-compact-item.hiacp-sb-compact-oos{
    opacity: 0.5;
    cursor: not-allowed;
}
.hiacp-sb-compact-item.hiacp-sb-compact-oos:hover{
    background: transparent;
}
.hiacp-sb-compact-item-oos{
    flex: 0 0 auto;
    font-size: 11px;
    color: #c44;
    font-style: italic;
}

/* Quantity input */
.hiacp-sb-quantity{
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s ease;
    flex: 0 0 auto;
}
.hiacp-sb-quantity:hover{
    border-color: #bbb;
}
.hiacp-sb-qty-btn{
    width: 30px;
    height: 34px;
    border: none;
    background: #f5f5f5;
    color: #555;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.hiacp-sb-qty-btn:hover{
    background: #e8e8e8;
    color: #222;
}
.hiacp-sb-qty-btn:active{
    background: #ddd;
    transform: scale(0.92);
}
.hiacp-sb-qty-btn.disabled{
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.hiacp-sb-qty-down{
    border-right: 1px solid #e0e0e0;
}
.hiacp-sb-qty-up{
    border-left: 1px solid #e0e0e0;
}
.hiacp-sb-qty-input{
    width: 38px;
    height: 34px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
}
.hiacp-sb-qty-input::-webkit-inner-spin-button,
.hiacp-sb-qty-input::-webkit-outer-spin-button{
    -webkit-appearance: none;
    margin: 0;
}
.hiacp-sb-qty-input:focus{
    outline: none;
    background: #f8f9fa;
}

/* Add to Cart button */
.hiacp-sb-add-to-cart{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 6px;
    background: #2fb5d2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    min-width: 150px;
}
.hiacp-sb-btn-content{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease;
}
.hiacp-sb-add-to-cart i,
.hiacp-sb-add-to-cart .hiacp-icon{
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff;
}
/* Icon-only sticky add-to-cart */
.hiacp-sb-add-to-cart.hiacp-sb-icon-only{
    min-width: 0;
    width: 40px;
    flex: 0 0 40px;
    padding: 0;
    border-radius: 50%;
}
.hiacp-sb-add-to-cart.hiacp-sb-icon-only .hiacp-sb-btn-content{
    gap: 0;
}
.hiacp-sb-add-to-cart:hover{
    background: #29a0b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47,181,210,0.3);
}
.hiacp-sb-add-to-cart:active{
    transform: translateY(0);
    box-shadow: none;
}
.hiacp-sb-add-to-cart:disabled{
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner (hidden by default) */
.hiacp-sb-spinner{
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hiacpSbSpin 0.6s linear infinite;
    position: absolute;
}
@keyframes hiacpSbSpin{
    to{ transform: rotate(360deg); }
}

/* Loading state */
.hiacp-sb-add-to-cart.hiacp-sb-loading{
    pointer-events: none;
    opacity: 0.85;
}
.hiacp-sb-add-to-cart.hiacp-sb-loading .hiacp-sb-btn-content{
    opacity: 0;
}
.hiacp-sb-add-to-cart.hiacp-sb-loading .hiacp-sb-spinner{
    display: block;
}

/* Success flash — icon swap only */
.hiacp-sb-add-to-cart.hiacp-sb-success .hiacp-sb-btn-content{
    opacity: 0;
}
.hiacp-sb-add-to-cart.hiacp-sb-success::after{
    content: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffff'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E");
    display: inline-flex;
    line-height: 0;
    position: absolute;
}

/* Unavailable state — dimmed (keeps custom/default color), text swap */
.hiacp-sb-add-to-cart.hiacp-sb-unavailable{
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    transform: none;
}

/* Attention animations for sticky bar button */
@keyframes hiacpShake{
    0%, 100%{ transform: translateX(0); }
    15%{ transform: translateX(-3px); }
    30%{ transform: translateX(3px); }
    45%{ transform: translateX(-2px); }
    60%{ transform: translateX(2px); }
    75%{ transform: translateX(-1px); }
}
@keyframes hiacpPulse{
    0%, 100%{ transform: scale(1); }
    50%{ transform: scale(1.07); }
}
@keyframes hiacpGlow{
    0%, 100%{ box-shadow: 0 0 0 0 rgba(47,181,210,0); }
    50%{ box-shadow: 0 0 14px 4px rgba(47,181,210,0.45); }
}
@keyframes hiacpWiggle{
    0%, 100%{ transform: rotate(0deg); }
    20%{ transform: rotate(-2deg); }
    40%{ transform: rotate(2.5deg); }
    60%{ transform: rotate(-1.5deg); }
    80%{ transform: rotate(1deg); }
}
@keyframes hiacpBounce{
    0%, 100%{ transform: translateY(0); }
    40%{ transform: translateY(-4px); }
    60%{ transform: translateY(-2px); }
}
@keyframes hiacpRubber{
    0%, 100%{ transform: scaleX(1) scaleY(1); }
    30%{ transform: scaleX(1.12) scaleY(0.9); }
    50%{ transform: scaleX(0.95) scaleY(1.04); }
    70%{ transform: scaleX(1.03) scaleY(0.97); }
}
.hiacp-sb-add-to-cart.hiacp-anim-shake{ animation: hiacpShake 0.8s ease; }
.hiacp-sb-add-to-cart.hiacp-anim-pulse{ animation: hiacpPulse 1s ease; }
.hiacp-sb-add-to-cart.hiacp-anim-glow{ animation: hiacpGlow 1.4s ease; }
.hiacp-sb-add-to-cart.hiacp-anim-wiggle{ animation: hiacpWiggle 0.8s ease; }
.hiacp-sb-add-to-cart.hiacp-anim-bounce{ animation: hiacpBounce 0.8s ease; }
.hiacp-sb-add-to-cart.hiacp-anim-rubber{ animation: hiacpRubber 0.9s ease; }

/* Close button */
.hiacp-sb-close{
    position: absolute;
    top: -8px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.hiacp-sb-close i{
    font-size: 14px;
}
.hiacp-sb-close .hiacp-icon{
    width: 14px;
    height: 14px;
}
.hiacp-sb-close:hover{
    color: #333;
    border-color: #ccc;
    background: #f5f5f5;
}

/* Responsive — tablet */
@media (max-width: 991px){
    .hiacp-sb-inner{
        gap: 10px;
        padding: 8px 14px;
    }
    .hiacp-sb-info{
        max-width: 150px;
    }
    .hiacp-sb-attributes-desktop .hiacp-sb-attribute-label{
        display: none;
    }
}

/* Responsive — desktop */
@media (min-width: 768px){
    .hiacp-sb-no-desktop{
        display: none !important;
    }
}

/* Responsive — mobile */
@media (max-width: 767px){
    .hiacp-sb-no-mobile{
        display: none !important;
    }
    .hiacp-sb-inner{
        gap: 8px;
        padding: 8px 12px;
    }
    .hiacp-sb-name{
        display: none;
    }
    .hiacp-sb-info{
        max-width: none;
        flex: 0 0 auto;
    }
    .hiacp-sb-attributes-desktop{
        display: none;
    }
    .hiacp-sb-image{
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }
    .hiacp-sb-image img{
        width: 40px;
        height: 40px;
    }
    .hiacp-sb-btn-text{
        display: none;
    }
    .hiacp-sb-add-to-cart{
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        border-radius: 50%;
    }
    .hiacp-sb-add-to-cart i,
    .hiacp-sb-add-to-cart .hiacp-icon{
        margin: 0;
    }
    .hiacp-sb-close{
        top: -6px;
        right: 4px;
        width: 22px;
        height: 22px;
    }
    .hiacp-sb-close i{
        font-size: 12px;
    }
    .hiacp-sb-close .hiacp-icon{
        width: 12px;
        height: 12px;
    }

    /* Expand toggle arrow (visible only on mobile when attrs exist) */
    .hiacp-sb-has-attrs .hiacp-sb-expand{
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: -18px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 18px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-bottom: none;
        border-radius: 8px 8px 0 0;
        cursor: pointer;
        z-index: 2;
        padding: 0;
        box-shadow: 0 -2px 6px rgba(0,0,0,0.06);
        transition: background 0.2s ease;
    }
    .hiacp-sb-has-attrs .hiacp-sb-expand:hover{
        background: #f5f5f5;
    }
    .hiacp-sb-has-attrs .hiacp-sb-expand i,
    .hiacp-sb-has-attrs .hiacp-sb-expand .hiacp-icon{
        font-size: 18px;
        width: 18px;
        height: 18px;
        color: #555;
        line-height: 1;
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .hiacp-sb-has-attrs.hiacp-sb-expanded .hiacp-sb-expand i,
    .hiacp-sb-has-attrs.hiacp-sb-expanded .hiacp-sb-expand .hiacp-icon{
        transform: rotate(180deg);
    }

    /* Drawer panel — slides up from behind the main bar */
    .hiacp-sb-has-attrs .hiacp-sb-drawer{
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s ease;
        background: #fafafa;
        border-top: 1px solid #eee;
        padding: 0 14px;
    }
    .hiacp-sb-has-attrs.hiacp-sb-expanded .hiacp-sb-drawer{
        max-height: 45vh;
        padding: 12px 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .hiacp-sb-drawer-inner{
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .hiacp-sb-drawer .hiacp-sb-attribute-group{
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .hiacp-sb-drawer .hiacp-sb-attribute-label{
        font-size: 12px;
        font-weight: 600;
        color: #555;
        white-space: nowrap;
        margin: 0;
        min-width: 50px;
    }
    .hiacp-sb-drawer .hiacp-sb-attribute-select{
        flex: 1;
        min-width: 0;
        height: 36px;
        padding: 0 28px 0 10px;
        font-size: 14px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
        color: #333;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 10px 6px;
    }
    .hiacp-sb-compact-mode.hiacp-sb-has-attrs.hiacp-sb-expanded .hiacp-sb-drawer{
        overflow: visible;
    }
    .hiacp-sb-drawer .hiacp-sb-compact-dd{
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    .hiacp-sb-drawer .hiacp-sb-compact-trigger{
        height: 38px;
        font-size: 14px;
        background: #fff;
    }
    .hiacp-sb-drawer .hiacp-sb-compact-list{
        bottom: auto;
        top: 100%;
        margin: 4px 0 0 0;
        width: auto;
        min-width: 0;
        max-width: none;
        left: 0;
        right: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    }
    .hiacp-sb-compact-item{
        flex-wrap: wrap;
    }
}

/* ============================================
   Add-to-Cart Animations Library
   ============================================ */

/* Sparkles burst */
.hiacp-sparkles-container{
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: visible;
}
.hiacp-sparkle{
    will-change: transform, opacity;
}

/* Fly-to-cart — arc flight (positioned via transform in JS) */
.hiacp-fly-to-cart{
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    pointer-events: none;
    border-radius: 12px;
    overflow: visible;
    will-change: transform, width, height, opacity;
    transform-origin: center center;
}
.hiacp-fly-to-cart-ring{
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 3px solid rgba(47, 181, 210, 0.55);
    box-shadow: 0 0 0 4px rgba(47, 181, 210, 0.12), 0 12px 32px rgba(0, 0, 0, 0.22);
    animation: hiacpFlyRingPulse 0.35s ease-out;
    pointer-events: none;
}
@keyframes hiacpFlyRingPulse{
    0%{ transform: scale(0.85); opacity: 0.4; }
    100%{ transform: scale(1); opacity: 1; }
}
.hiacp-fly-to-cart-img{
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.hiacp-fly-to-cart-img img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (max-width: 767px){
    .hiacp-fly-to-cart{
        border-radius: 10px;
    }
    .hiacp-fly-to-cart-img{
        border-radius: 10px;
    }
}