/* WooCommerce Variable Product Decoupler Styles */

/* ===== Variations Selection Wrapper ===== */
.woo-decoupler-variations-wrapper {
    /* Margin/padding controlled via Elementor */
}

.woo-decoupler-variations-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Attribute Fields */
.woo-decoupler-attribute-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.woo-decoupler-attribute-field label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.woo-decoupler-attribute-field .required {
    color: #e74c3c;
    font-weight: bold;
}

/* Premium Custom Dropdown */
.premium-dropdown-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.premium-dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    min-height: 44px;
    box-sizing: border-box;
}

.premium-dropdown-trigger:hover {
    border-color: #aaa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.premium-dropdown-trigger.open {
    border-color: #007cba;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.premium-dropdown-trigger .trigger-label {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.premium-dropdown-trigger .trigger-price {
    margin-left: auto;
    margin-right: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.premium-dropdown-trigger .trigger-price del {
    opacity: 0.6;
    margin-right: 8px;
    font-size: 0.9em;
}

.premium-dropdown-trigger .trigger-price ins {
    text-decoration: none;
    font-weight: 700;
    color: #e62e2e;
}

.premium-dropdown-trigger .trigger-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.premium-dropdown-trigger.open .trigger-arrow {
    transform: rotate(-135deg);
    margin-bottom: -4px;
}

.premium-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #ddd;
    border-top: none;
    background: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.premium-dropdown-list.open {
    display: block;
}

.premium-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.premium-dropdown-item:last-child {
    border-bottom: none;
}

.premium-dropdown-item:hover {
    background: #f9f9f9;
}

.premium-dropdown-item.active {
    background: #f0f7ff;
}

.premium-dropdown-item .item-label {
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    margin-right: 15px;
}

.premium-dropdown-item .item-price {
    font-size: 13px;
}

.premium-dropdown-item .item-price del {
    opacity: 0.6;
    margin-right: 8px;
    font-size: 0.9em;
}

.premium-dropdown-item .item-price ins {
    text-decoration: none;
    font-weight: 700;
}

/* Hide old standard select styling if it's there */
.woo-decoupler-attribute-field select.premium-init {
    display: none !important;
}

/* Standard Dropdown */
.woo-decoupler-attribute-field select {
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-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%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23666%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.woo-decoupler-attribute-field select:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

/* ===== Swatch Styles ===== */
.woo-decoupler-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Color Swatches */
.woo-decoupler-swatches.color .swatch {
    position: relative;
    cursor: pointer;
}

.woo-decoupler-swatches.color .swatch input {
    display: none;
}

.woo-decoupler-swatches.color .swatch-color-box {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.woo-decoupler-swatches.color .swatch input:checked+.swatch-color-box {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.2);
    transform: scale(1.1);
}

.woo-decoupler-swatches.color .swatch-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    text-align: center;
    color: #666;
}

/* Image Swatches */
.woo-decoupler-swatches.image .swatch {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.woo-decoupler-swatches.image .swatch input {
    display: none;
}

.woo-decoupler-swatches.image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.woo-decoupler-swatches.image .swatch input:checked+img {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.2);
    transform: scale(1.05);
}

.woo-decoupler-swatches.image .swatch-label {
    font-size: 12px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.option-price {
    font-size: 11px;
    color: #888;
    font-weight: normal;
    display: flex;
    gap: 5px;
    align-items: center;
}

.option-price del {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 0.9em;
}

.option-price ins {
    text-decoration: none;
    font-weight: bold;
    color: #d63638;
    /* A standard sale color */
}

.woo-decoupler-swatches.color .swatch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    width: 100%;
}

.woo-decoupler-swatches.image .swatch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    width: 100%;
}

/* Responsive Swatches */
@media (max-width: 480px) {
    .woo-decoupler-swatches {
        gap: 8px;
    }

    .woo-decoupler-swatches.color .swatch-color-box {
        width: 35px;
        height: 35px;
    }

    .woo-decoupler-swatches.image img {
        width: 50px;
        height: 50px;
    }
}

/* ===== Price Wrapper ===== */
.woo-decoupler-price-wrapper {
    margin: 0px 0;
}

.woo-decoupler-price-container {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.woo-decoupler-price-container .price {
    display: block;
}

.woo-decoupler-price-container .price del {
    opacity: 0.5;
    margin-right: 8px;
}

.woo-decoupler-price-container .price ins {
    text-decoration: none;
    font-weight: 600;
    color: #e74c3c;
}

.woo-decoupler-price-container.variation-selected {
    animation: priceHighlight 0.3s ease;
}

@keyframes priceHighlight {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Add to Cart Wrapper ===== */
.woo-decoupler-cart-wrapper {
    margin-top: 20px;
}

.woo-decoupler-cart-container {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* Quantity Input */
.woo-decoupler-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    flex-shrink: 0;
    min-width: 0;
}

.woo-decoupler-quantity label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.woo-quantity-input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.woo-quantity-input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

/* Remove spinner in Firefox */
.woo-quantity-input[type="number"] {
    -moz-appearance: textfield;
}

/* Remove spinner in Chrome/Safari */
.woo-quantity-input[type="number"]::-webkit-outer-spin-button,
.woo-quantity-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Button */
/* Add to Cart Button */
.woo-decoupler-add-to-cart {
    position: relative;
    padding: 12px 28px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    min-width: 140px;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    /* Removed large box-shadows and transforms */
}

.woo-decoupler-add-to-cart:hover:not(.disabled):not(.loading):not(.success) {
    background-color: #333;
    /* Removed transformY and large shadow float */
}

.woo-decoupler-add-to-cart:active:not(.disabled) {
    opacity: 0.8;
}

.woo-decoupler-add-to-cart.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #e0e0e0;
    color: #888;
}

/* High specificity override for focus styles */
.woo-decoupler-cart-wrapper .woo-decoupler-add-to-cart:focus,
.woo-decoupler-cart-wrapper .woo-decoupler-add-to-cart:focus-visible,
.woo-decoupler-add-to-cart:focus,
.woo-decoupler-add-to-cart:focus-visible {
    outline: none !important;
    outline-width: 0 !important;
    box-shadow: none !important;
    border-color: inherit;
    /* Allow Elementor settings to take over, but prevent theme defaults */
}

/* All loading and success animations removed per user request */

/* Message Display */
/* Message Display */
.woo-decoupler-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.woo-decoupler-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.woo-decoupler-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}



