/* Modal Window Styles */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

#modal {
    position: relative;
    background: linear-gradient(to bottom, #ffffff, #fff5e6);
    border-radius: 16px;
    padding: 32px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

#close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 28px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    cursor: pointer;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

#close-btn:hover {
    background: #FF4500;
    color: #fff;
}

#modal h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: #FF4500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#modal p {
    font-size: 16px;
    color: #555;
    margin-bottom: 32px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    background: #93cbccc2;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.service-card img {
    cursor: pointer;
    width: 120px;
    height: auto;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.service-card img:hover {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 20px;
    margin: 8px 0;
    color: #333;
}

.promo {
    background: #FFEFD5;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    color: #D2691E;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.benefit {
    font-size: 14px;
    color: #228B22;
    margin-bottom: 16px;
    font-style: italic;
}

.service-card button {
    background: linear-gradient(to right, #FF4500, #FF6347);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.service-card button:hover {
    transform: scale(1.05);
    background: linear-gradient(to right, #FF6347, #FF4500);
}

#timer {
    font-size: 14px;
    color: #FF0000;
    margin-top: 12px;
    font-weight: bold;
}

#spinner {
    margin-top: 32px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#spinner button {
    background: linear-gradient(to right, #32CD32, #3CB371);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

#spinner button:hover {
    transform: scale(1.05);
}

#wheel-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 20px auto;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2), inset 0 0 10px rgba(255,255,255,0.5);
}

#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #FF6347 0deg 72deg,   /* Soft red-orange */
        #FFD700 72deg 144deg,  /* Gold */
        #90EE90 144deg 216deg,  /* Light green */
        #87CEEB 216deg 288deg,  /* Sky blue */
        #FFB6C1 288deg 360deg  /* Light pink */
    );
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.sector-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    transform-origin: center;
    pointer-events: none;
}

/* Привязка меток к центрам секций */
.sector-label:nth-child(1) {
    transform: translate(-50%, -50%) rotate(36deg) translateY(-80px) rotate(-36deg);
}
.sector-label:nth-child(2) {
    transform: translate(-50%, -50%) rotate(108deg) translateY(-80px) rotate(-108deg);
}
.sector-label:nth-child(3) {
    transform: translate(-50%, -50%) rotate(180deg) translateY(-80px) rotate(-180deg);
}
.sector-label:nth-child(4) {
    transform: translate(-50%, -50%) rotate(252deg) translateY(-80px) rotate(-252deg);
}
.sector-label:nth-child(5) {
    transform: translate(-50%, -50%) rotate(324deg) translateY(-80px) rotate(-324deg);
}

#arrow {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #FF4500;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

#disable-modal {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

#disable-checkbox {
    margin-right: 8px;
}

@media (max-width: 768px) {
    #modal {
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        height: calc(100% - 40px);
        max-height: calc(100% - 40px);
        border-radius: 16px;
        padding: 20px;
        margin: 20px 10px;
        position: relative;
    }
    
    #modal-overlay {
        padding: 20px 10px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        width: 100%;
    }

    .service-card img {
        width: 100px;
    }

    #modal h2 {
        font-size: 24px;
    }

    #wheel-container {
        width: 180px;
        height: 180px;
    }

    .sector-label {
        font-size: 14px;
        width: 40px;
    }

    /* Адаптивная привязка для мобильных */
    .sector-label:nth-child(1) {
        transform: translate(-50%, -50%) rotate(36deg) translateY(-65px) rotate(-36deg);
    }
    .sector-label:nth-child(2) {
        transform: translate(-50%, -50%) rotate(108deg) translateY(-65px) rotate(-108deg);
    }
    .sector-label:nth-child(3) {
        transform: translate(-50%, -50%) rotate(180deg) translateY(-65px) rotate(-180deg);
    }
    .sector-label:nth-child(4) {
        transform: translate(-50%, -50%) rotate(252deg) translateY(-65px) rotate(-252deg);
    }
    .sector-label:nth-child(5) {
        transform: translate(-50%, -50%) rotate(324deg) translateY(-65px) rotate(-324deg);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Promo Modal (Entry / Exit Intent) ===== */
#promo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 3100;
    justify-content: center;
    align-items: center;
}

#promo-modal {
    position: relative;
    background: linear-gradient(to bottom, #ffffff, #fff5e6);
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

#promo-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    line-height: 36px;
    cursor: pointer;
    color: #666;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

#promo-modal-close:hover {
    background: #FF4500;
    color: #fff;
}

#promo-modal-title {
    font-size: 22px;
    margin: 0 0 16px;
    color: #FF4500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#promo-modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto 16px;
    cursor: pointer;
}

#promo-modal-link {
    text-decoration: none;
}

.promo-modal-button {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #FF4500, #FF6347);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.35);
}

.promo-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 69, 0, 0.45);
}

/* Add-to-cart success animation */
.promo-modal-button.cart-added {
    background: linear-gradient(135deg, #28a745, #34c759);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
    pointer-events: none;
    animation: cartAddedPulse 0.5s ease;
}

@keyframes cartAddedPulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.12); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.promo-modal-button .cart-check-icon {
    display: inline-block;
    margin-right: 6px;
}

@media (max-width: 480px) {
    #promo-modal {
        padding: 18px 14px;
        max-width: 95%;
    }
    #promo-modal-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .promo-modal-button {
        padding: 10px 24px;
        font-size: 14px;
    }
}

