/* Existing styles */
.wap-attributes-container {
    margin-bottom: 20px;
}

.wap-attribute-group {
    margin-bottom: 20px;
    width: 100%;
}

.wap-attribute-item {
    position: relative;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.wap-attribute-item img {
    max-width: 50px;
    max-height: 50px;
    display: block;
}

.wap-attribute-item .attribute-name {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
}

.wap-attribute-item:hover .attribute-name,
.wap-attribute-item:focus .attribute-name {
    display: block;
}

.wap-attribute-item.selected {
    border: 2px solid #007bff;
}

.wap-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-display {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    direction: rtl;
}

.price-label {
    display: inline-block;
    order: 1;
    font-size: 30px;
    color: #351E18;
}

.price-amount {
    display: inline-block;
    order: 2;
}

.price-amount .woocommerce-Price-amount {
    display: inline-block;
}

.price-amount .woocommerce-Price-currencySymbol {
    margin-right: 2px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    overflow: hidden;
}

.quantity-btn {
    padding: 7px 35px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #351E18;
}

.quantity-input {
    width: 50px;
    text-align: center;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    outline: none;
}

.quantity-input[type=number] {
    border: 0;
}

.separator-line {
    height: 1px;
    background-color: #351E18;
    margin: 20px 0;
    border-radius: 10px;
}

.single_add_to_cart_button {
    padding: 0px 50px;
    font-family: 'Heebo', sans-serif;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
    background-color: #351E18;
    border: 2px solid #351E18;
    color: white;
}

.single_add_to_cart_button:hover {
    background-color: #351E18;
    border: 2px solid #351E18;
    color: rgb(252, 247, 0);
    font-weight: 600;
}

.buy-now {
    padding: 0px 50px;
    font-family: 'Heebo', sans-serif;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
    background-color: transparent;
    border: 1px solid #351E18;
    color: #351E18;
}

.buy-now:hover {
    background-color: transparent;
    border: 2px solid #351E18;
    color: #351E18;
    font-weight: 600;
}

.wap-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px 40px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 500px;
    max-width: 80%;
    line-height: 1.8;
    text-align: center;
    direction: rtl;
    font-size: 22px;
    animation: fadeInScale 0.3s ease-out;
}

.wap-notification.success {
    border: 3px solid #4CAF50;
}

.wap-notification.error {
    border: 3px solid #f44336;
}

.wap-notification br {
    margin: 10px 0;
    display: block;
    content: "";
}

