/**
 * Stock Image Single Page Styles
 * Página de detalle y compra de imagen stock
 */

.stock-image-single {
    padding: 60px 0;
    background: #f8f9fa;
}

/* Preview de imagen */
.stock-image-preview {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.stock-image-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.watermark-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #856404;
}

.watermark-notice svg {
    flex-shrink: 0;
}

/* Thumbnails */
.image-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    overflow-x: auto;
    padding: 8px 0;
}

.thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.thumb-item:hover {
    border-color: #7db600;
}

.thumb-item.active {
    border-color: #7db600;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.thumb-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.thumb-item span {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* Detalles de imagen */
.image-details-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-details-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.details-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.details-list li:last-child {
    border-bottom: none;
}

.details-list strong {
    color: #666;
    font-weight: 500;
}

/* Keywords */
.image-keywords {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.keyword-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #e9ecef;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #495057;
}

/* Box de compra */
.stock-purchase-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
}

.stock-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
}

.stock-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Categorías */
.stock-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.3s;
}

.category-badge:hover {
    background: #bbdefb;
    color: #1565c0;
}

/* Selector de calidad */
.quality-selector {
    margin-top: 24px;
}

.quality-selector h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.radio-price {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quality-option:hover {
    border-color: #7db600;
    background: #f8f9fa;
}

.quality-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.quality-option input[type="radio"]:checked~.quality-info {
    color: #7db600;
}

.quality-option:has(input:checked) {
    border-color: #7db600;
    background: #f0f7ff;
}

.quality-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-name {
    display: flex;
    flex-direction: column;
}

.quality-name strong {
    font-size: 1rem;
    margin-bottom: 4px;
}

.quality-dimensions {
    font-size: 0.85rem;
    color: #6c757d;
}

.quality-price {
    text-align: right;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #7db600;
}

.price-original {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.price-sale {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc3545;
}

/* Acciones de compra */
.purchase-actions {
    margin-top: 24px;
}

.btn-add-to-cart {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-add-to-cart.loading svg {
    animation: spin 1s linear infinite;
}

.btn-add-to-cart svg {
    width: 20px;
    height: 20px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#purchase-message {
    margin-top: 16px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Información de licencia */
.license-info {
    margin-top: 32px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.license-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.license-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.license-info li {
    padding: 6px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .stock-purchase-box {
        position: static;
        margin-top: 30px;
    }

    .stock-title {
        font-size: 1.5rem;
    }

    .quality-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .quality-price {
        text-align: left;
    }

    .image-thumbnails {
        justify-content: center;
    }
}

/* Barra de búsqueda sticky en search page */
.search-bar-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px 0;
    margin-bottom: 30px;
}

.search-form-inline {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 8px 8px 8px 20px;
    gap: 12px;
}

.search-input-wrapper .search-icon {
    color: #999;
    flex-shrink: 0;
}

.search-input-wrapper .search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    padding: 8px;
}

.search-input-wrapper .search-submit {
    background: #7db600;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-input-wrapper .search-submit:hover {
    background: #0056b3;
}