/**
 * CardShop Shopify - ProductList Stepform Styles
 * Çok adımlı form (HealthMatch tarzı) stilleri
 */

/* Modal */
.cardshop-stepform-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cardshop-stepform-modal[aria-hidden="false"] {
    display: flex;
}

.cardshop-stepform-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.cardshop-stepform-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    font-family: var(--font-family, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    z-index: 1;
}

.cardshop-stepform-modal-inner {
    padding: 32px 40px 28px;
}

/* Başlık ve alt başlık */
.cardshop-stepform-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cardshop-stepform-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* İlerleme çubuğu */
.cardshop-stepform-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.cardshop-stepform-progress-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e5e5;
    transition: background 0.3s ease;
}

.cardshop-stepform-progress-segment.active {
    background: #07245e;
}

/* Adım içeriği */
.cardshop-stepform-step-wrap {
    min-height: 180px;
    margin-bottom: 24px;
}

.cardshop-stepform-step-content {
    outline: none;
}

.cardshop-stepform-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.cardshop-stepform-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Seçenek kutusu */
.cardshop-stepform-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.cardshop-stepform-option:hover {
    border-color: #b0b0b0;
}

.cardshop-stepform-option.selected {
    border-color: #07245e;
    background: rgba(7, 36, 94, 0.06);
    box-shadow: 0 0 0 1px #07245e;
}

.cardshop-stepform-option input {
    margin: 2px 0 0 0;
    accent-color: #07245e;
    cursor: pointer;
}

.cardshop-stepform-option-label {
    flex: 1;
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.4;
    cursor: pointer;
}

.cardshop-stepform-option-desc {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* Input */
.cardshop-stepform-input-wrap {
    margin-top: 8px;
}

.cardshop-stepform-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cardshop-stepform-input:focus {
    outline: none;
    border-color: #07245e;
    box-shadow: 0 0 0 3px rgba(7, 36, 94, 0.15);
}

.cardshop-stepform-input::placeholder {
    color: #999;
}

.cardshop-stepform-input-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

/* Validasyon */
.cardshop-stepform-step-wrap.validation-error .cardshop-stepform-options,
.cardshop-stepform-step-wrap.validation-error .cardshop-stepform-input-wrap {
    animation: cardshopFormRedGlow 0.6s ease;
}

.cardshop-stepform-step-wrap.validation-error .cardshop-stepform-option,
.cardshop-stepform-step-wrap.validation-error .cardshop-stepform-input {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.25);
}

.cardshop-stepform-step-wrap.validation-error.shake {
    animation: cardshopFormShake 0.5s ease;
}

@keyframes cardshopFormRedGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes cardshopFormShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Validasyon mesajı */
.cardshop-stepform-validation-message {
    min-height: 22px;
    font-size: 0.85rem;
    color: #d63638;
    margin-bottom: 12px;
    padding: 4px 0;
}

/* Butonlar */
.cardshop-stepform-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 8px;
}

.cardshop-stepform-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    font-family: inherit;
}

.cardshop-stepform-btn:active {
    transform: scale(0.98);
}

.cardshop-stepform-back {
    background: #f0f0f0;
    color: #333;
}

.cardshop-stepform-back:hover {
    background: #e5e5e5;
}

.cardshop-stepform-next {
    background: #07245e;
    color: #fff;
    margin-left: auto;
}

.cardshop-stepform-next:hover {
    background: #051a3d;
}

.cardshop-stepform-btn-arrow {
    font-size: 1.1em;
}

/* Modal kapatma butonu */
.cardshop-stepform-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    color: #666;
    font-size: 20px;
    line-height: 1;
}

.cardshop-stepform-modal-close:hover {
    color: #000;
}

/* Sonuç ekranı */
.cardshop-stepform-result-wrap {
    padding-top: 8px;
}

.cardshop-stepform-result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    text-align: center;
}

.cardshop-stepform-result-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

.cardshop-stepform-result-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.cardshop-stepform-result-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: #e5e5e5;
}

.cardshop-stepform-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cardshop-stepform-result-info {
    flex: 1;
    min-width: 0;
}

.cardshop-stepform-result-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cardshop-stepform-result-service {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.cardshop-stepform-result-price {
    font-size: 1rem;
    font-weight: 600;
    color: #07245e;
    margin: 0;
}

.cardshop-stepform-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cardshop-stepform-result-detail {
    background: #f0f0f0;
    color: #333;
}

.cardshop-stepform-result-detail:hover {
    background: #e5e5e5;
}

.cardshop-stepform-result-cart {
    background: #07245e;
    color: #fff;
}

.cardshop-stepform-result-cart:hover {
    background: #051a3d;
}

.cardshop-stepform-result-close {
    display: block;
    width: 100%;
    background: transparent;
    color: #666;
    border: 1px solid #e0e0e0;
}

.cardshop-stepform-result-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Loading indicator */
.cardshop-loading-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cardshopFormSpin 0.6s linear infinite;
}

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

/* Body lock */
body.cardshop-stepform-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .cardshop-stepform-modal-inner {
        padding: 24px 20px 20px;
    }
    
    .cardshop-stepform-title {
        font-size: 1.25rem;
    }
    
    .cardshop-stepform-subtitle {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }
    
    .cardshop-stepform-progress {
        margin-bottom: 20px;
    }
    
    .cardshop-stepform-step-wrap {
        min-height: 140px;
        margin-bottom: 20px;
    }
    
    .cardshop-stepform-option {
        padding: 12px 14px;
    }
    
    .cardshop-stepform-actions {
        flex-wrap: wrap;
    }
    
    .cardshop-stepform-next {
        width: 100%;
        justify-content: center;
    }
    
    .cardshop-stepform-back {
        width: 100%;
        justify-content: center;
    }
}
