/* ============================================================
   SMT Store - Frontend styles
   Variations popup, Attribute display, Promotional popup
============================================================ */

/* ============================================================
   ARCHIVE ATTRIBUTE DISPLAY
============================================================ */

.smt-archive-attribute {
    font-size: 13px;
    color: #555;
    margin: 4px 0 6px;
    line-height: 1.4;
}

.smt-archive-attribute-label {
    font-weight: 600;
    color: #333;
}

.smt-archive-attribute-value {
    color: #666;
}

.smt-archive-attribute-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    vertical-align: middle;
}

.smt-archive-attribute-chip {
    display: inline-block;
    font-size: 12px;
    line-height: 1.4;
    padding: 2px 9px;
    background: #f2f2f7;
    border: 1px solid #e2e2ea;
    border-radius: 10px;
    color: #444;
    white-space: nowrap;
}

.smt-badges,
.smt-archive-attribute-chips {
    position: relative;
}

.smt-compact-hidden {
    display: none;
}

.smt-compact-tooltip {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 6px);
    left: 0;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    width: max-content;
    max-width: min(280px, 82vw);
    padding: 6px;
    border-radius: 10px;
    background: rgba(20, 20, 24, 0.94);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.smt-compact-tooltip span {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
}

.smt-badges:hover .smt-compact-tooltip,
.smt-archive-attribute-chips:hover .smt-compact-tooltip {
    display: flex;
}

/* ============================================================
   VARIATIONS MODAL
============================================================ */

body.smt-var-locked {
    overflow: hidden;
}

.smt-var-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

.smt-var-modal.smt-var-open {
    display: flex;
    animation: smtVarFadeIn .2s ease;
}

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

.smt-var-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(4px);
}

.smt-var-wrap {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    width: 92vw;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    animation: smtVarSlideUp .25s ease;
}

@keyframes smtVarSlideUp {
    from { transform: translateY(20px) scale(.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.smt-var-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background .15s, color .15s;
}

.smt-var-close:hover { background: rgba(0,0,0,.12); color: #111; }

/* Loading */
.smt-var-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    flex: 1;
}

.smt-var-spinner {
    display: block;
    width: 38px;
    height: 38px;
    border: 3px solid #e5e7eb;
    border-top-color: #4e8cff;
    border-radius: 50%;
    animation: smtVarSpin .7s linear infinite;
}

@keyframes smtVarSpin { to { transform: rotate(360deg); } }

/* Body - two columns */
.smt-var-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow-y: auto;
    max-height: 90vh;
}

/* Gallery */
.smt-var-gallery {
    padding: 24px 16px 24px 24px;
    background: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #f0f1f4;
}

.smt-var-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    transition: opacity .2s;
}

/* Info */
.smt-var-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 24px 24px 16px;
    overflow-y: auto;
}

.smt-var-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.smt-var-price {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}

.smt-var-price ins { text-decoration: none; color: #dc2626; }
.smt-var-price del { font-size: 13px; color: #9ca3af; font-weight: 400; }

/* Attribute selects */
.smt-var-attr-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.smt-var-attr-row label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.smt-var-attr-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
    appearance: auto;
}

.smt-var-attr-select:focus {
    outline: none;
    border-color: #4e8cff;
    box-shadow: 0 0 0 3px rgba(78,140,255,.15);
    background: #fff;
}

/* Unavailable notice */
.smt-var-unavailable {
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

/* ATC button */
.smt-var-atc {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.smt-var-atc:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Status notice */
.smt-var-notice {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
}

.smt-var-notice-success {
    background: #ecfdf5;
    color: #065f46;
}

.smt-var-notice-error {
    background: #fef2f2;
    color: #991b1b;
}

/* Mobile */
@media (max-width: 600px) {
    .smt-var-wrap {
        width: 100vw;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }
    .smt-var-modal { align-items: flex-end; }
    .smt-var-body { grid-template-columns: 1fr; }
    .smt-var-gallery {
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid #f0f1f4;
    }
    .smt-var-info { padding: 16px; }
    .smt-var-image { max-height: 200px; }
}

/* ============================================================
   PROMOTIONAL POPUP
============================================================ */

.smt-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,15,20,.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .3s ease;
    padding: 16px;
}

.smt-popup-overlay[hidden] {
    display: none !important;
}

.smt-popup-overlay.smt-popup-visible {
    opacity: 1;
}

.smt-popup-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 36px 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    transform: translateY(20px) scale(.97);
    transition: transform .3s ease, opacity .3s ease;
    opacity: 0;
}

.smt-popup-visible .smt-popup-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.smt-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background .15s, color .15s;
}

.smt-popup-close:hover { background: rgba(0,0,0,.12); color: #111; }

.smt-popup-content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 24px;
}

.smt-popup-content p { margin: 0 0 12px; }
.smt-popup-content p:last-child { margin-bottom: 0; }
.smt-popup-content h2,
.smt-popup-content h3 { margin: 0 0 12px; color: #111827; }

.smt-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.smt-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s, color .15s, box-shadow .15s;
    line-height: 1.3;
}

.smt-popup-btn-primary {
    background: #111827;
    color: #fff !important;
}

.smt-popup-btn-primary:hover {
    background: #1f2937;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

.smt-popup-btn-secondary {
    background: transparent;
    color: #6b7280 !important;
    padding-left: 8px;
    padding-right: 8px;
    font-weight: 400;
    font-size: 13px;
}

.smt-popup-btn-secondary:hover {
    color: #374151 !important;
}

@media (max-width: 480px) {
    .smt-popup-box { padding: 28px 20px 22px; }
    .smt-popup-actions { flex-direction: column; align-items: stretch; }
    .smt-popup-btn { width: 100%; text-align: center; justify-content: center; }
}
