﻿/* =========================================================
   YooKassa Button Styles – Cleaned & Theme-proof
   ========================================================= */

/* --------------------------
   Base Form Container
--------------------------- */
.yk-form {
    background-color: #fcfcfc;
    border: 1px solid #ededed;
    padding: 7px;
    border-radius: 3px;
    max-width: 23em;
    display: inline-block;
}

.yk-form form {
    padding-top: 0.5em;
}

.yk-form form .yk-submit {
    float: right;
}

.yk-title {
    margin: 2px;
    font-size: 16px;
    font-weight: normal;
}

/* --------------------------
   Quantity Controls (theme‑proof)
--------------------------- */
.yk-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    float: left;
    margin-right: 4px;
}

.yk-qty-btn {
    border: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(#fb593f, #f24125);
    padding: 0;
    font-size: 13px;
    line-height: 1;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
}

.yk-qty-btn:hover {
    background: linear-gradient(#f24125, #e83a1a);
}

.yk-qty-btn:active {
    background: linear-gradient(#e83a1a, #d63010);
}

.yk-qty-btn[data-action="minus"],
.yk-qty-btn[data-action="plus"] {
    background: #aaa;
}

.yk-qty-btn[data-action="minus"]:hover,
.yk-qty-btn[data-action="plus"]:hover {
    background: #ccc;
}

.yk-qty-btn:focus {
    outline: none;
}

/* Restore minus/plus icons inside quantity buttons */
.yk-qty-btn .icon.minus::before,
.yk-qty-btn .icon.plus::before {
    content: "";
    display: inline-block;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.yk-qty-btn .icon.minus::before {
    content: "\2212";  /* minus sign */
}

.yk-qty-btn .icon.plus::before {
    content: "\002b";  /* plus sign */
}

.yk-qty-btn .icon {
    display: inline-block;
    width: 100%;
    text-align: center;
}

/* Higher specificity to override theme input styles */
.yk-form .yk-qty-input {
    display: inline-block;
    /*padding: 9px 6px;*/
    text-align: center;
    vertical-align: top;
    width: 40px;
    font-size: 15px;
    height: 26px;
    line-height: 1.25;
    color: #555;
    background-color: #fff;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
}

.yk-qty-input:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 4px rgba(251, 89, 63, 0.2);
}

/* --------------------------
   Custom Amount Input
--------------------------- */
.yk-custom-amount-wrapper {
    display: inline-block;
}

.yk-form .yk-custom-amount-input {
    width: 100%;
    max-width: 5em;
    height: 26px;
    padding: 0 12px;
    border: 1px solid #ccc !important;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
}

.yk-custom-amount-input:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(251, 89, 63, 0.3);
}

/* --------------------------
   Submit Button
--------------------------- */
.yk-submit {
    height: auto;
    padding: 5px 10px;
    cursor: pointer;
    border: 0;
    border-radius: 3px;
    background: linear-gradient(#fb593f, #f24125);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.5;
}

.yk-submit:hover {
    background: linear-gradient(#f24125, #e83a1a);
}

.yk-submit:active {
    background: linear-gradient(#e83a1a, #d63010);
}

.yk-submit:focus {
    outline: none;
}

.yk-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc;
}

/* --------------------------
   Error State
--------------------------- */
.yk-error {
    border-color: #e53935 !important;
    outline: 2px solid rgba(229, 57, 53, 0.2);
}

/* --------------------------
   Price & Cost Display (if used)
--------------------------- */
.yk-price,
.yk-cost {
    margin: 5px 10px 15px 10px;
    font-size: 20px;
    float: left;
}

/* --------------------------
   Checkout Page Styles
--------------------------- */
.yk-checkout-page {
    padding: 40px 20px;
    background-color: #f5f5f5;
}

.yk-checkout-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid #ededed;
    border-radius: 3px;
    background: #fcfcfc;
}

.yk-checkout-title {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: normal;
}

.yk-checkout-total {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    margin: 5px 10px 15px 10px;
    float: left;
}

.yk-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.yk-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yk-field label {
    font-size: 14px;
    font-weight: normal;
}

/* Higher specificity for checkout inputs */
.yk-checkout-form .yk-field input {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #ccc !important;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
}

.yk-checkout-form .yk-field input:focus {
    outline: none;
    border-color: #fb593f;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(251, 89, 63, 0.3);
}

.yk-email-input,
.yk-fio-input {
    width: 100%;
}

.yk-final-submit {
    height: 48px;
    padding: 0;
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(#fb593f, #f24125);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.yk-final-submit:hover {
    background: linear-gradient(#f24125, #e83a1a);
}

.yk-final-submit:active {
    background: linear-gradient(#e83a1a, #d63010);
}

.yk-final-submit:focus {
    outline: none;
}

.yk-final-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------
   Mobile Adjustments
--------------------------- */
@media (max-width: 640px) {
    .yk-form,
    .yk-checkout-card {
        padding: 16px;
    }

    .yk-submit,
    .yk-qty-btn,
    .yk-final-submit {
        min-height: 48px;
    }
}
