.product-details-loading {
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease-out;
}

.product-details-loading__content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.product-details-loading__spinner {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    position: relative;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 3px solid #e9ecef;
    border-top-color: #007bff;
    border-right-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.product-details-loading__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.product-details-loading__title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
}

.product-details-loading__subtitle {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

/* Success state */
.product-details-loading--success .product-details-loading__content {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.product-details-loading--success .spinner-ring {
    display: none;
}

.product-details-loading--success .product-details-loading__spinner::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #28a745;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    font-weight: bold;
    animation: scaleIn 0.3s ease-out;
}

.product-details-loading--success .product-details-loading__title {
    color: #155724;
}

.product-details-loading--success .product-details-loading__subtitle {
    color: #155724;
}

/* Error state */
.product-details-loading--error .product-details-loading__content {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.product-details-loading--error .spinner-ring {
    display: none;
}

.product-details-loading--error .product-details-loading__spinner::after {
    content: "✕";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #dc3545;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    font-weight: bold;
    animation: scaleIn 0.3s ease-out;
}

.product-details-loading--error .product-details-loading__title {
    color: #721c24;
}

.product-details-loading--error .product-details-loading__subtitle {
    color: #721c24;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 575px) {
    .product-details-loading__content {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .product-details-loading__spinner {
        width: 32px;
        height: 32px;
    }
    
    .product-details-loading__title {
        font-size: 14px;
    }
    
    .product-details-loading__subtitle {
        font-size: 13px;
    }
}

/* Skeleton loader styles */
.calculator__skeleton {
    padding: 20px 0;
    min-height: 200px; /* Match typical option rows height to prevent CLS */
}

/* Плавное появление контента после скелетона (не применять к самому скелетону) */
.product-options-new,
.option-axis--no-options:not(.calculator__skeleton .option-axis--no-options) {
    animation: fadeIn 0.2s ease-out;
}

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

.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-header,
.skeleton-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.skeleton-header .skeleton-cell {
    height: 36px;
    font-weight: 600;
}

.skeleton-row .skeleton-cell {
    height: 48px;
}

.skeleton-cell {
    flex: 1;
    background: #e9ecef;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background: #e9ecef;
}
.skeleton-shimmer::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: shimmer 1.5s ease-in-out infinite;
    will-change: transform;
    transform: translateX(-100%);
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-shimmer::after { animation: none; }
}

/* Responsive skeleton */
@media (max-width: 768px) {
    .calculator__skeleton {
        min-height: 220px;
    }

    /* Skeleton наследует grid-структуру от .option-axis--no-options .option-row в main.css */
    /* Переопределяем display: flex от .skeleton-row на grid */
    .calculator__skeleton .option-row.skeleton-row {
        display: grid;
        /* Grid-template наследуется от .option-axis--no-options .option-row */
    }

    .calculator__skeleton .skeleton-cell {
        height: 32px;
        border-radius: 4px;
    }

    /* Высота для stock row на мобильных */
    .calculator__skeleton .option-row__stock.skeleton-cell {
        height: 20px;
    }

    /* Скрываем ::before лейблы в skeleton ячейках */
    .calculator__skeleton .skeleton-cell::before {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .calculator__skeleton {
        padding: 12px 0;
        min-height: 200px;
    }

    .skeleton-table {
        gap: 8px;
    }
}

/* Packaging skeleton */
.skeleton-packaging {
    display: flex;
    flex-direction: column;
}

.skeleton-packaging .skeleton-row {
    background: #e9ecef;
    border-radius: 4px;
}

/* Empty state - more muted colors without shimmer animation */
.skeleton-packaging--empty .skeleton-row {
    background: #f0f2f4;
    opacity: 0.7;
}

/* Lots skeleton (price ranges placeholder) */
.lots-skeleton {
    display: contents;
}

.lot-skeleton {
    display: grid;
    gap: 1px;
    grid-template-columns: 1fr auto;
    padding: 6px;       /* Match real .lot padding for zero CLS */
    border-radius: 6px;
    background: #f8f9fa;
}

.lot-skeleton__label {
    height: 11px;
    width: 35px;
    background: #e9ecef;
    border-radius: 3px;
}

.lot-skeleton__price {
    height: 32px;
    width: 90px;
    background: #e9ecef;
    border-radius: 4px;
    margin-inline-start: 10px;
}

.lot-skeleton__size {
    height: 14px;
    width: 50px;
    background: #e9ecef;
    border-radius: 3px;
    margin-inline-start: 10px;
}

@media (max-width: 575px) {
    .lot-skeleton {
        padding: 6px;  /* Match real .lot padding */
    }

    .lot-skeleton__price {
        height: 26px;
        width: 70px;
    }

    .lot-skeleton__size {
        width: 40px;
    }
}

