/* =========================================================
   IBBANI OFFERS & REWARDS
   Golden Envelope Experience
   LOCAL DEVELOPMENT
========================================================= */

:root {
    --ibbani-reward-green: #163f2e;
    --ibbani-reward-green-dark: #0d2d20;
    --ibbani-reward-cream: #fffaf0;
    --ibbani-reward-paper: #fffdf7;
    --ibbani-reward-gold: #c79a3b;
    --ibbani-reward-gold-light: #f0d387;
    --ibbani-reward-gold-dark: #8d6521;
}

/* ---------- Overlay ---------- */

.ibbani-rewards-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at center, rgba(10, 38, 27, 0.18), rgba(5, 20, 14, 0.72));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.ibbani-rewards-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---------- Main popup stage ---------- */

.ibbani-rewards-stage {
    position: relative;
    width: min(520px, 94vw);
    min-height: 390px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    perspective: 1200px;
}

/* =========================================================
   ENVELOPE
========================================================= */

.ibbani-gold-envelope {
    position: relative;
    width: 390px;
    max-width: 86vw;
    height: 245px;
    cursor: pointer;
    filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.32));
    transform-origin: center center;
    transition:
        transform 0.65s cubic-bezier(.22,.8,.26,1),
        opacity 0.35s ease;
}

/* envelope body */

