/* Action panels — add code / review / contact forms and the brand "O trgovini"
   description (partials/action-panel.php, partials/action-panels/*).
   Bottom sheet on mobile, full-height right-side panel from 768px up.
   Builds on .action-modal / .action-modal--scroll in style.css (inner form
   styling, header / scrolling body / sticky footer) and only overrides the
   container geometry and motion, so this file must load after style.css. */

.action-modal.action-panel {
    max-height: 92vh;
    max-height: 92dvh;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12);
}

.action-modal.action-panel:focus {
    outline: none;
}

/* Keep the submit button clear of the iOS home indicator. */
.action-panel .action-modal-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Success state fills the space the form leaves, centred under the header. */
.action-panel .success-state {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Brand description: the scrolling body already pads, don't pad twice. */
.action-panel .modal-description-content {
    padding: 0;
}

/* Add-code panel: "Popust" field. The % / € / Drugo toggle sits on the
   label line, like the character counters in the other forms. */
.discount-field .form-label-wrapper {
    min-height: 28px;
    margin-bottom: 6px;
    gap: 8px;
}

.discount-unit-toggle {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--border-base);
    border-radius: 8px;
}

.discount-unit-toggle button {
    min-width: 28px;
    height: 22px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-third);
    font-size: .75rem;
    font-weight: 600;
    line-height: 22px;
    cursor: pointer;
    transition: .2s;
}

.discount-unit-toggle button:hover {
    color: var(--text);
}

.discount-unit-toggle button.active {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--text);
}

.discount-unit-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Value inputs with a unit (or dropdown chevron) on the right. */
.action-modal .input-with-suffix .form-control {
    padding-right: 40px;
}

.action-modal .input-with-suffix .input-suffix {
    right: 12px;
    display: flex;
    align-items: center;
}

.action-modal .input-with-suffix select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
}

/* One-tap common percentages under the value field. */
.discount-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.discount-chip {
    padding: 4px 10px;
    border: 1px solid var(--border-base);
    border-radius: 999px;
    background: transparent;
    color: var(--text-third);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: .2s;
}

.discount-chip:hover {
    border-color: var(--text-third);
    color: var(--text);
}

.discount-chip.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text);
}

.discount-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Motion: panel slides in (from below on mobile, from the right on desktop),
   overlay fades. Closing fades the overlay via .action-modal-overlay.closing. */
.action-panel-transition {
    transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}

.action-panel-offscreen {
    transform: translateY(100%);
}

.action-panel-onscreen {
    transform: translateY(0);
}

.action-panel-fade {
    transition: opacity .3s ease;
}

.action-panel-faded {
    opacity: 0;
}

.action-panel-visible {
    opacity: 1;
}

@media (min-width: 768px) {
    .action-modal-overlay.action-panel-overlay {
        align-items: stretch;
        justify-content: flex-end;
    }

    .action-modal.action-panel {
        width: 520px;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 24px 0 0 24px;
        box-shadow: -12px 0 40px rgba(0, 0, 0, .15);
    }

    .action-panel-offscreen {
        transform: translateX(100%);
    }

    .action-panel-onscreen {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .action-panel-transition,
    .action-panel-fade {
        transition: none;
    }
}