/* Animation for notification */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* RTL Support */
.rtl .wap-quantity-selector {
    margin-right: 0;
    margin-left: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Стили для контейнера опций */
    .options-row {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        width: 100%;
    }

    /* Стили для селектов */
    .variation-selects {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .variation-select-wrapper {
        width: 100%;
    }

    .variation-select-wrapper select {
        width: 100%;
        height: 50px; /* Фиксированная высота для всех элементов */
        padding: 0 15px;
        font-size: 16px;
    }

    /* Стили для селектора количества */
    .quantity-selector {
        width: 100%;
        height: 50px; /* Такая же высота как у селектов */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .quantity-btn {
        height: 100%;
        padding: 0;
        width: 33.33%; /* Равная ширина для кнопок и инпута */
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quantity-input {
        height: 100%;
        width: 33.33%;
        text-align: center;
        padding: 0;
        font-size: 16px;
    }

    /* Стили для кнопок действий */
    .action-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        width: 100%;
    }

    .action-buttons button {
        width: 100%;
        height: 50px; /* Фиксированная высота для кнопок */
        padding: 0;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .buy-now,
    .single_add_to_cart_button {
        margin: 0;
        line-height: 50px;
    }

    /* Стили для отображения цены */
    .price-display {
        width: 100%;
        padding: 0 15px;
        margin: 15px 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        font-size: 20px;
        direction: rtl;
    }

    .price-label {
        font-weight: bold;
        order: 1;
    }

    .price-amount {
        font-size: 24px;
        order: 2;
    }

    .price-amount .woocommerce-Price-currencySymbol {
        margin-right: 5px;
    }

    .wap-notification {
        min-width: unset;
        width: 90%;
        max-width: 90%;
        padding: 20px 25px;
        font-size: 18px;
        margin: 0 auto;
    }
}

.wap-attribute-group.required h3 .required {
    color: red;
}

.wap-attribute-group.error {
    border: 1px solid red;
}

.wap-attribute-group.error {
    border: 1px solid red;
    padding: 10px;
    margin-bottom: 10px;
}

.wap-updating {
    position: relative;
}

.wap-updating:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 9999;
}

.wap-updating:after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    z-index: 10000;
    animation: wap-spin 1s linear infinite;
}

@keyframes wap-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.price-amount del {
    color: #a00;
    opacity: 0.5;
    font-weight: normal;
    margin-right: 5px;
}

.price-amount ins {
    color: #351E18;
    font-weight: bold;
    text-decoration: none;
}

.wap-attribute-select option {
    padding: 5px;
    font-size: 14px;
}

.wap-attribute-select option del {
    color: #a00;
    opacity: 0.75;
    margin: 0 5px;
    text-decoration: line-through;
    display: inline;
}

.wap-attribute-select option ins {
    color: #351E18;
    text-decoration: none;
    font-weight: bold;
    display: inline;
}

.price-display {
    margin: 15px 0;
}

.price-amount del {
    color: #a00;
    opacity: 0.75;
    margin-right: 5px;
    text-decoration: line-through;
    display: inline-block;
}

.price-amount ins {
    color: #351E18;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.price-amount .woocommerce-Price-amount {
    display: inline-block;
    font-size: 30px;
}

.options-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.variation-selects {
    display: flex;
    gap: 15px;
    flex: 1;
}

.variation-select-wrapper {
    flex: 1;
}

.quantity-selector {
    min-width: 120px;
    flex-shrink: 0;
}

.variation-select-wrapper.error select {
    border-color: #f44336;
}

.wap-attribute-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.wap-attribute-form.loading button {
    cursor: not-allowed;
}

/* Общие стили для кнопок */
.action-buttons button {
    padding: 0px 50px;
    font-family: 'Heebo', sans-serif;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
}

/* Стили для кнопки "Добавить в корзину" */
.wap-attribute-form .action-buttons .single_add_to_cart_button,
.woocommerce .wap-attribute-form .action-buttons .single_add_to_cart_button {
    padding: 0px 50px;
    font-family: 'Heebo', sans-serif;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
    background-color: #351E18;
    border: 2px solid #351E18;
    color: white;
}

.wap-attribute-form .action-buttons .single_add_to_cart_button:hover,
.wap-attribute-form .action-buttons .single_add_to_cart_button:focus,
.woocommerce .wap-attribute-form .action-buttons .single_add_to_cart_button:hover,
.woocommerce .wap-attribute-form .action-buttons .single_add_to_cart_button:focus {
    background-color: #351E18 !important;
    border: 2px solid #351E18 !important;
    color: rgb(252, 247, 0) !important;
    font-weight: 600 !important;
}

/* Стили для кнопки "Купить сейчас" */
.wap-attribute-form .action-buttons .buy-now {
    background-color: transparent;
    border: 1px solid #351E18;
    color: #351E18;
}

.wap-attribute-form .action-buttons .buy-now:hover,
.wap-attribute-form .action-buttons .buy-now:focus {
    background-color: transparent;
    border: 2px solid #351E18;
    color: #351E18;
    font-weight: 600;
}

/* Обновляем мобильные стили */
@media (max-width: 768px) {
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .action-buttons button {
        width: 100%;
        padding: 10px 0;
    }
}

/* Стили для select и его стрелки */
.variation-select-wrapper select {
    padding-right: 30px !important; /* Увеличиваем отступ справа для стрелки */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center; /* Позиционируем стрелку */
    background-size: 16px;
}

/* Для RTL версии */
.rtl .variation-select-wrapper select {
    padding-left: 30px !important;
    padding-right: 10px !important;
    background-position: left 10px center;
}

.wap-price-range {
    direction: rtl;
    text-align: right;
}

.wap-price-range .price {
    font-family: "Heebo", Sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #351E18;
}

/* Add these new styles */
.mobile-actions-container {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    .action-row {
        display: none; /* Hide desktop version on mobile */
    }

    .mobile-actions-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        background: #fff;
    }

    .mobile-actions-container .price-display {
        order: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 0;
        direction: rtl;
    }

    .mobile-actions-container .price-label {
        font-size: 24px;
        color: #351E18;
    }

    .mobile-actions-container .price-amount {
        font-size: 24px;
    }

    .mobile-actions-container .action-buttons {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-actions-container .buy-now,
    .mobile-actions-container .single_add_to_cart_button {
        width: 100%;
        height: 50px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }

    .mobile-actions-container .buy-now {
        order: 1;
    }

    .mobile-actions-container .single_add_to_cart_button {
        order: 2;
    }
}

/* Общие стили для всех элементов формы */
.variation-select,
.quantity-selector,
.buy-now,
.single_add_to_cart_button {
    height: 45px !important;
    border-radius: 10px !important;
}

/* Стили для селектов */
.variation-select-wrapper select {
    width: 100%;
    height: 45px !important;
    border: 1px solid #e4e4e4;
    border-radius: 10px !important;
    padding: 0 15px;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    color: #351E18;
}

/* Стили для quantity selector */
.quantity-selector {
    height: 45px !important;
    border: 1px solid #e4e4e4;
    border-radius: 10px !important;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.quantity-selector .quantity-btn {
    height: 100% !important;
    width: 45px;
    border: none;
    background: none;
    color: #351E18;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

.quantity-selector .quantity-input {
    height: 100% !important;
    border: none;
    text-align: center;
    width: 50px;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    color: #351E18;
    -moz-appearance: textfield;
}

.quantity-selector .quantity-input::-webkit-outer-spin-button,
.quantity-selector .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Стили для кнопок */
.buy-now,
.single_add_to_cart_button {
    height: 45px !important;
    border-radius: 10px !important;
    font-family: 'Heebo', sans-serif;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .mobile-actions-container .buy-now,
    .mobile-actions-container .single_add_to_cart_button {
        height: 45px !important;
    }
}

/* Desktop/Mobile visibility */
.mobile-actions {
    display: none;
}

@media (max-width: 768px) {
    .desktop-actions {
        display: none;
    }

    .mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }

    .mobile-actions .price-display {
        order: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 0;
        direction: rtl;
        padding: 0 15px;
    }

    .mobile-actions .action-buttons {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        padding: 0;
    }

    .mobile-actions .buy-now,
    .mobile-actions .single_add_to_cart_button {
        width: 100%;
        height: 45px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .options-row,
    .mobile-actions {
        margin: 0 auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .variation-select-wrapper,
    .quantity-selector,
    .mobile-actions .action-buttons {
        width: 100%;
        box-sizing: border-box;
    }
}

.out-of-stock-notice {
    color: #351e18;
    font-weight: bold;
    font-size: 30px;
    text-align: center;
    padding: 10px;
    width: 100%;
    font-family: 'Heebo', sans-serif;
}

/* Disable form interactions when out of stock */
.wap-attribute-form.out-of-stock {
    opacity: 0.7;
    pointer-events: none;
}

.wap-attribute-form.out-of-stock .variation-select,
.wap-attribute-form.out-of-stock .quantity-selector {
    opacity: 0.5;
    pointer-events: none;
}

.wap-attribute-form.out-of-stock .out-of-stock-notice {
    opacity: 1;
    pointer-events: auto;
}

.wap-price-range .price del {
    color: #a00;
    opacity: 0.5;
    margin-right: 5px;
    text-decoration: line-through;
}

.wap-min-price {
    direction: rtl;
    text-align: right;
    font-family: "Heebo", Sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #351E18;
}

.wap-min-price del {
    color: #a00;
    opacity: 0.5;
    margin-right: 5px;
    text-decoration: line-through;
}
