/* market/styles.css – Magyar pénz: bolti fizetés játék */

.shop-container {
    width: 100%;
    margin: 0 auto;
    padding: 0.6rem 0.6rem 1.2rem;
    box-sizing: border-box;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}


.shop-shelf {
    max-width: 100%;
    border-radius: 6px;
    padding: 3vw 0 2rem;
    position: relative;
    overflow: hidden;

    border-style: solid;
    border-color: transparent;
    border-width: 30px;

    border-image-source: url('assets/polc.png');
    border-image-slice: 90;
    border-image-width: 30px;
    border-image-repeat: round;

    background-image:
        linear-gradient(to bottom, rgba(93, 58, 36, 0.85), rgba(44, 26, 14, 0.9)),
        url('assets/wood-texture.png');

    background-size:
        100% 100%,
        400px auto;

    background-position:
        center,
        center bottom;

    background-repeat:
        no-repeat,
        repeat;

    background-clip: padding-box;

    box-shadow: inset 0 3px 10px rgba(0, 0, 0, .4);
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.7));
}

.shop-image {
    position: relative;
    z-index: 1;
    bottom: -3vw;
    max-width: calc(100% + 16px);

    height: auto;
    margin-left: -8px;
    margin-right: -8px;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.5));
}

.shop-shelf-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 20px 0;
    overflow: hidden;
}

.shop-shelf-item {
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform .13s;
    min-width: 60px;
    position: relative;
}


.shop-shelf-item::before {
    content: '';
    width: 2000px;
    left: -1000px;
    position: absolute;
    bottom: 10px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: url(assets/shelf.svg);
    background-size: auto 50px;
    background-repeat: repeat-x;
    background-position: bottom center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.shop-shelf-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.shop-shelf-emoji {
    z-index: 1;
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.2));
    margin: 0 20px;
}

.shop-shelf-name {
    z-index: 1;
    text-align: center;
    color: #fef9e7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
    margin: 0 20px;
}

.shop-shelf-price {
    background: #fef9e7;
    color: #2c1a06;
    border-radius: 20px;
    padding: 2px 10px;
    z-index: 1;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    font-weight: bold;
    margin: 0 20px 15px;
}

.shop-bottom-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}


.shop-register {
    flex: 1;
    min-width: 0;
    background: linear-gradient(160deg, #3d2b1a 0%, #2a1d0e 100%);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    border: 3px solid #6b3d1e;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.shop-register-title {
    font-size: smaller;
    font-weight: bold;
    text-transform: uppercase;
    color: #d4a76a;
    margin-bottom: 0.6rem;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, .06);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
}

.shop-item-emoji {
    font-size: 1.4rem;
    width: 1.8rem;
    text-align: center;
    flex-shrink: 0;
}

.shop-item-name {
    flex: 1;
    font-size: smaller;
    color: #f5e6d0;
}

.shop-item-price {
    font-size: smaller;
    color: #fff;
    white-space: nowrap;
}

.shop-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(212, 167, 106, .4);
}

.shop-total-label {
    font-weight: 600;
    color: #d4a76a;
}

.shop-total-val {
    font-size: 1.55rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.shop-total-val--over {
    color: #ff6b6b !important;
}

.shop-over-budget {
    text-align: center;
    font-weight: bold;
    color: #ff8a7a;
    padding: 0.2rem 0;
}

.shop-cart-empty {
    color: rgba(212, 167, 106, .55);
    font-style: italic;
    padding: 0.4rem 0;
}

.shop-cart-remove {
    background: rgba(231, 76, 60, .25);
    border: 1px solid rgba(231, 76, 60, .4);
    color: #ff9c8f;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-cart-remove:hover {
    background: rgba(231, 76, 60, .55);
    color: #fff;
}


.shop-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.shop-pay-btn {
    min-width: 140px;
    font-weight: bold;
}

.shop-tray {
    background: linear-gradient(160deg, #1a1208 0%, #2a1d0e 100%);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    border: 2px solid rgba(139, 94, 60, .5);
    margin-top: 0.5rem;
    min-height: 70px;
    transition: border-color .25s;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4);
}

.shop-tray--ok {
    border-color: rgba(92, 184, 92, .7);
}

.shop-tray--err {
    border-color: rgba(231, 76, 60, .6);
}

.shop-tray-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.shop-tray-label {
    font-weight: bold;
    text-transform: uppercase;
    color: #d4a76a;
}

.shop-tray-sum {
    font-size: 1.25rem;
    font-weight: bold;
    color: rgba(255, 255, 255, .6);
    transition: color .2s;
}

.shop-tray-sum--ok {
    color: #5cb85c;
}

.shop-tray-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    min-height: 34px;
}