.ibbani-envelope-body {
    position: absolute;
    inset: 42px 0 0;
    overflow: hidden;
    border: 1px solid rgba(117, 75, 12, 0.45);
    border-radius: 8px 8px 16px 16px;
    background:
        linear-gradient(
            145deg,
            #f2d887 0%,
            #d9ae50 27%,
            #bb8730 60%,
            #e4bd62 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.65),
        inset 0 -8px 18px rgba(104,65,12,.18);
}

/* left fold */

.ibbani-envelope-body::before {
    content: "";
    position: absolute;
    left: -4%;
    bottom: -34%;
    width: 72%;
    height: 110%;
    background:
        linear-gradient(135deg, #e9c96f, #b97c26);
    transform: rotate(33deg);
    transform-origin: bottom left;
    border-top: 1px solid rgba(111,74,16,.25);
}

/* right fold */

.ibbani-envelope-body::after {
    content: "";
    position: absolute;
    right: -4%;
    bottom: -34%;
    width: 72%;
    height: 110%;
    background:
        linear-gradient(225deg, #efcf76, #a96d1e);
    transform: rotate(-33deg);
    transform-origin: bottom right;
    border-top: 1px solid rgba(111,74,16,.25);
}

/* top flap */

.ibbani-envelope-flap {
    position: absolute;
    z-index: 6;
    top: 41px;
    left: 2px;
    width: calc(100% - 4px);
    height: 150px;
    background:
        linear-gradient(
            160deg,
            #f6dc8b 0%,
            #c48e31 58%,
            #a46c1f 100%
        );
    clip-path: polygon(0 0, 50% 88%, 100% 0);
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(.22,.8,.26,1);
    border-radius: 5px;
}

/* decorative gold line */

.ibbani-envelope-flap::after {
    content: "";
    position: absolute;
    left: 17%;
    right: 17%;
    top: 19%;
    height: 1px;
    background: rgba(255,255,255,.4);
}

/* =========================================================
   PAPERS
========================================================= */

.ibbani-envelope-paper-stack {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 88px;
    width: 76%;
    height: 145px;
    transform: translateX(-50%);
    pointer-events: none;
}

.ibbani-paper-peek {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 90%;
    height: 128px;
    border-radius: 8px 8px 3px 3px;
    border: 1px solid rgba(151,107,34,.28);
    background: #fff9e9;
    box-shadow: 0 7px 14px rgba(65,44,10,.18);
}

.ibbani-paper-peek:nth-child(1) {
    transform: translateX(-54%) rotate(-6deg);
}

.ibbani-paper-peek:nth-child(2) {
    transform: translateX(-46%) rotate(5deg);
}

.ibbani-paper-peek:nth-child(3) {
    transform: translateX(-50%);
    background:
        linear-gradient(#fffdf7, #fff7e4);
}

.ibbani-paper-peek::before,
.ibbani-paper-peek::after {
    content: "";
    position: absolute;
    left: 16%;
    right: 16%;
    height: 2px;
    background: rgba(164,116,38,.22);
}

.ibbani-paper-peek::before {
    top: 25px;
}

.ibbani-paper-peek::after {
    top: 39px;
}

/* =========================================================
   WAX SEAL
========================================================= */

.ibbani-envelope-seal {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 55px;
    width: 65px;
    height: 65px;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff4cf;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 1px;
    background:
        radial-gradient(circle at 35% 30%, #eccf75 0%, #bf8b2d 45%, #795015 100%);
    border: 4px double rgba(255,238,186,.78);
    box-shadow:
        0 5px 12px rgba(69,43,7,.35),
        inset 0 2px 4px rgba(255,255,255,.35);
}

.ibbani-envelope-caption {
    position: absolute;
    z-index: 11;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 999px;
    color: #50370d;
    background: rgba(255,244,203,.8);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
}

/* =========================================================
   INITIAL INVITATION
========================================================= */

.ibbani-reward-invitation {
    position: absolute;
    bottom: -57px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 90vw;
    color: #fff;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    text-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.ibbani-reward-invitation strong {
    display: block;
    color: #ffe7a2;
    font-family: Georgia, serif;
    font-size: 18px;
}

/* =========================================================
   OPEN REWARD LETTER
========================================================= */

.ibbani-reward-letter {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 58px;
    width: min(420px, 86vw);
    max-height: min(650px, 78vh);
    overflow-y: auto;
    padding: 32px 30px 28px;
    transform:
        translate(-50%, 115px)
        scale(.82);
    transform-origin: bottom center;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(174,126,42,.45);
    border-radius: 18px 18px 8px 8px;
    color: #29382f;
    background:
        linear-gradient(
            180deg,
            #fffdf8 0%,
            #fff8e9 100%
        );
    box-shadow:
        0 25px 55px rgba(0,0,0,.32),
        inset 0 0 0 6px rgba(203,158,64,.08);
    transition:
        transform .82s cubic-bezier(.2,.8,.2,1),
        opacity .45s ease;
}

/* fine inner border */

.ibbani-reward-letter::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 12px;
    border: 1px solid rgba(183,135,48,.18);
    pointer-events: none;
}

/* =========================================================
   OPEN STATE ANIMATION
========================================================= */

.ibbani-rewards-stage.is-open .ibbani-envelope-flap {
    transform: rotateX(178deg);
    z-index: 1;
}

.ibbani-rewards-stage.is-open .ibbani-reward-letter {
    opacity: 1;
    pointer-events: auto;
    transform:
        translate(-50%, -135px)
        scale(1);
}

.ibbani-rewards-stage.is-open .ibbani-envelope-seal,
.ibbani-rewards-stage.is-open .ibbani-envelope-caption {
    opacity: .18;
}

/* =========================================================
   LETTER HEADER
========================================================= */

.ibbani-reward-brand {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 21px;
}

.ibbani-reward-brand-mark {
    width: 52px;
    height: 52px;
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #f4db90;
    background: var(--ibbani-reward-green);
    border: 2px solid var(--ibbani-reward-gold);
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 700;
}

.ibbani-reward-brand-name {
    margin: 0;
    color: var(--ibbani-reward-green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    letter-spacing: .13em;
}

.ibbani-reward-brand-sub {
    margin-top: 3px;
    color: #a57b2f;
    font-size: 9px;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.ibbani-reward-title {
    position: relative;
    z-index: 2;
    margin: 18px 0 7px;
    color: #244c38;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(21px, 3vw, 28px);
    line-height: 1.2;
    text-align: center;
}

.ibbani-reward-intro {
    position: relative;
    z-index: 2;
    margin: 0 auto 23px;
    max-width: 330px;
    color: #6e6b5d;
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
}

/* =========================================================
   REWARD ITEMS
========================================================= */

.ibbani-reward-list {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 10px;
}

.ibbani-reward-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(247,238,213,.66);
    border: 1px solid rgba(194,147,59,.17);
}

.ibbani-reward-icon {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #765319;
    background:
        linear-gradient(145deg, #f5df9c, #d3a84f);
    box-shadow: inset 0 0 0 1px rgba(124,83,20,.18);
    font-size: 18px;
}

.ibbani-reward-item strong {
    display: block;
    margin-bottom: 2px;
    color: #254735;
    font-size: 14px;
}

.ibbani-reward-item span {
    display: block;
    color: #736d60;
    font-size: 12px;
    line-height: 1.4;
}

/* =========================================================
   CTA / CLOSE
========================================================= */

.ibbani-reward-actions {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.ibbani-reward-got-it {
    appearance: none;
    min-width: 148px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #21503b,
            #103322
        );
    box-shadow: 0 8px 18px rgba(17,58,39,.22);
    cursor: pointer;
    font-weight: 700;
    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.ibbani-reward-got-it:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 22px rgba(17,58,39,.28);
}

.ibbani-reward-close {
    position: absolute;
    z-index: 12;
    top: 12px;
    right: 12px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(141,101,33,.3);
    border-radius: 50%;
    color: #674915;
    background: #f5df9f;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* =========================================================
   DOCKED WIDGET
========================================================= */

.ibbani-rewards-dock {
    position: fixed;
    z-index: 9997;
    left: 22px;
    bottom: 96px;
    width: 112px;
    min-height: 82px;
    padding: 8px 9px 10px;
    border: 0;
    border-radius: 16px;
    color: #533809;
    background:
        linear-gradient(
            145deg,
            #f3d77e,
            #bd862b
        );
    box-shadow:
        0 12px 26px rgba(26,42,31,.25),
        inset 0 1px 0 rgba(255,255,255,.55);
    cursor: pointer;
    transform:
        translateY(25px)
        scale(.75);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .4s ease,
        transform .55s cubic-bezier(.2,.8,.2,1);
}

.ibbani-rewards-dock.is-visible {
    transform:
        translateY(0)
        scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ibbani-dock-paper {
    position: absolute;
    width: 47px;
    height: 29px;
    top: -15px;
    left: 50%;
    border-radius: 4px 4px 0 0;
    background: #fff8df;
    border: 1px solid rgba(129,88,22,.22);
}

.ibbani-dock-paper.one {
    transform: translateX(-58%) rotate(-7deg);
}

.ibbani-dock-paper.two {
    transform: translateX(-38%) rotate(6deg);
}

.ibbani-dock-envelope {
    position: relative;
    height: 43px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 5px 5px 9px 9px;
    background:
        linear-gradient(145deg,#f0d57f,#b87d24);
}

.ibbani-dock-envelope::before,
.ibbani-dock-envelope::after {
    content: "";
    position: absolute;
    bottom: -25px;
    width: 66px;
    height: 62px;
    background: rgba(255,225,137,.45);
}

.ibbani-dock-envelope::before {
    left: -21px;
    transform: rotate(38deg);
}

.ibbani-dock-envelope::after {
    right: -21px;
    transform: rotate(-38deg);
}

.ibbani-dock-label {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .ibbani-rewards-overlay {
        padding: 14px;
    }

    .ibbani-rewards-stage {
        min-height: 330px;
    }

    .ibbani-gold-envelope {
        width: 300px;
        height: 200px;
    }

    .ibbani-envelope-body {
        top: 35px;
    }

    .ibbani-envelope-flap {
        top: 34px;
        height: 120px;
    }

    .ibbani-envelope-paper-stack {
        bottom: 72px;
        height: 116px;
    }

    .ibbani-paper-peek {
        height: 105px;
    }

    .ibbani-envelope-seal {
        width: 54px;
        height: 54px;
        bottom: 42px;
        font-size: 19px;
    }

    .ibbani-envelope-caption {
        bottom: 10px;
        font-size: 11px;
    }

    .ibbani-reward-invitation {
        bottom: -56px;
        font-size: 12px;
    }

    .ibbani-reward-invitation strong {
        font-size: 16px;
    }

    .ibbani-reward-letter {
        bottom: 42px;
        width: min(360px, 92vw);
        max-height: 72vh;
        padding: 27px 19px 22px;
    }

    .ibbani-rewards-stage.is-open .ibbani-reward-letter {
        transform:
            translate(-50%, -95px)
            scale(1);
    }

    .ibbani-reward-item {
        grid-template-columns: 36px 1fr;
        padding: 10px;
    }

    .ibbani-reward-icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .ibbani-rewards-dock {
        left: 14px;
        bottom: 90px;
        width: 94px;
        min-height: 72px;
    }

    .ibbani-dock-label {
        font-size: 10px;
    }
}

/* reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
    .ibbani-rewards-overlay,
    .ibbani-gold-envelope,
    .ibbani-envelope-flap,
    .ibbani-reward-letter,
    .ibbani-rewards-dock,
    .ibbani-reward-got-it {
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   OPEN LETTER POLISH - LOCAL
   Match approved golden-envelope concept
========================================================= */

.ibbani-rewards-stage {
    height: min(720px, 90vh);
    min-height: 0;
    align-items: flex-end;
}

.ibbani-gold-envelope {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
}

.ibbani-reward-letter {
    bottom: 150px;
    width: min(430px, 88vw);
    max-height: none;
    overflow: visible;
    padding: 25px 27px 23px;

    transform:
        translate(-50%, 75px)
        scale(.88);
}

.ibbani-rewards-stage.is-open .ibbani-reward-letter {
    transform:
        translate(-50%, 0)
        scale(1);
}

/* Compact reward list like the approved mockup */

.ibbani-reward-list {
    gap: 8px;
}

.ibbani-reward-item {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 10px 12px;
}

.ibbani-reward-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
}

.ibbani-reward-item strong {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
}

/* The mockup uses short benefit lines, not long explanations */
.ibbani-reward-item span {
    display: none;
}

.ibbani-reward-brand {
    margin-bottom: 14px;
}

.ibbani-reward-brand-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
    font-size: 17px;
}

.ibbani-reward-brand-name {
    font-size: 21px;
}

.ibbani-reward-title {
    margin: 13px 0 5px;
    font-size: 23px;
}

.ibbani-reward-intro {
    margin-bottom: 16px;
    font-size: 12px;
}

.ibbani-reward-actions {
    margin-top: 16px;
}

.ibbani-reward-got-it {
    padding: 10px 22px;
}

/* Mobile tuning */

@media (max-width: 600px) {

    .ibbani-rewards-stage {
        height: min(690px, 92vh);
    }

    .ibbani-gold-envelope {
        bottom: 8px;
    }

    .ibbani-reward-letter {
        bottom: 120px;
        width: min(345px, 92vw);
        padding: 21px 16px 18px;
    }

    .ibbani-reward-title {
        font-size: 20px;
    }

    .ibbani-reward-intro {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .ibbani-reward-list {
        gap: 6px;
    }

    .ibbani-reward-item {
        padding: 8px 9px;
    }
}


/* =========================================================
   DESKTOP / LAPTOP OPEN LETTER FIT
========================================================= */

@media (min-width: 901px) {

    .ibbani-rewards-overlay {
        padding: 12px 20px;
    }

    .ibbani-rewards-stage {
        width: min(520px, 94vw);
        height: min(690px, calc(100vh - 24px));
        min-height: 0;
    }

    .ibbani-gold-envelope {
        bottom: 0;
    }

    .ibbani-reward-letter {
        bottom: 72px;
        width: min(420px, 88vw);
        max-height: calc(100vh - 38px);
        overflow-y: auto;
        padding: 22px 25px 20px;
    }

    .ibbani-rewards-stage.is-open .ibbani-reward-letter {
        transform:
            translate(-50%, 0)
            scale(.96);
    }
}

/* =========================================================
   IBBANI HOMESTAY ICON BRANDING
========================================================= */

.ibbani-envelope-seal img {
    display: block;
    width: 78%;
    height: 78%;
    object-fit: contain;
    border-radius: 50%;
}

.ibbani-reward-brand-mark {
    width: 56px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.ibbani-reward-brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 600px) {
    .ibbani-reward-brand-mark {
        width: 48px;
        height: 48px;
    }
}

/* ===== REWARD HEADER ICON SIZE ===== */
.ibbani-reward-brand-mark {
    width: 68px;
    height: 68px;
}

.ibbani-reward-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 600px) {
    .ibbani-reward-brand-mark {
        width: 58px;
        height: 58px;
    }
}
/* =========================================================
   IBBANI REWARD SHEET LOWER POSITION 20260816
   Visual positioning only
========================================================= */

.ibbani-reward-letter {
    bottom: 20px;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
}

@media (max-width: 600px) {
    .ibbani-reward-letter {
        bottom: 56px;
    }
}


/* ---------- IBBANI PUBLIC MOBILE FLOATING CTA POLISH ---------- */
@media (max-width:600px){

    .ibbani-rewards-dock{
        left:8px;
        bottom:82px;
        width:82px;
        min-height:64px;
        padding:7px 8px 8px;
        border-radius:14px;
    }

    .ibbani-dock-envelope{
        height:38px;
        margin-top:7px;
    }

    .ibbani-dock-paper{
        width:42px;
        height:25px;
        top:-13px;
    }

    .ibbani-dock-label{
        margin-top:4px;
        font-size:9px;
        line-height:1.05;
    }

}
