/**
 * Stock Image Browser - Frontend Styles
 */

/* ========== CABECERA OSCURA ========== */
.cabecera_stock_busqueda {
    position: relative;
    background: #101010;
    padding-top: 200px;
    padding-bottom: 70px;
    text-align: center;
    color: white;
}

.cabecera_stock_busqueda h1 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.cabecera_stock_busqueda .subtitulo {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ========== SEARCH PAGE LAYOUT ========== */
.stock-search-page {
    min-height: 100vh;
    background: #f7fafc;
}

.search-bar-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-form-inline {
    display: flex;
    justify-content: center;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 8px 8px 20px;
    max-width: 700px;
    width: 100%;
    transition: border-color 0.3s;
}

.search-input-wrapper:focus-within {
    border-color: #007bff;
}

.search-input-wrapper .search-icon {
    position: static;
    transform: none;
    margin-right: 12px;
    color: #999;
    flex-shrink: 0;
}

.search-input-wrapper .search-input {
    font-family: 'Josefin Sans', sans-serif;
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 8px;
    background: transparent;
}

.search-input-wrapper .search-submit {
    font-family: 'Josefin Sans', sans-serif;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 32px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

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

.stock-browser-wrapper {
    padding: 40px 0;
}

/* ========== BROWSER COMPONENT ========== */
.stock-browser {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER ========== */
.browser-header {
    text-align: center;
    margin: 0 0 40px;
}

.browser-header h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a202c;
}

.browser-header p {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 18px;
    color: #718096;
    margin: 0;
}

/* ========== FILTERS ========== */
.browser-filters {
    margin: 0 0 40px;
}

.search-bar {
    position: relative;
    margin: 0 0 20px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #a0aec0;
    pointer-events: none;
}

.search-input {
    font-family: 'Josefin Sans', sans-serif;
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #7db600;
}

.filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
}

.filter-input-wrapper {
    position: relative;
}

.filter-input {
    font-family: 'Josefin Sans', sans-serif;
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: #7db600;
}

.filter-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.suggestion-item {
    font-family: 'Josefin Sans', sans-serif;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f7fafc;
}

.suggestion-count {
    font-size: 12px;
    color: #718096;
    margin-left: 8px;
}

.filter-select {
    font-family: 'Josefin Sans', sans-serif;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #7db600;
}

/* ========== CONTENT ========== */
.browser-content {
    position: relative;
    min-height: 600px;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    margin: 0 auto;
}

.loading-spinner[hidden] {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #7db600;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== IMAGES GRID ========== */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 0 0 40px;
}

.image-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.image-thumb {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f7fafc;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-card:hover .image-thumb img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.button-view {
    font-family: 'Josefin Sans', sans-serif;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.button-view:hover {
    background: #7db600;
    color: #fff;
    transform: translateY(-2px);
}

.image-info {
    padding: 15px;
}

.image-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-price {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #7db600;
}

.image-stats {
    font-family: 'Josefin Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #718096;
}
#stock-browser-app{
    margin-top:50px;
}
.stat-icon {
    width: 16px;
    height: 16px;
}
@media (max-width:768px){
    .image-meta{
        flex-direction:column;
        gap:5px;
    }
}
/* ========== NO RESULTS ========== */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    color: #cbd5e0;
    margin: 0 auto 20px;
}

.no-results p {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 18px;
    color: #718096;
    margin: 0 0 20px;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.pagination-links {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    font-family: 'Josefin Sans', sans-serif;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: #7db600;
    background: #f0f9ff;
}

.pagination-btn.active {
    background: #7db600;
    color: #fff;
    border-color: #7db600;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: #a0aec0;
}

/* ========== MODAL ========== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal[hidden] {
    display: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    z-index: 1001;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1002;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    margin: 0 auto;
}

.modal-body {
    display: contents;
}

.modal-image {
    position: relative;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.watermark-notice {
    font-family: 'Josefin Sans', sans-serif;
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
}

.modal-details {
    padding: 30px;
    overflow-y: auto;
}

.modal-details h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #1a202c;
}

.modal-description {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 20px;
}

.modal-meta {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
}

.meta-badge {
    font-family: 'Josefin Sans', sans-serif;
    padding: 6px 12px;
    background: #f0f9ff;
    color: #0369a1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 0 0 25px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

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

.stat-label {
    font-family: 'Josefin Sans', sans-serif;
    display: block;
    font-size: 12px;
    color: #718096;
    margin: 0 0 5px;
}

.stat-value {
    font-family: 'Josefin Sans', sans-serif;
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}

.modal-keywords {
    font-family: 'Josefin Sans', sans-serif;
    margin: 0 0 25px;
    font-size: 14px;
}

.modal-keywords strong {
    display: block;
    margin: 0 0 10px;
    color: #2d3748;
}

.keyword-tag {
    font-family: 'Josefin Sans', sans-serif;
    display: inline-block;
    padding: 4px 10px;
    margin: 0 6px 6px 0;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 4px;
    font-size: 12px;
}

.quality-selector {
    margin: 0 0 25px;
}

.quality-selector h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    color: #2d3748;
}

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

.quality-option {
    font-family: 'Josefin Sans', sans-serif;
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

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

.quality-option input {
    margin: 0 12px 0 0;
    cursor: pointer;
}

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

.quality-name {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    color: #2d3748;
}

.quality-size {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 13px;
    color: #718096;
}

.quality-price {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    color: #7db600;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.price-display {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 12px;
    color: #718096;
    margin: 0 0 4px;
}

.price-value {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
}

.button {
    font-family: 'Josefin Sans', sans-serif;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.button-primary {
    background: #7db600;
    color: #fff;
}

.button-primary:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* ========== NOTIFICATIONS ========== */
.notification {
    font-family: 'Josefin Sans', sans-serif;
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background: #10b981;
    color: #fff;
}

.notification-error {
    background: #ef4444;
    color: #fff;
}

.notification-info {
    background: #3b82f6;
    color: #fff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .modal-content {
        grid-template-columns: 1fr;
    }

    .modal-image {
        padding-top:10px;
    }
        .modal-image img {
            max-height: 400px;
        }
    .image-thumb img {
        object-fit: contain;
    }
    .image-thumb{
        max-height:400px;
        height:auto;
    }
}

@media (max-width: 768px) {
    .browser-header h2 {
        font-family: 'Josefin Sans', sans-serif;
        font-size: 28px;
    }

    .filter-controls {
        grid-template-columns: 1fr;
    }

    .filter-suggestions {
        max-height: 200px;
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .modal-content {
        max-height: 80vh;
        border-radius: 0;
        overflow-y:auto;
    }

    .modal-details {
        padding: 20px;
    }

    .modal-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 15px;
    }

    .button-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stock-browser {
        padding: 20px 10px;
    }

    .images-grid {
        grid-template-columns: 1fr;
    }

    .image-modal {
        padding: 0;
    }
}

/* ========== BACK BUTTON (VOLVER AL BUSCADOR) ========== */
.stock-browser-back-button {
    margin-bottom: 30px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
    font-family: 'Josefin Sans', sans-serif;
}

.stock-browser-back-button .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    color: #7db600;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.stock-browser-back-button .back-btn:hover {
    color: #6a9900;
    gap: 10px;
}

.stock-browser-back-button .back-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.stock-browser-back-button .back-btn:hover svg {
    transform: translateX(-3px);
}

.stock-browser-back-button .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #6b7280;
    flex-wrap: wrap;
}

.stock-browser-back-button .breadcrumb-item {
    color: #9ca3af;
}

.stock-browser-back-button .breadcrumb-item.active {
    color: #374151;
    font-weight: 600;
}

.stock-browser-back-button .breadcrumb-separator {
    color: #d1d5db;
    font-weight: 300;
}

.stock-browser-back-button .breadcrumb-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #7db600;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .stock-browser-back-button {
        padding: 16px 20px;
    }

    .stock-browser-back-button .back-btn {
        font-size: 14px;
    }

    .stock-browser-back-button .breadcrumb {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stock-browser-back-button {
        padding: 14px 16px;
    }

    .stock-browser-back-button .breadcrumb {
        font-size: 12px;
    }
}