/*
 * Additions to the compiled Tailwind bundle.
 *
 * The bundle in build/ was generated by scanning the old Blade templates, so
 * it contains every utility those templates used -- and only those. This file
 * holds the handful of rules the plain-PHP rewrite needs that were previously
 * supplied by Alpine or Livewire, so the bundle itself never has to be rebuilt.
 *
 * Keep this small. Anything reusable belongs in the Tailwind source and a
 * proper rebuild, not here.
 */

/* Alpine set display:none on x-cloak elements before it booted. The dropdown
   panels now start with .hidden instead, but a panel that is opened and closed
   during a page transition can briefly flash; this keeps that suppressed. */
[data-dropdown-panel][hidden] {
    display: none !important;
}

/* Livewire's cart drawer animated its own entry. The mobile nav panel and
   backdrop now transition through utility classes, and these two rules give
   them a sane starting state before the first frame runs. */
[data-nav-drawer].hidden {
    display: none;
}

[data-nav-panel] {
    will-change: transform;
}

/* Toasts are appended by script; matching the server-rendered ones means they
   inherit the same fade-out. */
[data-toast] {
    transition: opacity 0.2s ease;
}

/* The quantity stepper submits on change, so its native spinner is the only
   control. Firefox hides it by default at small widths; force it visible. */
input[type='number'][name='quantity'] {
    -moz-appearance: number-input;
}

/* ---------------------------------------------------------------------------
   Floating actions: WhatsApp bottom-left, back-to-top bottom-right.

   Written by hand rather than with utility classes. The Tailwind bundle was
   compiled against the old Blade templates and contains only the classes those
   used, so a new `fixed bottom-6 left-6` would produce no styles whatsoever.
   --------------------------------------------------------------------------- */

.floating-action {
    position: fixed;
    bottom: 1.5rem;
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease,
        visibility 0.2s ease, background-color 0.2s ease;
}

.floating-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}

/* The bundle's focus ring does not reach these, so they carry their own. */
.floating-action:focus-visible {
    outline: 2px solid #1f3d2b;
    outline-offset: 3px;
}

.floating-action--whatsapp {
    left: 1.5rem;
    color: #ffffff;
    background-color: #25d366;
}

.floating-action--whatsapp:hover {
    background-color: #1ebe5b;
}

.floating-action--top {
    right: 1.5rem;
    color: #fbf8f3;
    background-color: #1f3d2b;
    /* Hidden until scrolled. visibility keeps it out of the tab order too,
       which opacity alone would not do. */
    opacity: 0;
    visibility: hidden;
}

.floating-action--top.is-visible {
    opacity: 1;
    visibility: visible;
}

.floating-action--top:hover {
    background-color: #2c5540;
}

/* Toasts share the bottom-right corner; lift them clear of the button. */
[data-toast-host] {
    bottom: 5.75rem;
}

@media (max-width: 640px) {
    .floating-action {
        width: 2.875rem;
        height: 2.875rem;
        bottom: 1rem;
    }

    .floating-action--whatsapp {
        left: 1rem;
    }

    .floating-action--top {
        right: 1rem;
    }
}

/* Someone who asks for less motion should not be nudged around on hover. */
@media (prefers-reduced-motion: reduce) {
    .floating-action,
    .floating-action:hover {
        transition: none;
        transform: none;
    }
}

/* Print: the storefront chrome is noise on a printed order confirmation. */
@media print {
    header,
    footer,
    .floating-action,
    [data-toast-host],
    [data-nav-drawer],
    aside[aria-label='Store announcement'] {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }
}

/* ------------------------------------------------------------------ *
 * Page builder (admin only)
 *
 * Written by hand rather than composed from utilities: the Tailwind
 * bundle is pre-compiled from the classes the old Blade templates used,
 * so anything this screen invents would silently have no styles at all.
 * ------------------------------------------------------------------ */

.pb {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(138, 125, 108, 0.25);
}

.pb-intro {
    margin-bottom: 1.25rem;
}

.pb-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pb-card {
    border: 1px solid rgba(138, 125, 108, 0.3);
    background: #fffdf8;
    padding: 0.875rem 1rem 1rem;
}

.pb-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pb-card-type {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6f6552;
}

.pb-card-tools {
    display: flex;
    gap: 0.25rem;
}

.pb-tool {
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1;
    border: 1px solid rgba(138, 125, 108, 0.35);
    background: transparent;
    color: #6f6552;
    cursor: pointer;
}

.pb-tool:hover {
    background: #1f3b2c;
    border-color: #1f3b2c;
    color: #fffdf8;
}

.pb-tool-remove:hover {
    background: #a4342a;
    border-color: #a4342a;
}

.pb-field {
    display: block;
    margin-top: 0.75rem;
}

.pb-label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6f6552;
    margin-bottom: 0.25rem;
}

.pb-input {
    display: block;
    width: 100%;
    background: #fffdf8;
    border: 1px solid rgba(138, 125, 108, 0.3);
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-size: 14px;
    color: inherit;
}

.pb-input:focus {
    outline: none;
    border-color: #2f6d4f;
}

.pb-textarea {
    resize: vertical;
}

.pb-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.pb-hint {
    display: block;
    font-size: 12px;
    color: #6f6552;
    margin-top: 0.25rem;
}

.pb-hint a {
    text-decoration: underline;
}

.pb-hint-block {
    margin: 0 0 0.25rem;
}

.pb-empty {
    font-size: 13px;
    color: #6f6552;
    padding: 1.25rem 0;
}

.pb-add {
    margin-top: 1.25rem;
}

.pb-add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pb-add-button {
    border: 1px solid rgba(138, 125, 108, 0.35);
    background: transparent;
    padding: 0.4rem 0.75rem;
    font-size: 13px;
    color: #33301f;
    cursor: pointer;
}

.pb-add-button:hover {
    background: #1f3b2c;
    border-color: #1f3b2c;
    color: #fffdf8;
}
