/**
 * components/size-guide/size-guide.css
 * استایل صفحه راهنمای سایز عینک با ظاهر مدرن و پرمیوم
 */

.size-guide-container {
    padding: 40px 0 80px;
    background: #fafafa;
    min-height: 80vh;
}

.size-guide-article {
    background: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px dashed #eee;
    padding-bottom: 30px;
}

.article-title {
    font-size: 32px;
    color: #111;
    font-weight: 800;
    margin-bottom: 12px;
}

.article-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.article-section {
    margin-bottom: 45px;
}

.article-section h2 {
    font-size: 20px;
    color: #222;
    font-weight: 700;
    position: relative;
    padding-right: 15px;
    margin-bottom: 20px;
}

.article-section h2::before {
    content: "";
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background: #d4a300;
    border-radius: 2px;
}

.article-section p {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 16px;
}

/* کارت‌های ابعاد عینک */
.dimensions-explainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.dimension-box {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.dimension-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(212, 163, 0, 0.1);
    border-color: #d4a300;
}

.dim-num {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: rgba(212, 163, 0, 0.1);
    color: #d4a300;
    font-size: 24px;
    font-weight: 900;
    border-radius: 50%;
    margin-bottom: 15px;
}

.dim-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

.dim-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* جدول سایزها */
.table-responsive {
    overflow-x: auto;
    margin: 25px 0;
    border-radius: 12px;
    border: 1px solid #eee;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 14px;
}

.size-table th,
.size-table td {
    padding: 15px 20px;
}

.size-table th {
    background: #f5f5f5;
    color: #333;
    font-weight: 700;
    border-bottom: 2px solid #eee;
}

.size-table td {
    border-bottom: 1px solid #eee;
    color: #555;
}

.size-table tr:last-child td {
    border-bottom: none;
}

.size-table tr:hover td {
    background: #fdfbf7;
}

/* کادر مراحل روش‌های اندازه‌گیری */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.step-card {
    background: #fff;
    border-right: 4px solid #d4a300;
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 22px 25px;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.02);
}

.step-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #222;
    font-weight: 700;
}

.step-card p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

/* دکمه پایین */
.btn-shop-now {
    display: inline-block;
    background: linear-gradient(135deg, #e6b000 0%, #b88a00 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none !important;
    box-shadow: 0 5px 20px rgba(212, 163, 0, 0.3);
    transition: all 0.3s ease;
}

.btn-shop-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 163, 0, 0.45);
}

.text-center {
    text-align: center;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .size-guide-article {
        padding: 30px 20px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .dimensions-explainer {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dimension-box {
        padding: 20px 15px;
    }
}

/* استایل‌های اختصاصی محتوای زنده */
.method-box {
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.method-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.img-wrapper {
    text-align: center;
    margin: 20px 0;
    background: #fafafa;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #f3f3f3;
    display: inline-block;
    max-width: 100%;
}

.guide-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.size-parts-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.size-parts-list li {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
    text-align: center;
}

.inline-img-wrapper {
    background: #fafafa;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.inline-guide-img {
    height: 60px;
    width: auto;
    display: block;
    object-fit: contain;
}

.formula-box {
    background: #111;
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0;
    direction: ltr;
    letter-spacing: 1px;
}

.formula-box code {
    font-family: monospace;
    color: #d4a300;
}

.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

/* ══════════════════════════════════════════════════════════════════
   استایل‌های اختصاصی اسکنر هوشمند عرض صورت و نتایج فریم‌های متناسب
   ══════════════════════════════════════════════════════════════════ */

.sg-hidden {
    display: none !important;
}

.header-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(212, 163, 0, 0.15) 0%, rgba(212, 163, 0, 0.05) 100%);
    border: 1px solid rgba(212, 163, 0, 0.35);
    color: #b38600;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 15px;
}

.smart-size-scanner-card {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-radius: 20px;
    padding: 30px;
    color: #ffffff;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.smart-size-scanner-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 163, 0, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.scanner-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pulse-icon {
    width: 48px;
    height: 48px;
    background: rgba(212, 163, 0, 0.2);
    color: #d4a300;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(212, 163, 0, 0.4);
    animation: sgPulse 2s infinite;
}

@keyframes sgPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 163, 0, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(212, 163, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 163, 0, 0); }
}

.scanner-title-group h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 800;
}

.scanner-title-group p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
}

/* تب‌های ۳ گانه اصلی */
.sg-main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-main-tab {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    font-family: inherit;
}

.sg-main-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sg-main-tab.active {
    background: #d4a300;
    color: #111827;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(212, 163, 0, 0.3);
}

