/* ═══════════════════════════════════════════════════════════════
   PastryByP – Premium Bakery Order Panel
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────────── */
.pastrybyp-panel,
.pastrybyp-trigger--btn {
    --pbp-rose: #c76b7f;
    --pbp-rose-dark: #a85568;
    --pbp-rose-light: #f9eff1;
    --pbp-rose-glow: rgba(199,107,127,.25);
    --pbp-cream: #fdf8f4;
    --pbp-cream-dark: #f5ede5;
    --pbp-warm-gray: #6b5e58;
    --pbp-warm-gray-light: #a89990;
    --pbp-text: #3d302a;
    --pbp-text-light: #8a7c75;
    --pbp-border: #e8ddd6;
    --pbp-gold: #c4a96a;
    --pbp-gold-light: rgba(196,169,106,.12);
    --pbp-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --pbp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pbp-radius: 12px;
    --pbp-radius-sm: 8px;
}

/* ── Trigger button ─────────────────────────────────────────── */
.pastrybyp-trigger--btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 36px;
    background: var(--pbp-rose);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--pbp-font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .4px;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 20px var(--pbp-rose-glow);
    position: relative;
    overflow: hidden;
}
.pastrybyp-trigger--btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
    pointer-events: none;
}
.pastrybyp-trigger--btn:hover {
    background: var(--pbp-rose-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(199,107,127,.35);
}
.pastrybyp-trigger--link {
    color: var(--pbp-rose);
    font-family: var(--pbp-font-body);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid var(--pbp-rose-glow);
    padding-bottom: 2px;
    transition: all .2s;
}
.pastrybyp-trigger--link:hover {
    color: var(--pbp-rose-dark);
    border-bottom-color: var(--pbp-rose);
}

/* ── Overlay ────────────────────────────────────────────────── */
.pastrybyp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61,48,42,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility .4s ease;
    z-index: 99998;
}
.pastrybyp-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ── Panel shell ────────────────────────────────────────────── */
.pastrybyp-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 94vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--pbp-cream);
    box-shadow: -8px 0 40px rgba(61,48,42,.15);
    transform: translateX(100%);
    transition: transform .45s cubic-bezier(.22,1,.36,1);
    z-index: 99999;
}
.pastrybyp-panel.is-open {
    transform: translateX(0);
}

/* ── Panel header ───────────────────────────────────────────── */
.pastrybyp-panel__header {
    position: relative;
    padding: 36px 36px 24px;
    text-align: center;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(196,169,106,.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 100%, rgba(199,107,127,.05) 0%, transparent 60%),
        var(--pbp-cream);
    flex-shrink: 0;
}
.pastrybyp-panel__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 36px;
    right: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pbp-border), transparent);
}

/* ── Close button ───────────────────────────────────────────── */
.pastrybyp-panel__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--pbp-border);
    border-radius: var(--pbp-radius-sm);
    color: var(--pbp-warm-gray-light);
    cursor: pointer;
    padding: 0;
    transition: all .2s;
    z-index: 2;
}
.pastrybyp-panel__close:hover {
    color: var(--pbp-rose);
    border-color: var(--pbp-rose);
    background: var(--pbp-rose-light);
}

/* ── Flourish decoration ────────────────────────────────────── */
.pastrybyp-panel__header-deco {
    margin-bottom: 8px;
}
.pastrybyp-flourish {
    width: 80px;
    height: 14px;
    color: var(--pbp-gold);
}

/* ── Title ──────────────────────────────────────────────────── */
.pastrybyp-panel .pastrybyp-panel__title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-style: italic !important;
    font-size: 34px !important;
    font-weight: 400 !important;
    color: var(--pbp-rose) !important;
    margin: 0 0 4px !important;
    line-height: 1.2;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.pastrybyp-panel__subtitle {
    font-family: var(--pbp-font-body);
    color: var(--pbp-warm-gray-light);
    font-size: 13px;
    font-weight: 400;
    margin: 0;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ── Scrollable body ────────────────────────────────────────── */
.pastrybyp-panel__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 36px 36px;
}

/* ── Form ────────────────────────────────────────────────────── */
.pastrybyp-form {
    /* nothing extra needed */
}

/* ── Field rows ──────────────────────────────────────────────── */
.pastrybyp-row {
    display: flex;
    gap: 16px;
}
.pastrybyp-field--half {
    flex: 1;
    min-width: 0;
}

