.res-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: resFadeIn 0.3s ease;
}

@keyframes resFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.res-popup {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: resSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes resSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.res-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    z-index: 10;
    line-height: 1;
    padding: 0 5px;
}

.res-popup-close:hover {
    color: #333;
}

.res-popup-inner {
    display: flex;
    flex-direction: row;
}

.res-popup-image {
    flex: 0 0 280px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.res-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.res-popup-content {
    flex: 1;
    padding: 30px;
    min-width: 0;
}

.res-popup-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #222;
    line-height: 1.3;
}

.res-popup-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Countdown Timer */
.res-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 10px 0 14px;
    padding: 10px;
    background: #fff0f0;
    border-radius: 8px;
    border: 1px solid #ffc0c0;
}

.res-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
}

.res-countdown-num {
    font-size: 22px;
    font-weight: 800;
    color: #dc2626;
    font-variant-numeric: tabular-nums;
    animation: resPulse 1s ease-in-out infinite;
}

.res-countdown-label {
    font-size: 9px;
    font-weight: 600;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.res-countdown-sep {
    font-size: 20px;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 14px;
    animation: resPulse 1s ease-in-out infinite;
}

@keyframes resPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.res-popup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.res-popup-form input,
.res-popup-form select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
    width: 100%;
}

.res-popup-form input:focus,
.res-popup-form select:focus {
    border-color: #fab505;
    background: #fff;
}

/* Color picker multi-select */
.res-color-picker {
    position: relative;
}

.res-color-btn {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
    background: #fafafa;
    cursor: pointer;
    color: #333;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.res-color-btn:hover,
.res-color-btn:focus {
    border-color: #fab505;
}

/* Color picker popup - small rectangle */
.res-color-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.res-color-popup {
    background: #fff;
    border-radius: 8px;
    max-width: 320px;
    width: 100%;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.res-color-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid #eee;
}

.res-color-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
}

.res-color-popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0 4px;
}

.res-color-popup-close:hover {
    color: #333;
}

.res-color-popup-body {
    overflow-y: auto;
    padding: 4px 0;
    flex: 1;
}

.res-color-popup-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.res-color-popup-option:hover {
    background: #f5f5f5;
}

.res-color-popup-option input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #fab505;
}

.res-color-popup-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.res-color-popup-count {
    font-size: 11px;
    color: #888;
}

.res-color-popup-done {
    width: 100%;
    padding: 10px;
    background: #fab505;
    color: #000;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0 0 8px 8px;
}

.res-color-popup-done:hover {
    background: #e0a004;
}

.res-color-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.res-color-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fab505;
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.res-color-tag-remove {
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
}

.res-qty-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.res-qty-row input {
    flex: 1;
}

.res-random-btn {
    padding: 10px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.res-random-btn:hover {
    background: #555;
}

.res-popup-btn {
    width: 100%;
    padding: 12px;
    background: #fab505;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
    margin-top: 4px;
}

.res-popup-btn:hover {
    background: #e0a004;
}

.res-popup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.res-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    margin-top: 12px;
    user-select: none;
}

.res-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.res-success {
    text-align: center;
    padding: 20px 0;
}

.res-success h3 {
    font-size: 20px;
    color: #2e7d32;
    margin: 0 0 10px;
}

.res-success p {
    font-size: 14px;
    color: #555;
    margin: 0 0 20px;
}

@media (max-width: 600px) {
    .res-popup-inner {
        flex-direction: column;
    }
    .res-popup {
        height: 95vh;
        display: flex;
        flex-direction: column;
    }
    .res-popup-image {
        flex: 0 0 120px;
    }
    .res-popup-content {
        padding: 12px 16px 16px;
        overflow-y: auto;
        flex: 1;
    }
    .res-color-popup {
        max-height: 50vh;
        max-width: 90%;
    }
    .res-color-btn {
        font-size: 14px;
    }
}