.sg-main-tab.is-locked {
    opacity: 0.85;
    position: relative;
}

.sg-badge-soon {
    background: rgba(212, 163, 0, 0.2);
    color: #fde047;
    border: 1px solid rgba(212, 163, 0, 0.4);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 4px;
}

.sg-main-tab.active .sg-badge-soon {
    background: #111827;
    color: #fde047;
    border-color: #111827;
}

/* کارت ویژگی قفل شده / به‌زودی */
.sg-locked-feature-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border: 1px solid rgba(212, 163, 0, 0.3);
    border-radius: 20px;
    padding: 48px 24px;
    text-align: center;
    max-width: 580px;
    margin: 30px auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.sg-locked-feature-card .locked-icon-wrap {
    width: 72px;
    height: 72px;
    background: rgba(212, 163, 0, 0.12);
    border: 2px solid rgba(212, 163, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #d4a300;
}

.sg-locked-feature-card h4 {
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 12px;
}

.sg-locked-feature-card p {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 22px;
}

.locked-soon-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 163, 0, 0.15);
    color: #fbbf24;
    border: 1px solid #d4a300;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 25px;
}

.locked-action-suggest {
    display: flex;
    justify-content: center;
}

/* پنل‌های متد */
.sg-method-panel {
    display: none;
    animation: sgPanelFade 0.3s ease-out;
}

.sg-method-panel.active {
    display: block;
}

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

.method-intro-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.intro-icon {
    font-size: 24px;
    color: #d4a300;
    margin-top: 2px;
}

.intro-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #fff;
    font-weight: 700;
}

.intro-text p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.6;
}

/* بیضی راهنمای فیت شدن سر (Face Oval Guide) */
.face-oval-silhouette {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 300px;
    border: 2.5px dashed rgba(212, 163, 0, 0.6);
    border-radius: 50% / 45%;
    pointer-events: none;
    z-index: 5;
    transition: all 0.3s ease;
}

.face-oval-silhouette.locked {
    border-style: solid;
    border-color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4), inset 0 0 20px rgba(16, 185, 129, 0.2);
}

.oval-target-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50% / 45%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.oval-eyes-line {
    position: absolute;
    top: 45%;
    left: 15%;
    right: 15%;
    height: 1px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}