/* ── Fields ──────────────────────────────────────────────────── */
.pastrybyp-field {
    margin-bottom: 20px;
}
.pastrybyp-field label {
    display: block;
    font-family: var(--pbp-font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--pbp-warm-gray);
    margin-bottom: 6px;
    letter-spacing: .6px;
    text-transform: uppercase;
}
.pastrybyp-field label .required {
    color: var(--pbp-rose);
    font-weight: 400;
}

.pastrybyp-panel .pastrybyp-field input,
.pastrybyp-panel .pastrybyp-field select,
.pastrybyp-panel .pastrybyp-field textarea {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 1px solid var(--pbp-border) !important;
    border-radius: var(--pbp-radius-sm) !important;
    font-family: var(--pbp-font-body) !important;
    font-size: 15px !important;
    color: var(--pbp-text) !important;
    background: #fff !important;
    transition: border-color .25s, box-shadow .25s, background .25s;
    box-sizing: border-box !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}
.pastrybyp-panel .pastrybyp-field input:hover,
.pastrybyp-panel .pastrybyp-field select:hover,
.pastrybyp-panel .pastrybyp-field textarea:hover {
    border-color: #d4c4bb !important;
}
.pastrybyp-panel .pastrybyp-field input:focus,
.pastrybyp-panel .pastrybyp-field select:focus,
.pastrybyp-panel .pastrybyp-field textarea:focus {
    outline: none !important;
    border-color: var(--pbp-rose) !important;
    box-shadow: 0 0 0 3px var(--pbp-rose-glow) !important;
    background: #fff !important;
}
.pastrybyp-panel .pastrybyp-field input::placeholder,
.pastrybyp-panel .pastrybyp-field textarea::placeholder {
    color: #c4b8b0 !important;
    font-weight: 400 !important;
}
.pastrybyp-panel .pastrybyp-field textarea {
    resize: vertical;
    min-height: 100px;
}
/* ── Custom select dropdown ─────────────────────────────────── */
.pbp-select {
    position: relative;
    width: 100%;
}
.pbp-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px !important;
    border: 1px solid var(--pbp-border);
    border-radius: var(--pbp-radius-sm);
    font-family: var(--pbp-font-body);
    font-size: 15px;
    color: var(--pbp-text);
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .25s, box-shadow .25s;
    line-height: 1.4;
    user-select: none;
    -webkit-user-select: none;
}
.pbp-select__trigger:hover {
    border-color: #d4c4bb;
}
.pbp-select.is-open .pbp-select__trigger {
    border-color: var(--pbp-rose);
    box-shadow: 0 0 0 3px var(--pbp-rose-glow);
}
.pbp-select__value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pbp-select__value.is-placeholder {
    color: #c4b8b0;
}
.pbp-select__arrow {
    flex-shrink: 0;
    color: var(--pbp-warm-gray-light);
    transition: transform .25s ease;
    margin-left: 8px;
}
.pbp-select.is-open .pbp-select__arrow {
    transform: rotate(180deg);
    color: var(--pbp-rose);
}

/* Dropdown list */
.pbp-select__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--pbp-border);
    border-radius: var(--pbp-radius-sm);
    box-shadow: 0 8px 30px rgba(61,48,42,.12), 0 2px 8px rgba(61,48,42,.06);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    max-height: 240px;
    overflow-y: auto;
}
.pbp-select.is-open .pbp-select__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Options */
.pbp-select__option {
    padding: 10px 18px;
    font-family: var(--pbp-font-body);
    font-size: 14px;
    color: var(--pbp-text);
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1.4;
}
.pbp-select__option:hover {
    background: var(--pbp-rose-light);
    color: var(--pbp-rose);
}
.pbp-select__option.is-selected {
    color: var(--pbp-rose);
    font-weight: 600;
    background: var(--pbp-rose-light);
}
.pbp-select__option.is-placeholder {
    color: var(--pbp-warm-gray-light);
    font-weight: 400;
}
.pbp-select__option.is-placeholder.is-selected {
    background: transparent;
    font-weight: 400;
}

