.royal-product-variation {
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* Price Section */
.royal-product-variation .price-container {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;
}

.royal-product-variation .price-prefix,
.royal-sticky-mobile-bar .price-prefix {
    font-size: 14px;
    margin-right: 12px;
    color: #000;
    margin-bottom: 4px;
}

.royal-product-variation .price-amount,
.royal-sticky-mobile-bar .price-amount {
    display: flex;
    align-items: baseline;
    color: #C41212;
    font-weight: 700;
    line-height: 1;
}

.royal-product-variation .price-symbol,
.royal-sticky-mobile-bar .price-symbol {
    font-size: 0.8em;
    margin-right: 2px;
}

.royal-product-variation .price-cents,
.royal-sticky-mobile-bar .price-cents {
    font-size: 0.5em;
    vertical-align: super;
    margin-left: 2px;
}

/* Variation Fields */
.royal-product-variation .variation-fields-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}

.royal-product-variation .field-label {
    display: block;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    margin-bottom: 8px;
}

/* Select Styling */
.royal-product-variation .select-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.royal-product-variation .select-wrapper .variation-select {
    background-position: inherit;
}

.royal-product-variation .variation-select {
    width: 100%;
    padding: 2px 45px 2px 20px;
    font-size: 16px;
    border: 2px solid #000;
    border-radius: 12px;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    color: #D9D9D9;
    /* Default placeholder color */
}

.royal-product-variation .variation-select option {
    color: #000;
}

.royal-product-variation .variation-select:focus,
.royal-product-variation .variation-select:active,
.royal-product-variation .variation-select:hover {
    outline: none !important;
    border-color: #000 !important;
    box-shadow: none !important;
}

.royal-product-variation .select-wrapper::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Swatches Grid */
.royal-product-variation .swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 16px;
}

.royal-product-variation .swatch-item {
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.royal-product-variation .swatch-image-container {
    width: 100%;
    aspect-ratio: 1.5;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E5E5E5;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    background: #f5f5f5;
    position: relative;
    padding: 0;
}

.royal-product-variation .swatch-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.royal-product-variation .swatch-color {
    width: 100%;
    height: 100%;
    display: block;
}

.royal-product-variation .swatch-label-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    font-weight: 700;
    color: #666;
    font-size: 24px;
    text-transform: uppercase;
}

.royal-product-variation .swatch-name {
    font-size: 12px;
    color: #8C8C8C;
    display: block;
    line-height: 1.2;
}

.royal-product-variation .swatch-item.active .swatch-image-container {
    border: 2px solid #D2A34C;
    box-shadow: 0 0 0 1px #D2A34C;
}

.royal-product-variation .swatch-item.active .swatch-image-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #D2A34C;
}

.royal-product-variation .swatches-label-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.royal-product-variation .swatches-label-row .field-label {
    margin-bottom: 0;
}

.royal-product-variation .selected-value-label {
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.royal-product-variation .variation-separator {
    width: 100%;
    height: 2px;
    background-color: #D9D9D9;
    margin-bottom: 32px;
}

/* Action Section */
.royal-product-variation .action-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.royal-product-variation .quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #000;
    border-radius: 50px;
    width: fit-content;
    padding: 2px 12px;
    gap: 15px;
}

.royal-product-variation .qty-btn {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.royal-product-variation .qty-input {
    width: fit-content;
    max-width: 60px;
    text-align: center;
    border: none;
    font-size: 18px;
    font-weight: 700;
    -moz-appearance: textfield;
}

.royal-product-variation .qty-input::-webkit-outer-spin-button,
.royal-product-variation .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.royal-product-variation .qty-input:focus {
    outline: none;
}

.royal-product-variation .button-payment-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* This is a unique class, safe to keep global */
.btn-royal-action {
    background-color: #C41212;
    color: #fff;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    min-width: 300px;
    text-align: center;
}

.btn-royal-action:hover {
    background-color: #a00f0f;
}

.royal-product-variation .payment-logos {
    display: flex;
    align-items: center;
    gap: 12px;
}

.royal-product-variation .payment-logo-item {
    height: 32px;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.royal-product-variation .payment-logo-item img {
    height: 100%;
    width: auto;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .royal-product-variation .price-container {
        margin-bottom: 10px;
    }

    .royal-product-variation .price-amount {
        font-size: 40px;
        /* Scaling down for mobile */
    }

    .royal-product-variation .variation-fields-container {
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Horizontal scroll for swatches on mobile */
    .royal-product-variation .swatches-grid {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: none;
    }

    .royal-product-variation .swatch-item {
        flex: 0 0 44px;
        scroll-snap-align: start;
    }

    .royal-product-variation .swatch-image-container {
        aspect-ratio: 1.4;
        border-radius: 10px;
        height: 44px;
        width: 76px;
        border-radius: 10px;
    }

    .royal-product-variation .action-section {
        gap: 15px;
    }

    .royal-product-variation .quantity-selector {
        width: fit-content;
        gap: 1px;
        padding: 0px 5px;
        justify-content: center;
        max-width: none;
        margin-bottom: 10px;
    }

    .royal-product-variation .button-payment-row {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 20px;
    }

    .royal-product-variation .price-prefix {
        font-size: 10px;
    }

    .royal-product-variation .variation-select {
        line-height: 33px;
    }

    .royal-product-variation .field-label,
    .royal-product-variation .selected-value-label {
        font-size: 12px;
    }

    .royal-product-variation .qty-input {
        width: fit-content;
        max-width: 60px;
        text-align: center;
    }

    .btn-royal-action {
        width: 100%;
        min-width: 0;
        padding: 14px 20px;
        font-size: 16px;
    }

    .royal-product-variation .payment-logos {
        justify-content: center;
        width: 100%;
    }

    /* Hide scrollbar but keep functionality */
    .royal-product-variation .swatches-grid::-webkit-scrollbar {
        display: none;
    }

    .royal-product-variation .swatches-grid {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Sticky Mobile Bar - Already Isolated by Prefix 'royal-' */
.royal-sticky-mobile-bar {
    display: none;
}

@media (max-width: 767px) {
    .royal-sticky-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 48px;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        padding: 0 20px;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    .royal-sticky-mobile-bar .sticky-price-container {
        display: flex;
        justify-content: center;
    }

    .royal-sticky-mobile-bar .price-amount {
        font-size: 24px;
        color: #C41212;
        line-height: 1;
        display: flex;
        align-items: flex-start;
    }

    .royal-sticky-mobile-bar .price-main {
        font-size: 24px;
        font-weight: 700;
    }

    .royal-sticky-mobile-bar .price-cents {
        font-size: 14px;
        font-weight: 700;
        margin-top: 10px;
    }

    .royal-sticky-mobile-bar .price-prefix {
        font-size: 10px;
        margin-top: -10px;
        color: #666;
    }

    .royal-sticky-mobile-bar .btn-royal-sticky {
        width: auto;
        margin: 0 !important;
        padding: 5px 20px;
        font-size: 14px;
        height: 31px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}