/* ===== Button Swatches ===== */
.woo-decoupler-swatches.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.woo-decoupler-swatches.buttons .swatch-button {
    cursor: pointer;
    display: inline-block;
}

.woo-decoupler-swatches.buttons .swatch-button input {
    display: none;
}

.woo-decoupler-swatches.buttons .swatch-button-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: left;
    gap: 15px;
}

.woo-decoupler-swatches.buttons .option-price {
    font-weight: 600;
    color: inherit;
    font-size: 16px;
}

.woo-decoupler-swatches.buttons .option-price ins {
    font-size: 18px;
}


.woo-decoupler-swatches.buttons .swatch-button:hover .swatch-button-label {
    border-color: #999;
    background: #f9f9f9;
}

.woo-decoupler-swatches.buttons .swatch-button input:checked+.swatch-button-label {
    border-color: #333;
    background: #333;
    color: #fff;
}

/* ===== Modern Quantity Wrapper ===== */
.woo-decoupler-quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.woo-decoupler-quantity-wrapper .quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woo-decoupler-quantity-wrapper .quantity-btn:hover {
    background: #e5e5e5;
}

.woo-decoupler-quantity-wrapper .quantity-btn:active {
    background: #ddd;
}

.woo-decoupler-quantity-wrapper .woo-quantity-input {
    flex: 1;
    min-width: 40px;
    border: none;
    border-radius: 0;
    text-align: center;
    font-weight: 600;
}

.woo-decoupler-quantity-wrapper .woo-quantity-input:focus {
    box-shadow: none;
}

/* ===== Layout Variations ===== */
/* Horizontal Layout */
.woo-decoupler-variations-wrapper.layout-horizontal .woo-decoupler-variations-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 25px;
}

/* Vertical Layout */
.woo-decoupler-variations-wrapper.layout-vertical .woo-decoupler-variations-container {
    flex-direction: column;
}

/* Grid Layout */
.woo-decoupler-variations-wrapper.layout-grid .woo-decoupler-variations-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== Cart Layout Variations ===== */
/* Modern (Side by Side) */
.woo-decoupler-cart-wrapper.layout-modern .woo-decoupler-cart-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Stacked */
.woo-decoupler-cart-wrapper.layout-stacked .woo-decoupler-cart-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.woo-decoupler-cart-wrapper.layout-stacked .woo-decoupler-quantity {
    width: 100%;
    justify-content: center;
}

.woo-decoupler-cart-wrapper.layout-stacked .woo-decoupler-add-to-cart {
    width: 100%;
}

/* Minimal */
.woo-decoupler-cart-wrapper.layout-minimal .woo-decoupler-cart-container {
    display: flex;
    justify-content: flex-start;
}

/* ===== Sale Badge ===== */
.woo-decoupler-sale-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* ===== Button Icon Styles ===== */
.woo-decoupler-add-to-cart .button-icon {
    display: inline-flex;
    margin-right: 8px;
}

.woo-decoupler-add-to-cart .button-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Icon on right */
.woo-decoupler-add-to-cart .button-icon:last-child {
    margin-right: 0;
    margin-left: 8px;
}

/* ===== Stock Status ===== */
.woo-decoupler-stock-status {
    margin-top: 10px;
    font-size: 14px;
}

.woo-decoupler-stock-status .in-stock {
    color: #155724;
}

.woo-decoupler-stock-status .out-of-stock {
    color: #721c24;
}

/* ===== Accessibility ===== */
.woo-decoupler-attribute-field label:focus-within {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.woo-decoupler-swatches .swatch:focus-within {
    outline: 2px solid #333;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip focus styles on non-keyboard interactions */
.woo-decoupler-variations-container *:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* ===== Responsive Layout ===== */
@media (max-width: 768px) {
    .woo-decoupler-variations-container {
        gap: 15px;
    }

    /* 
     * Note: Width and layout overrides removed to allow Elementor's 
     * responsive controls (quantity_field_width, add_to_cart_button_width) 
     * to take effect on tablet and mobile views.
     */
}

/* ===== View Cart Link ===== */
.woo-decoupler-view-cart {
    display: block;
    width: 100%;
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    animation: woo-fade-in-up 0.4s ease-out forwards;
    cursor: pointer;
}

.woo-decoupler-view-cart:hover {
    color: #000;
    text-decoration: underline;
}

.woo-decoupler-view-cart::after {
    content: ' \2192';
    /* Right arrow */
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.woo-decoupler-view-cart:hover::after {
    transform: translateX(4px);
}

@keyframes woo-fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}