/* Product Price Dynamic Styles */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modern-product-section .price-display-section {
    position: relative;
    transition: all 0.3s ease;
}

.modern-product-section .sale-kind-selection {
    margin-bottom: 24px;
}

.modern-product-section #sale-variant-picker:not([hidden]) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.modern-product-section #sale-variant-picker > label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.modern-product-section #sale-variant {
    flex: 0 1 240px;
    width: 240px;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 14px;
    padding-inline-end: 40px;
    border: 1px solid #d9dfd3;
    border-radius: 10px;
    background-color: #fdfcf9;
    background-position: left 14px center;
    color: #25392e;
    font-size: 14px;
    line-height: 1.7;
}

.modern-product-section #sale-variant:focus {
    border-color: #244c38;
}

.modern-product-section #sale-unit-label {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.9;
}

@media (min-width: 769px) {
    .page-product .product-detail-box .product-image-column,
    .page-product .product-detail-box .product-info-column {
        display: flex;
        min-width: 0;
    }

    .page-product .product-detail-box .product-image-column > .images-box,
    .page-product .product-detail-box .product-info-column > .data-box {
        flex: 1;
        min-width: 0;
        height: auto;
    }

    .page-product .product-detail-box .product-info-column > .data-box {
        justify-content: space-between;
        gap: 24px;
    }
}

.price-updating {
    opacity: 0.7;
    pointer-events: none;
}

/* Loading Animation for Price Update */
.price-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 80px;
}

.spinner-border {
    width: 20px;
    height: 20px;
    border: 2px solid #302C83;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Hover effects for size selection */
.modern-product-section .size-selection-section .section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 12px;
    border-bottom: 0;
    padding-bottom: 0;
}

.modern-product-section .size-selection-section .section-title {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
}

.modern-product-section .selected-size {
    display: inline-block;
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: auto;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.8;
    text-align: center;
}

.size-item {
    transition: all 0.3s ease;
}

.modern-product-section .size-item {
    min-width: 0;
    max-width: 100%;
}

.modern-product-section .size-box {
    width: auto;
    min-width: 50px;
    height: auto;
    min-height: 40px;
    padding: 8px 14px;
    box-sizing: border-box;
    text-align: center;
}

.modern-product-section .size-label {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.size-item:hover .size-box {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(48, 44, 131, 0.2);
}

.size-item.active .size-box {
    background: #302C83;
    color: white;
    border-color: #302C83;
}

/* Quantity controls improvements */
.quantity-handler {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quantity-btn:hover {
    background: #302C83;
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    background: white;
    outline: none;
    line-height: 40px;
}

/* Add to cart button enhancements */
.add-to-cart-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(48, 44, 131, 0.3);
}

.add-to-cart-btn.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .action-section {
        flex-direction: column;
        gap: 15px;
    }

    .quantity-controls {
        justify-content: center;
        width: 100%;
    }

    .page-product .modern-product-section .add-to-cart-btn {
        flex: 0 0 auto;
        align-self: center;
        width: min(100%, 280px);
        min-height: 54px;
        height: auto;
        box-sizing: border-box;
        padding: 14px 20px;
        font-size: 15px;
        line-height: 1.6;
    }

    .page-product .add-to-cart-btn .btn-text {
        display: inline-flex;
        flex: 0 1 auto;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .page-product .add-to-cart-btn svg {
        flex-shrink: 0;
    }

    .price-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .size-options {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modern-product-section .size-box {
        min-width: 45px;
        min-height: 35px;
    }

    .quantity-btn {
        width: 35px;
        height: 35px;
    }

    .quantity-input {
        width: 50px;
        height: 35px;
    }

    .price-display-section {
        padding: 15px;
    }
}