.tray-empty {
    color: rgba(212, 167, 106, .4);
    font-style: italic;
}

.tray-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tray-chip-img {
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5));
    pointer-events: none;
}

.tray-chip--coin .tray-chip-img {
    width: 52px;
   
}

.tray-chip--note .tray-chip-img {
    height: 26px;
    width: auto;
    max-width: 52px;
}

.shop-undo-btn-inline {
    background: rgba(212, 167, 106, .2);
    border: 1px solid rgba(212, 167, 106, .3);
    color: #d4a76a;
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: background .15s;
    margin-left: auto;
}

.shop-undo-btn-inline:hover {
    background: rgba(212, 167, 106, .4);
}

.shop-feedback {
    text-align: center;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    animation: shopFadeIn .25s ease;
}

.shop-feedback--success {
    background: rgba(92, 184, 92, .2);
    color: #7de87d;
    border: 1.5px solid rgba(92, 184, 92, .6);
}

.shop-feedback--insufficient {
    background: rgba(231, 76, 60, .18);
    color: #ff8a7a;
    border: 1.5px solid rgba(231, 76, 60, .5);
}

.shop-change-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.shop-change-label {
    font-weight: bold;
    opacity: .85;
}

.shop-change-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
}

.shop-change-total {
    font-weight: bold;
    color: #ffd700;
    margin-left: 0.3rem;
}

.shop-wallet {
    width: 360px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #3d2b1a 0%, #2a1d0e 100%);
    border-radius: 14px;
    padding: 0.7rem 0.8rem 0.8rem;
    border: 3px solid #6b3d1e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}

.shop-wallet-title {
    font-size: smaller;
    font-weight: bold;
    text-transform: uppercase;
    color: #d4a76a;
}

.shop-wallet-total {
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.shop-wallet-total--updated {
    animation: walletUpdate 0.5s ease forwards;
}

.shop-denoms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


.shop-denom-stack {
    position: relative;
    display: block;
    flex-shrink: 0;
}

.shop-denom {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s, filter .12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shop-denom:disabled {
    cursor: not-allowed;
}

.shop-denom:not(:disabled):hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .6));
}

.shop-denom:not(:disabled):active {
    filter: brightness(.82);
}


@keyframes shopFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes walletUpdate {
    0% {
        transform: scale(1);
        color: #ffd700;
    }

    40% {
        transform: scale(1.25);
        color: #7de87d;
    }

    100% {
        transform: scale(1);
        color: #7de87d;
    }
}


.flying-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.flying-coin {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
    animation: flyMoney 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
    object-fit: contain;
}

@keyframes flyMoney {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    35% {
        transform: translate(calc(var(--dx)*.35), calc(var(--dy)*.35 - 45px)) scale(1.25) rotate(8deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.45) rotate(-6deg);
        opacity: 0;
    }
}

@media (max-width: 1030px) {
.shop-bottom-row {
        flex-direction: column;
    }

    .shop-wallet,
    .shop-register {
        width: 100%;
    }


}

@media (max-width: 769px) {
     

    .shop-shelf {
        border-width: 16px;
        border-image-width: 16px;
    }
}