/* Product Better Price
   --------------------
   Modern UI / UX using GanjehKala Design Tokens
*/

.gk-bp {
    direction: rtl;
    font-family: inherit;
}

/* Trigger
   ------- */
.gk-bp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--gk-radius-md, 8px);
    transition: background-color var(--gk-duration-fast, 0.2s) ease;
}

.gk-bp-trigger:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.gk-bp-trigger__icon {
    display: inline-flex;
    font-size: 18px;
    color: var(--gk-primary);
    transition: transform var(--gk-duration-fast, 0.2s) ease;
}

.gk-bp-trigger:hover .gk-bp-trigger__icon {
    transform: scale(1.1);
}

.gk-bp-trigger__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--gk-text, #4b5563);
}

/* Modal overlay & box
   ------------------- */
.gk-bp-modal__overlay,
.gk-bp-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--gk-duration, 0.3s) ease, transform var(--gk-duration, 0.3s) ease;
}

.gk-bp-modal__overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px); /* Glassmorphism Effect */
}

.gk-bp-modal {
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate3d(0, 20px, 0) scale(0.98);
}

.gk-bp-modal__inner {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
    background-color: var(--gk-surface, #ffffff);
    border-radius: var(--gk-radius-lg, 24px);
    box-shadow: var(--gk-shadow-lg, 0 20px 40px -10px rgba(0,0,0,0.15));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Open state */
.gk-bp.gk-bp--open .gk-bp-modal__overlay,
.gk-bp.gk-bp--open .gk-bp-modal {
    pointer-events: auto;
    opacity: 1;
}

.gk-bp.gk-bp--open .gk-bp-modal {
    transform: translate3d(0, 0, 0) scale(1);
}

/* Header
   ------ */
.gk-bp-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--gk-border-color, #f3f4f6);
}

.gk-bp-modal__titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gk-bp-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gk-text, #111827);
}

.gk-bp-modal__product {
    font-size: 13px;
    color: var(--gk-text-muted, #6b7280);
    line-height: 1.5;
}

.gk-bp-modal__close {
    border: none;
    background: var(--gk-background, #f3f4f6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gk-text-muted, #6b7280);
    transition: all var(--gk-duration-fast, 0.2s) ease;
}

.gk-bp-modal__close:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

/* Body & form
   ----------- */
.gk-bp-modal__body {
    padding: 24px;
    overflow-y: auto;
}

.gk-bp-modal__form-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gk-text, #1f2937);
}

.gk-bp-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Fields */
.gk-bp-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gk-bp-field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gk-text, #374151);
}

.gk-bp-field__price-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gk-bp-input {
    width: 100%;
    background-color: var(--gk-background, #f9fafb);
    border: 1px solid var(--gk-border-color, #e5e7eb);
    border-radius: var(--gk-radius-md, 12px);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gk-text, #111827);
    outline: none;
    transition: all var(--gk-duration-fast, 0.2s) ease;
}

.gk-bp-input::placeholder {
    color: #9ca3af;
}

.gk-bp-input:focus {
    background-color: var(--gk-surface, #ffffff);
    border-color: var(--gk-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gk-primary) 15%, transparent);
}

.gk-bp-input--price {
    text-align: left;
    direction: ltr;
    font-weight: 600;
}

.gk-bp-field__price-suffix {
    font-size: 13px;
    font-weight: 500;
    color: var(--gk-text-muted, #6b7280);
    flex-shrink: 0;
}

/* Checkbox (Modern Custom Toggle/Check) */
.gk-bp-field--checkbox {
    margin-top: 4px;
}

.gk-bp-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.gk-bp-checkbox__input {
    display: none;
}

.gk-bp-checkbox__mark {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--gk-border-color, #d1d5db);
    position: relative;
    background-color: var(--gk-surface, #ffffff);
    transition: all var(--gk-duration-fast, 0.2s) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gk-bp-checkbox__mark svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--gk-duration-fast, 0.2s) ease;
}

.gk-bp-checkbox__input:checked + .gk-bp-checkbox__mark {
    background-color: var(--gk-primary);
    border-color: var(--gk-primary);
}

.gk-bp-checkbox__input:checked + .gk-bp-checkbox__mark svg {
    opacity: 1;
    transform: scale(1);
}

.gk-bp-checkbox__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gk-text, #374151);
}

/* Errors & status */
.gk-bp-field__error {
    min-height: 18px;
    font-size: 12px;
    color: #ef4444; /* Standard Red for errors */
    font-weight: 500;
    margin-top: -4px;
}

.gk-bp-modal__status {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gk-secondary, #10b981); /* Success color */
    text-align: center;
}

/* Footer / button */
.gk-bp-modal__footer {
    margin-top: 8px;
}

.gk-bp-modal__submit {
    width: 100%;
    border-radius: var(--gk-radius-md, 12px);
    border: none;
    padding: 14px 20px;
    background-color: var(--gk-primary); /* خط قرمز: فقط از رنگ اصلی استفاده شد */
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: transform var(--gk-duration-fast, 0.2s) ease, box-shadow var(--gk-duration-fast, 0.2s) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gk-bp-modal__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--gk-primary) 30%, transparent);
}

.gk-bp-modal__submit:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 575px) {
    .gk-bp-modal__inner {
        max-width: calc(100% - 32px);
        max-height: calc(100vh - 64px);
    }
    .gk-bp-modal__header {
        padding: 20px 20px 12px;
    }
    .gk-bp-modal__body {
        padding: 20px;
    }
}

.gk-bp .gk-bp-honeypot {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