/* ── Submit button ──────────────────────────────────────────── */
.pastrybyp-panel .pastrybyp-form__submit {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 24px !important;
    background: var(--pbp-rose) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50px !important;
    font-family: var(--pbp-font-body) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: .4px;
    cursor: pointer;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 20px var(--pbp-rose-glow);
    box-sizing: border-box !important;
}
.pastrybyp-panel .pastrybyp-form__submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 50%);
    pointer-events: none;
}
.pastrybyp-panel .pastrybyp-form__submit:hover {
    background: var(--pbp-rose-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(199,107,127,.35);
}
.pastrybyp-panel .pastrybyp-form__submit:active {
    transform: translateY(0);
}
.pastrybyp-panel .pastrybyp-form__submit:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.pastrybyp-form__submit-arrow {
    transition: transform .25s;
}
.pastrybyp-panel .pastrybyp-form__submit:hover .pastrybyp-form__submit-arrow {
    transform: translateX(3px);
}

/* ── Error feedback ─────────────────────────────────────────── */
.pastrybyp-form__feedback {
    margin-bottom: 12px;
    padding: 0;
    font-family: var(--pbp-font-body);
    font-size: 13px;
    text-align: center;
    border-radius: var(--pbp-radius-sm);
}
.pastrybyp-form__feedback.is-error {
    color: #9e3a3a;
    background: #fce8e8;
    border: 1px solid #f5d0d0;
    padding: 11px 16px;
}

/* ── Validation ─────────────────────────────────────────────── */
.pastrybyp-field input.is-invalid,
.pastrybyp-field textarea.is-invalid {
    border-color: #e07070;
    box-shadow: 0 0 0 3px rgba(224,112,112,.12);
    background: #fffaf9;
}

/* ═══════════════════════════════════════════════════════════════
   SUCCESS STATE
   ═══════════════════════════════════════════════════════════════ */
.pastrybyp-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    text-align: center;
    padding: 40px 20px;
}
.pastrybyp-success.is-visible {
    animation: pbp-fadeUp .6s cubic-bezier(.22,1,.36,1) both;
}

/* Animated checkmark */
.pastrybyp-success__icon {
    width: 84px;
    height: 84px;
    margin-bottom: 28px;
}
.pastrybyp-success__icon svg {
    width: 84px;
    height: 84px;
}
.pastrybyp-success__circle {
    fill: none;
    stroke: #66bb6a;
    stroke-width: 2;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
}
.pastrybyp-success.is-visible .pastrybyp-success__circle {
    animation: pbp-drawCircle .6s .1s cubic-bezier(.4,0,.2,1) forwards;
}
.pastrybyp-success__check {
    fill: none;
    stroke: #66bb6a;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
}
.pastrybyp-success.is-visible .pastrybyp-success__check {
    animation: pbp-drawCheck .4s .55s ease forwards;
}

.pastrybyp-success__title {
    font-family: var(--pbp-font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--pbp-text);
    margin: 0 0 8px;
    opacity: 0;
}
.pastrybyp-success.is-visible .pastrybyp-success__title {
    animation: pbp-fadeUp .5s .7s ease forwards;
}
.pastrybyp-success__text {
    font-family: var(--pbp-font-body);
    font-size: 15px;
    color: var(--pbp-text-light);
    margin: 0;
    line-height: 1.5;
    opacity: 0;
}
.pastrybyp-success.is-visible .pastrybyp-success__text {
    animation: pbp-fadeUp .5s .85s ease forwards;
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes pbp-fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pbp-drawCircle {
    to { stroke-dashoffset: 0; }
}
@keyframes pbp-drawCheck {
    to { stroke-dashoffset: 0; }
}

/* ── "Coming soon" state (store closed) ────────────────────── */
.pastrybyp-coming-soon {
    text-align: center;
    padding: 48px 24px;
}
.pastrybyp-coming-soon__icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}
.pastrybyp-coming-soon__title {
    font-family: var(--pbp-font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--pbp-text);
    margin: 0 0 12px;
}
.pastrybyp-coming-soon__date {
    font-family: var(--pbp-font-body);
    font-size: 16px;
    color: var(--pbp-rose);
    margin: 0 0 8px;
}
.pastrybyp-coming-soon__date strong {
    font-weight: 700;
}
.pastrybyp-coming-soon__text {
    font-family: var(--pbp-font-body);
    font-size: 14px;
    color: var(--pbp-text-light);
    margin: 0;
}

/* ── Body scroll lock ───────────────────────────────────────── */
body.pastrybyp-no-scroll {
    overflow: hidden;
}

/* ── Mobile tweaks ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .pastrybyp-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .pastrybyp-panel__header {
        padding: 28px 24px 20px;
    }
    .pastrybyp-panel__header::after {
        left: 24px;
        right: 24px;
    }
    .pastrybyp-panel__body {
        padding: 24px 24px 32px;
    }
    .pastrybyp-row {
        flex-direction: column;
        gap: 0;
    }
    .pastrybyp-panel__title {
        font-size: 28px;
    }
}
