/* =========================================================
   GIYENZA - MODERN DISCOUNT SYSTEM (TAM SAYFA)
   ========================================================= */

:root {
    --chest-size: 100px;
    --chest-mobile-width: 100px;
    --chest-mobile-height: 90px;
}

/* MODAL */
.discount-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}
.discount-modal:not(.hidden) {
    visibility: visible;
    opacity: 1;
}
.discount-modal.hidden { display: none; }
.discount-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}
.discount-modal-box {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: transparent;
    z-index: 10;
}
.discount-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.discount-close-btn:hover { transform: scale(1.05); background: #dc2626; }

/* FLOATING LAYOUT */
.discount-floating-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: floatScene 4s ease-in-out infinite;
}
@keyframes floatScene {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* BUBBLE */
.discount-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    background: linear-gradient(135deg, #2563eb, #4338ca);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: bubbleFloat 3s ease-in-out infinite;
    text-align: center;
}
.discount-title-bubble {
    font-size: 20px;
    font-weight: 900;
    padding: 10px 20px;
}
.discount-subtitle-bubble {
    font-size: 13px;
}
.cart-total-bubble {
    background: linear-gradient(135deg, #10b981, #059669);
}
@keyframes bubbleFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* BUTTON */
.spin-button {
    min-width: 150px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4338ca);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
}
.spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}

/* ÇARK YAZILARI */
.wheel-segment span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    white-space: nowrap;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 40px;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.3);
    pointer-events: none;
    z-index: 5;
}
@media (max-width: 640px) {
    .wheel-segment span { font-size: 10px; padding: 4px 8px; }
}

/* SANDIK */
.chest-floating-area {
    width: var(--chest-size);
    height: var(--chest-size);
    margin: 0 auto;
    animation: chestFloat 3.5s ease-in-out infinite;
}
@keyframes chestFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.gift-chest {
    width: var(--chest-size);
    height: var(--chest-size);
    position: relative;
    perspective: 1000px;
    cursor: pointer;
}
.gift-chest::before, .gift-chest::after {
    content: "";
    position: absolute;
    background: linear-gradient(180deg, #ef4444, #ec4899, #3b82f6);
    border-radius: 2px;
    z-index: 4;
}
.gift-chest::before {
    width: 12px;
    height: 105%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.gift-chest::after {
    width: 105%;
    height: 12px;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
}
.chest-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 65px;
    background: linear-gradient(180deg, #d97706, #b45309, #78350f);
    border-radius: 0 0 12px 12px;
    border: 3px solid #facc15;
    border-top: none;
    box-shadow: inset 0 10px 15px rgba(0,0,0,0.4);
    z-index: 2;
}
.chest-bottom::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #facc15;
    border: 2px solid #78350f;
    border-radius: 4px;
    z-index: 5;
}
.chest-lid {
    position: absolute;
    top: 12px;
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg, #fef08a, #f59e0b, #b45309);
    border-radius: 14px 14px 4px 4px;
    border: 3px solid #facc15;
    transform-origin: bottom center;
    transition: transform 0.8s ease;
    z-index: 3;
}
.gift-chest.open .chest-lid {
    transform: rotateX(-110deg) translateY(-10px);
    z-index: 1;
}
.chest-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(circle, rgba(250,204,21,0.8), transparent 70%);
    opacity: 0;
    filter: blur(5px);
    transition: 0.6s;
    pointer-events: none;
}
.gift-chest.open .chest-glow {
    opacity: 1;
    transform: scale(1.4);
    animation: pulseGlow 2s infinite alternate;
}
@keyframes pulseGlow {
    0% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 1; }
}

/* ÖDÜL EKRANI - BOŞLUKLAR ARTIRILDI */
.reward-wrapper {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.reward-icon {
    font-size: 64px;
    margin-bottom: 0;
}
.discount-bubble.reward-bubble {
    margin-bottom: 0;
}
.reward-code {
    width: 100%;
    padding: 14px;
    margin-top: 0;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    text-align: center;
    letter-spacing: 4px;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}
.reward-code:hover {
    transform: scale(1.02);
}
#copyHint {
    margin-top: 0;
    margin-bottom: 0;
    cursor: pointer;
    background: rgba(0,0,0,0.08);
    transition: 0.2s;
}
#copyHint:hover {
    background: rgba(0,0,0,0.15);
}
.spin-button[onclick*="/odeme"] {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .discount-modal-box { max-width: 280px; }
    .chest-floating-area { width: var(--chest-mobile-width); height: var(--chest-mobile-height); }
    .gift-chest { width: var(--chest-mobile-width); height: var(--chest-mobile-height); }
    .spin-button { min-width: 130px; height: 40px; font-size: 12px; }
    .reward-code { font-size: 16px; letter-spacing: 2px; padding: 10px; }
    .reward-wrapper { gap: 12px; }
}