/**
 * Frontend стили для подарочных сертификатов
 */

/* Кнопка "Купить в подарок" */
.gift-certificate-button {
    background-color: #ff6b6b !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gift-certificate-notice-wrapper .woocommerce-info {
    background: rgb(255, 107, 107);
    color: #fff;
    border-top-color: #d32f2f;
    font-size: 17px;
}

.gift-certificate-notice-title {
    font-size: 21px;
}

.gift-certificate-button .gift-icon {
    width: 20px;
    height: 20px;
    top: -3px;
    position: relative;
    margin-right: 10px;
    vertical-align: middle;
    stroke: currentColor;
}

/* Отступ для десктопа */
@media (min-width: 769px) {
    .gift-certificate-button {
        margin-left: 15px !important;
    }
}

.gift-certificate-button:hover {
    background-color: #ff5252 !important;
    color: #fff !important;
}

/* Модальное окно */
.gift-certificate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.gift-certificate-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.gift-certificate-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.gift-certificate-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.gift-certificate-modal-close:hover {
    color: #333;
}

.gift-certificate-modal h2 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #333;
}

.gift-certificate-description {
    margin-bottom: 25px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Форма */
.gift-certificate-form-group {
    margin-bottom: 20px;
}

.gift-certificate-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.gift-certificate-form-group label .required {
    color: #ff0000;
}

.gift-certificate-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.gift-certificate-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.gift-certificate-input.error {
    border-color: #e74c3c;
}

.gift-certificate-error {
    display: block;
    margin-top: 5px;
    color: #e74c3c;
    font-size: 13px;
}

.gift-certificate-form-actions {
    margin-top: 30px;
    text-align: right;
}

.gift-certificate-submit {
    background-color: #27ae60 !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.gift-certificate-submit:hover {
    background-color: #229954 !important;
}

.gift-certificate-submit:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
}

/* Информационное сообщение на checkout */
.woocommerce-info.gift-certificate-checkout-notice {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.woocommerce-info.gift-certificate-checkout-notice::before {
    color: #ffc107;
}

.woocommerce-info.gift-certificate-checkout-notice strong {
    color: #856404;
}

/* Стили для SVG иконки в notice блоке */
.gift-certificate-notice-wrapper .woocommerce-info::before {
    content: none !important; /* Скрываем стандартную WooCommerce иконку */
}

.gift-certificate-notice-wrapper .woocommerce-info {
    padding-left: 3.5em; /* Оставляем место для SVG */
    position: relative;
}

.gift-certificate-notice-wrapper .gift-icon {
    position: absolute;
    top: 21px;
    left: 1.5em;
    width: 20px;
    height: 20px;
    stroke: currentColor; /* Цвет обводки соответствует цвету текста */
}

/* Адаптивность */
@media (max-width: 768px) {
    .gift-certificate-button {
        margin-left: 0;
        margin-top: 10px;
        display: block;
        width: 100%;
    }

    .gift-certificate-modal-content {
        padding: 25px;
        width: 95%;
    }

    .gift-certificate-modal h2 {
        font-size: 20px;
    }
}