/* پیام راهنمای فاصله زنده */
.distance-guide-prompt {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    z-index: 10;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.prompt-info {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #e2e8f0;
}

.prompt-warn {
    background: rgba(120, 53, 15, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #fef08a;
    animation: sgBlink 1.5s infinite;
}

.prompt-success {
    background: rgba(6, 78, 59, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #a7f3d0;
}

@keyframes sgBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* راهنمای کارت */
.card-hold-overlay {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    pointer-events: none;
}

.card-target-box {
    width: 140px;
    height: 88px;
    border: 2px dashed #3b82f6;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 6px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: sgCardPulse 2s infinite;
}

@keyframes sgCardPulse {
    0%, 100% { border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
    50% { border-color: #60a5fa; box-shadow: 0 0 25px rgba(96, 165, 250, 0.7); }
}

.card-target-box i {
    font-size: 20px;
    color: #93c5fd;
}

.card-snapshot-toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* ══════════════════════════════════════════════════════════════════
   میز کار تعاملی خط‌کش نوری روی عکس (Interactive Caliper Workbench)
   ══════════════════════════════════════════════════════════════════ */

.sg-caliper-workbench {
    background: #0f172a;
    border: 1px solid rgba(212, 163, 0, 0.4);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: sgFadeIn 0.4s ease-out;
}

.workbench-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.workbench-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workbench-title i {
    font-size: 24px;
}

.text-gold {
    color: #d4a300;
}

.workbench-title h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #fff;
    font-weight: 800;
}

.workbench-title p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

.workbench-title strong {
    color: #e2e8f0;
}

.workbench-live-calc {
    background: rgba(212, 163, 0, 0.15);
    border: 1px solid rgba(212, 163, 0, 0.4);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 14px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workbench-live-calc strong {
    color: #d4a300;
    font-size: 22px;
    font-weight: 900;
}

.depth-compensation-bar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}

.depth-switch-lbl {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e2e8f0;
    font-weight: 700;
}

.depth-switch-lbl input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4a300;
    cursor: pointer;
}

.text-gold-light {
    color: #d4a300;
    font-size: 12px;
    font-weight: 600;
}

.caliper-stage-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    touch-action: none;
    cursor: crosshair;
}

#caliperInteractiveCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

.workbench-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.sg-btn-snapshot {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    font-family: inherit;
    transition: transform 0.2s;
}

.sg-btn-snapshot:hover {
    transform: scale(1.04);
}

/* ماشین حساب عینک */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 20px;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.calc-input-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-lbl {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-lbl i {
    color: #d4a300;
}

.calc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.calc-input {
    width: 100%;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    color: #fff;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
}

.calc-input:focus {
    outline: none;
    border-color: #d4a300;
    box-shadow: 0 0 0 3px rgba(212, 163, 0, 0.2);
}

.unit-tag {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 12px;
}

.calc-input-card small {
    color: #9ca3af;
    font-size: 11px;
}

.calc-result-card {
    background: linear-gradient(135deg, rgba(212, 163, 0, 0.15) 0%, rgba(212, 163, 0, 0.05) 100%);
    border: 1px solid rgba(212, 163, 0, 0.35);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.calc-res-header {
    font-size: 13px;
    color: #d4a300;
    font-weight: 700;
}

.calc-res-num strong {
    font-size: 34px;
    color: #fff;
    font-weight: 900;
}

.calc-res-num small {
    color: #d4a300;
    font-size: 13px;
}

.sg-btn-calc-submit {
    background: linear-gradient(135deg, #d4a300 0%, #f59e0b 100%);
    color: #111;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: transform 0.2s;
}

.sg-btn-calc-submit:hover {
    transform: translateY(-2px);
}

.formula-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #9ca3af;
}

.formula-banner code {
    color: #d4a300;
    font-family: monospace;
    font-weight: bold;
    direction: ltr;
    display: inline-block;
}
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sg-mode-tab:hover {
    color: #fff;
}

.sg-mode-tab.active {
    background: #d4a300;
    color: #111;
    font-weight: 700;
}

/* اعلان ذخیره‌شده قبلی */
.sg-saved-notice {
    margin-bottom: 20px;
}

.sg-saved-alert {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: #93c5fd;
    font-size: 13px;
}

.sg-saved-alert strong {
    color: #fff;
    font-size: 15px;
}

.sg-btn-load-prev {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.sg-btn-load-prev:hover {
    background: #2563eb;
}

/* دکمه‌های اکشن */
.scanner-actions-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sg-btn-primary {
    background: linear-gradient(135deg, #d4a300 0%, #f59e0b 100%);
    color: #111;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(212, 163, 0, 0.3);
    transition: all 0.3s ease;
    font-family: inherit;
}

.sg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 163, 0, 0.45);
}

.sg-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* نمایش زنده وب‌کم */
.sg-scanner-viewport {
    margin-top: 25px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(212, 163, 0, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.viewport-video-box {
    position: relative;
    width: 100%;
    max-height: 480px;
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.viewport-video-box video {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    transform: scaleX(-1); /* حالت آینه‌ای */
    display: block;
}

.viewport-video-box canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
}

.sg-laser-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #d4a300 50%, transparent 100%);
    box-shadow: 0 0 12px #d4a300;
    animation: sgLaserMove 2.5s infinite ease-in-out;
    pointer-events: none;
}

@keyframes sgLaserMove {
    0% { top: 15%; opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { top: 85%; opacity: 0; }
}

.sg-card-guide {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}

.card-box-outline {
    width: 220px;
    height: 138px;
    border: 2px dashed #3b82f6;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.live-status-floating-group {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 10;
    pointer-events: none;
}

.live-distance-badge {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.5);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
}

.live-distance-badge i {
    color: #60a5fa;
}

.live-distance-badge strong {
    color: #93c5fd;
    font-size: 15px;
}

.live-distance-badge small {
    color: #94a3b8;
    font-size: 11px;
}

.live-width-badge {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 163, 0, 0.5);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e7eb;
}

.live-width-badge strong {
    color: #d4a300;
    font-size: 16px;
}

/* کنترل‌ها و نوار وضعیت */
.viewport-controls {
    background: #111827;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sg-progress-wrapper {
    flex: 1;
    min-width: 200px;
}

.sg-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.sg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4a300 0%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.15s ease;
}

.sg-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
}

.sg-progress-info strong {
    color: #d4a300;
}

.sg-btn-stop {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: background 0.2s;
}

.sg-btn-stop:hover {
    background: #b91c1c;
}

/* ══════════════════════════════════════════════════════════════════
   بخش نتایج اسکن و نمایش عینک‌های هم‌عرض
   ══════════════════════════════════════════════════════════════════ */

.sg-results-panel {
    margin-bottom: 45px;
    animation: sgFadeIn 0.5s ease-out;
}

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

.sg-results-card {
    background: #ffffff;
    border: 2px solid #d4a300;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(212, 163, 0, 0.08);
}

.sg-results-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
    .sg-results-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.result-highlight-box {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fef08a;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
}

.res-lbl {
    font-size: 13px;
    color: #713f12;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.res-number-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.res-number-group strong {
    font-size: 38px;
    font-weight: 900;
    color: #854d0e;
    line-height: 1;
}

.sg-size-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
}

.badge-s { background: #dbeafe; color: #1e40af; }
.badge-m { background: #dcfce7; color: #166534; }
.badge-l { background: #fef3c7; color: #92400e; }
.badge-xl { background: #fee2e2; color: #991b1b; }

.result-desc-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.res-desc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111;
    font-size: 17px;
}

.text-success {
    color: #10b981;
}

.result-desc-box p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
}

.sg-btn-rescan {
    align-self: flex-start;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.sg-btn-rescan:hover {
    background: #e5e7eb;
    color: #111;
}

/* نوار ابزار فیلتر محصولات */
.sg-filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0 20px;
}

.sg-filter-tabs {
    display: flex;
    gap: 8px;
}

.sg-filter-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.sg-filter-btn.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.sg-count-badge {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* گرید محصولات پیشنهادی */
.sg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.sg-product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    border-color: #d4a300;
}

.sg-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sg-card-img-wrap {
    display: block;
    background: #f8fafc;
    padding: 20px;
    text-align: center;
    position: relative;
    aspect-ratio: 16/10;
}

.sg-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sg-product-card:hover .sg-card-img {
    transform: scale(1.04);
}

.sg-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sg-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.sg-brand {
    color: #64748b;
    font-weight: 700;
}

.sg-shape-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.sg-card-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.sg-card-title a {
    color: #1e293b;
    text-decoration: none;
}

.sg-card-title a:hover {
    color: #d4a300;
}

.sg-specs-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 12px;
    text-align: center;
    gap: 5px;
    font-size: 11px;
}

.sg-spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sg-spec-lbl {
    color: #94a3b8;
}

.sg-spec-val {
    color: #334155;
    font-weight: 700;
}

.sg-spec-val.highlight {
    color: #0f766e;
}

.sg-card-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 14px;
}

.sg-price {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.sg-orig-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}

.sg-card-actions {
    display: flex;
    width: 100%;
    margin-top: 6px;
}

.sg-btn-view {
    width: 100%;
    background: #111827;
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.sg-btn-view:hover {
    background: #1f2937;
    transform: translateY(-2px);
    color: #ffffff;
}

.sg-btn-tryon {
    background: linear-gradient(135deg, #d4a300 0%, #f59e0b 100%);
    color: #111827;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.sg-btn-tryon:hover {
    filter: brightness(1.08);
}

/* وضعیت‌های بارگذاری و خالی */
.sg-loading-box, .sg-empty-box, .sg-error-box {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sg-loading-box i {
    font-size: 24px;
    color: #d4a300;
}

.sg-empty-box i {
    font-size: 36px;
    color: #94a3b8;
}

/* ══════════════════════════════════════════════════════════════════
   مودال راهنمای تصویری پیش از اسکن (Pre-Scan Visual Guide Modal)
   ══════════════════════════════════════════════════════════════════ */

.sg-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: sgModalFade 0.3s ease-out;
}

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

.sg-modal-dialog {
    background: #0f172a;
    border: 1px solid rgba(212, 163, 0, 0.4);
    border-radius: 20px;
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 28px;
    position: relative;
    animation: sgModalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sgModalSlide {
    from { transform: translateY(30px) scale(0.96); }
    to { transform: translateY(0) scale(1); }
}

.sg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.sg-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sg-modal-title i {
    font-size: 24px;
}

.sg-modal-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.sg-modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.sg-modal-close-btn:hover {
    color: #fff;
}

.sg-modal-desc {
    color: #cbd5e1;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* شبکه ۴ کارت راهنما */
.prep-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

@media (max-width: 992px) {
    .prep-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .prep-cards-grid {
        grid-template-columns: 1fr;
    }
}

.prep-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    color: #1e293b;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid #e2e8f0;
}

.prep-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.prep-card-img-wrap {
    background: #ffffff;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f5f9;
    overflow: hidden;
}

.prep-card-photo {
    width: 100%;
    height: 175px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.prep-card:hover .prep-card-photo {
    transform: scale(1.04);
}

.prep-card-text {
    padding: 16px;
    position: relative;
    flex: 1;
}

.prep-step-num {
    position: absolute;
    top: -14px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: #d4a300;
    color: #111827;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(212, 163, 0, 0.4);
}

.prep-card-text h5 {
    margin: 4px 0 6px 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.prep-card-text p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.55;
}

.sg-modal-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}


