/* ============================================
   Skin Quiz Sidebar – Davis & Co Theme
   Floating right-side panel with step-by-step quiz
   ============================================ */

/* ── Floating Toggle Button (Professional FAB) ── */
.skin-quiz-toggle {
    position: fixed;
    right: 24px;
    bottom: 32px;
    top: auto;
    transform: none;
    z-index: 10000;
    background: linear-gradient(135deg, #0b0c0d 0%, #2e3338 100%);
    color: #fff;
    border: none;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(43,48,41,0.35), 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.skin-quiz-toggle:hover {
    transform: none;
    box-shadow: 0 12px 28px rgba(43,48,41,0.4), 0 4px 10px rgba(0,0,0,0.2);
}

.skin-quiz-toggle-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(43,48,41,0.35);
    animation: skinQuizPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.skin-quiz-toggle-icon {
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-quiz-toggle-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #0b0c0d;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.skin-quiz-toggle-label::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #0b0c0d;
}

.skin-quiz-toggle:hover .skin-quiz-toggle-label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

@keyframes skinQuizPulse {
    0% { box-shadow: 0 0 0 0 rgba(43,48,41,0.35); opacity: 1; }
    70% { box-shadow: 0 0 0 14px rgba(43,48,41,0); opacity: 0; }
    100% { opacity: 0; }
}

.skin-quiz-toggle.quiz-done {
    background: linear-gradient(135deg, #0f766e 0%, #0f766e 100%);
}

.skin-quiz-toggle.quiz-done .skin-quiz-toggle-ring {
    border-color: rgba(26,107,60,0.4);
}

/* ── Overlay ── */
.skin-quiz-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.skin-quiz-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Sidebar Panel ── */
.skin-quiz-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 92vw;
    height: 100vh;
    background: #fff;
    z-index: 10002;
    box-shadow: -6px 0 30px rgba(0,0,0,0.18);
    transition: right 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.skin-quiz-sidebar.open {
    right: 0;
}

/* ── Header ── */
.skin-quiz-header {
    background: linear-gradient(135deg, #0b0c0d 0%, #2e3338 100%);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.skin-quiz-header-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
}

.skin-quiz-header-text p {
    font-size: 0.78rem;
    opacity: 0.8;
    margin: 0;
    line-height: 1.4;
}

.skin-quiz-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.skin-quiz-close:hover {
    background: rgba(255,255,255,0.25);
}

/* ── Progress Bar ── */
.skin-quiz-progress {
    padding: 0 24px;
    padding-top: 16px;
    flex-shrink: 0;
}

.skin-quiz-progress-bar {
    height: 4px;
    background: #e5e7e9;
    border-radius: 4px;
    overflow: hidden;
}

.skin-quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0b0c0d, #2e3338);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.skin-quiz-step-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #8b9197;
    margin-top: 6px;
    font-weight: 500;
}

/* ── Body (scrollable) ── */
.skin-quiz-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* ── Question Slide ── */
.skin-quiz-question {
    display: none;
    animation: quizFadeIn 0.35s ease forwards;
}

.skin-quiz-question.active {
    display: block;
}

@keyframes quizFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.skin-quiz-question h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b0c0d;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ── Option Cards ── */
.skin-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skin-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e5e7e9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f6f7f8;
    position: relative;
}

.skin-quiz-option:hover {
    border-color: #2e3338;
    background: #f6f7f8;
    transform: translateX(4px);
}

.skin-quiz-option.selected {
    border-color: #0b0c0d;
    background: #e5e7e9;
    box-shadow: 0 2px 12px rgba(43,48,41,0.12);
}

.skin-quiz-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7e9;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.skin-quiz-option.selected .skin-quiz-option-radio {
    border-color: #0b0c0d;
    background: #0b0c0d;
}

.skin-quiz-option.selected .skin-quiz-option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.skin-quiz-option-text {
    font-size: 0.88rem;
    color: #2e3338;
    font-weight: 500;
    line-height: 1.3;
}

.skin-quiz-option.selected .skin-quiz-option-text {
    color: #0b0c0d;
    font-weight: 600;
}

/* ── Footer Actions ── */
.skin-quiz-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #f6f7f8;
}

.skin-quiz-btn {
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.skin-quiz-btn-back {
    background: transparent;
    color: #5b6168;
    padding: 10px 16px;
}

.skin-quiz-btn-back:hover {
    color: #0b0c0d;
}

.skin-quiz-btn-next {
    background: linear-gradient(135deg, #0b0c0d 0%, #2e3338 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(43,48,41,0.2);
}

.skin-quiz-btn-next:hover {
    transform: none;
    box-shadow: 0 5px 18px rgba(43,48,41,0.3);
}

.skin-quiz-btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.skin-quiz-btn-skip {
    background: transparent;
    color: #8b9197;
    font-size: 0.78rem;
    text-decoration: underline;
    padding: 6px 10px;
}

.skin-quiz-btn-skip:hover {
    color: #5b6168;
}

/* ── Results View ── */
.skin-quiz-results {
    display: none;
}

.skin-quiz-results.active {
    display: block;
    animation: quizFadeIn 0.4s ease forwards;
}

.skin-quiz-results-header {
    text-align: center;
    margin-bottom: 24px;
}

.skin-quiz-results-header .quiz-success-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0f766e 0%, #0f766e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #fff;
    font-size: 1.4rem;
}

.skin-quiz-results-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b0c0d;
    margin: 0 0 6px;
}

.skin-quiz-results-header p {
    font-size: 0.8rem;
    color: #5b6168;
    margin: 0;
}

/* ── Product Cards in Results ── */
.skin-quiz-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skin-quiz-product-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7e9;
    border-radius: 12px;
    background: #f6f7f8;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.skin-quiz-product-card:hover {
    border-color: #e5e7e9;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    transform: none;
}

.skin-quiz-product-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7e9;
}

.skin-quiz-product-info {
    flex: 1;
    min-width: 0;
}

.skin-quiz-product-info h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0b0c0d;
    margin: 0 0 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skin-quiz-product-info .quiz-product-category {
    font-size: 0.72rem;
    color: #8b9197;
    margin: 0 0 6px;
}

.skin-quiz-product-info .quiz-product-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0b0c0d;
}

.skin-quiz-product-info .quiz-product-discount {
    font-size: 0.72rem;
    color: #0b0c0d;
    font-weight: 600;
    margin-left: 6px;
}

.skin-quiz-product-match {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: #0f766e;
    background: #e8f5f3;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 600;
    margin-left: 8px;
}

/* ── Loading State ── */
.skin-quiz-loading {
    text-align: center;
    padding: 40px 20px;
}

.skin-quiz-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7e9;
    border-top-color: #0b0c0d;
    border-radius: 50%;
    animation: quizSpin 0.7s linear infinite;
    margin: 0 auto 14px;
}

@keyframes quizSpin {
    to { transform: rotate(360deg); }
}

.skin-quiz-loading p {
    font-size: 0.85rem;
    color: #8b9197;
}

/* ── Retake Button ── */
.skin-quiz-retake {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 18px;
    padding: 10px;
    border: 2px solid #e5e7e9;
    border-radius: 50px;
    background: transparent;
    color: #5b6168;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.skin-quiz-retake:hover {
    border-color: #0b0c0d;
    color: #0b0c0d;
}

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
    .skin-quiz-sidebar {
        width: 100vw;
        right: -100vw;
    }

    .skin-quiz-toggle {
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 20px;
    }

    .skin-quiz-toggle-icon {
        font-size: 1.15rem;
    }

    .skin-quiz-toggle-label {
        display: none;
    }
}
