/* ========================================
   MARKETPLACE FOTOGRAFÍAS - ESTILOS
   ======================================== */

/* Layout principal */
.marketplace-hero {
    background: linear-gradient(135deg, #083300 0%, #0f5b01 100%);
    color: white;
    padding: 120px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.marketplace-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.marketplace-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    line-height: 1.2;
    word-wrap: break-word;
}

.marketplace-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   SECCIÓN DE BÚSQUEDA
   ======================================== */

.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin: -40px auto 50px;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    position: relative;
    z-index: 2;
}

.search-form {
    display: flex;
    gap: 0;
    align-items: center;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 50px;
    padding: 6px;
    border: 1px solid rgba(15, 91, 1, 0.1);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: rgba(15, 91, 1, 0.3);
    box-shadow: 0 0 0 4px rgba(15, 91, 1, 0.05);
}

.search-input-group {
    flex: 1;
    position: relative;
}

.search-input-group label {
    display: none;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #333;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    color: #0f5b01;
}

.search-input:focus::placeholder {
    color: transparent;
}

.search-select {
    flex: 0 0 200px;
    padding: 14px 16px 14px 20px;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.08);
    background: transparent;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
}

.search-select:focus {
    outline: none;
    color: #0f5b01;
}

.search-btn {
    background: #0f5b01;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    margin-left: 4px;
}

.search-btn:hover {
    background: #083300;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(15, 91, 1, 0.3);
}

.search-btn i {
    font-size: 0.9rem;
}

/* ========================================
   GRID DE ÁLBUMES
   ======================================== */

.albums-container {
    padding: 0 20px 60px;
}

.albums-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.albums-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.albums-count {
    color: #666;
    font-size: 1rem;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ========================================
   CARDS DE ÁLBUMES
   ======================================== */

.album-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

/* EFECTO HOVER EN EL TÍTULO */
.album-card:hover .album-name {
    color: #0f5b01;
    transform: translateX(4px);
}

.album-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

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

.album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.3) 70%,
        rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: end;
    padding: 20px;
}

.album-count {
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.album-info {
    padding: 1.5rem;
    display: grid;
    grid-template-rows: auto minmax(70px, auto) auto auto;
    gap: 0;
}

.album-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.album-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    min-height: 70px;
}

.album-meta-item {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.album-meta-item i {
    color: #0f5b01;
    width: 16px;
}

.album-categoria {
    display: inline-block;
    background: #f0f9ff;
    color: #0f5b01;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: start;
    width: fit-content;
}

.album-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f5b01;
    margin-top: 0.5rem;
}

/* ========================================
   ESTADO VACÍO
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: #666;
}

/* ========================================
   PAGINACIÓN
   ======================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    gap: 4px;
    background: white;
    padding: 8px;
}

.page-link {
    color: #0f5b01;
    border-color: #e1e5e9;
    padding: 12px 16px;
    min-width: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.page-link:hover {
    background-color: #f0f9ff;
    border-color: #0f5b01;
    color: #083300;
}

.page-item.active .page-link {
    background-color: #0f5b01;
    border-color: #0f5b01;
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e1e5e9;
    color: #999;
    cursor: not-allowed;
}

/* Loading Overlay para paginación */
.pagination-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.pagination-loading-overlay.show {
    display: flex;
}

.pagination-loading-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0f5b01;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.pagination-loading-text {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ========================================
   ANIMACIONES
   ======================================== */

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

.album-card {
    animation: fadeInUp 0.6s ease-out;
}

.album-card:nth-child(2) { animation-delay: 0.1s; }
.album-card:nth-child(3) { animation-delay: 0.2s; }
.album-card:nth-child(4) { animation-delay: 0.3s; }

/* ========================================
   VISTA DE ÁLBUM INDIVIDUAL
   ======================================== */

/* Header del álbum */
.album-hero {
    background: linear-gradient(135deg, #083300 0%, #0f5b01 100%);
    color: white;
    padding: 120px 0 40px;
    position: relative;
    overflow: hidden;
}

.album-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.album-header {
    position: relative;
    z-index: 1;
}

.album-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.album-breadcrumb a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.album-breadcrumb a:hover {
    color: white;
}

.album-breadcrumb span {
    color: rgba(255,255,255,0.6);
    margin: 0 0.5rem;
}

.album-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.album-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

.album-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    opacity: 0.9;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.album-detail-item i {
    color: #90EE90;
}

.album-description {
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.album-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.cart-info {
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

/* Grid de fotografías */
.photos-container {
    padding: 3rem 0;
    background: #f8f9fa;
}

.photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.photos-count {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 12px;
}

.view-btn {
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.view-btn.active,
.view-btn:hover {
    background: #0f5b01;
    color: white;
    transform: scale(1.05);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.photos-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Cards de fotografías */
.photo-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.photo-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.photo-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
}

.photo-checkbox i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.checkbox-unchecked {
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.checkbox-checked {
    color: #fff;
    display: none;
    background: #28a745;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estado NO seleccionado */
.photo-card:not(.in-cart) .checkbox-unchecked {
    display: flex;
}

.photo-card:not(.in-cart) .checkbox-checked {
    display: none;
}

/* Estado SELECCIONADO */
.photo-card.in-cart .checkbox-unchecked {
    display: none;
}

.photo-card.in-cart .checkbox-checked {
    display: flex;
}

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

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

.photo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.photo-cart-btn {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.photo-cart-btn:hover {
    background: #0f5b01;
    border-color: #0f5b01;
    color: white;
    transform: scale(1.1);
}

.photo-cart-btn.in-cart {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.photo-cart-btn.in-cart:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

.photo-cart-btn i {
    font-size: 0.9rem;
}

.photo-info {
    padding: 1.25rem;
}

.photo-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    flex: 1;
    line-height: 1.3;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.photo-meta-left {
    color: #666;
}

.photo-price {
    font-weight: 700;
    color: #0f5b01;
    font-size: 1rem;
}

/* Carrito flotante */
.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0f5b01;
    color: white;
    padding: 16px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.floating-cart.show {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-cart:hover {
    background: #083300;
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

.cart-badge {
    background: #ff4757;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 50%;
    min-width: 24px;
    text-align: center;
}

/* Estado vacío para fotos */
.empty-photos {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    background: white;
    border-radius: 16px;
    margin: 2rem 0;
}

.empty-photos i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-photos h3 {
    font-size: 1.5rem;
    color: #999;
    margin-bottom: 0.5rem;
}

/* ========================================
   CARRITO DE COMPRAS
   ======================================== */

/* Hero del carrito */
.cart-hero {
    background: linear-gradient(135deg, #083300 0%, #0f5b01 100%);
    color: white;
    padding: 120px 0 40px;
    text-align: center;
}

.cart-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-hero p {
    opacity: 0.9;
    margin: 0;
}

/* Contenedor del carrito */
.cart-container {
    padding: 3rem 0;
    min-height: 60vh;
    background: #f8f9fa;
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

/* Lista de fotos */
.cart-items {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.cart-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.cart-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background: #f8f9fa;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.item-album {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.item-meta {
    font-size: 0.8rem;
    color: #999;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f5b01;
    margin-right: 1rem;
}

.item-remove {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.item-remove:hover {
    background: #ff3838;
    transform: scale(1.05);
}

/* Resumen del carrito */
.cart-summary {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.summary-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-items {
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e1e5e9;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f5b01;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid #e1e5e9;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

.checkout-btn {
    width: 100%;
    background: #0f5b01;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-btn:hover {
    background: #083300;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 91, 1, 0.3);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.continue-shopping {
    width: 100%;
    background: transparent;
    color: #0f5b01;
    border: 2px solid #0f5b01;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.continue-shopping:hover {
    background: #0f5b01;
    color: white;
}

/* Estado vacío del carrito */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    grid-column: 1 / -1;
    background: white;
    border-radius: 16px;
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-cart h3 {
    font-size: 1.5rem;
    color: #999;
    margin-bottom: 1rem;
}

.empty-cart p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.browse-btn {
    background: #0f5b01;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.browse-btn:hover {
    background: #083300;
    color: white;
    transform: translateY(-2px);
}

/* Información de entrega */
.delivery-info {
    background: #f0f9ff;
    border: 1px solid #0f5b01;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.delivery-info h4 {
    color: #0f5b01;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-info p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Animaciones del carrito */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.cart-item.removing {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
    .marketplace-hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .marketplace-hero {
        padding: 100px 0 30px;
    }

    .marketplace-hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    /* Álbum responsive */
    .album-hero {
        padding: 100px 0 30px;
    }

    .album-title {
        font-size: 2rem;
    }

    .album-details {
        flex-direction: column;
        align-items: start;
        gap: 1rem;
    }

    .album-detail-item {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .photos-container {
        padding: 2rem 0;
    }

    .photos-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: start;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .photo-card {
        border-radius: 12px;
    }

    .photo-image {
        aspect-ratio: 1;
    }

    .floating-cart {
        bottom: 90px;
        right: 20px;
        padding: 12px 18px;
    }

    /* Paginación responsive */
    .pagination-wrapper {
        padding: 0 10px;
        margin-top: 2rem;
        position: relative;
    }

    .pagination-wrapper::after {
        content: '← Desliza →';
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: #999;
        margin-top: 0.5rem;
        font-weight: 500;
    }

    .pagination {
        gap: 3px;
        padding: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    }

    .pagination::-webkit-scrollbar {
        display: none;
    }

    .page-item {
        flex-shrink: 0;
    }

    .page-link {
        padding: 8px 10px;
        min-width: 36px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Ocultar texto "Previous" y "Next" en mobile, solo mostrar iconos */
    .page-link[rel="prev"],
    .page-link[rel="next"] {
        padding: 8px;
        min-width: 36px;
    }

    /* Loading overlay mobile */
    .pagination-loading-content {
        padding: 1.5rem 2rem;
        margin: 0 20px;
    }

    .pagination-spinner {
        width: 40px;
        height: 40px;
    }

    .pagination-loading-text {
        font-size: 1rem;
    }

    /* Carrito responsive */
    .cart-hero {
        padding: 100px 0 30px;
    }

    .cart-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .cart-summary {
        order: -1;
        position: static;
    }

    .cart-container {
        padding: 2rem 0;
    }

    .cart-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
        padding: 1.25rem;
    }

    .cart-header h2 {
        font-size: 1.1rem;
        width: 100%;
    }

    .cart-header .btn-outline-danger {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .cart-item {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .item-image {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .item-info {
        flex: 1;
        min-width: 0;
    }

    .item-name {
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .item-album {
        font-size: 0.8rem;
    }

    .item-meta {
        font-size: 0.75rem;
    }

    .item-price {
        font-size: 1rem;
        margin-right: 0;
    }

    .item-remove {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .cart-summary {
        padding: 1.5rem;
    }

    .search-section {
        margin: -30px 15px 40px;
        padding: 1.25rem 1.5rem;
    }

    .search-form {
        flex-direction: column;
        gap: 12px;
        padding: 8px;
        border-radius: 16px;
    }

    .search-select {
        flex: none;
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.08);
        padding: 14px 20px;
    }

    .search-btn {
        align-self: stretch;
        justify-content: center;
        margin-left: 0;
        border-radius: 12px;
    }

    .albums-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .albums-container {
        padding: 0 15px 40px;
    }

    .albums-header {
        flex-direction: column;
        align-items: start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .marketplace-hero h1 {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 0.8rem;
    }

    /* Álbum móvil */
    .album-title {
        font-size: 1.8rem;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .photo-image {
        aspect-ratio: 1;
    }


    .photos-header {
        margin: 0 -15px 2rem;
        border-radius: 0;
    }

    .photo-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .photo-btn {
        padding: 10px 16px;
        justify-content: center;
    }

    /* Carrito móvil */
    .cart-container {
        padding: 1rem 0;
    }

    .cart-items,
    .cart-summary {
        margin: 0 -15px;
        border-radius: 0;
    }

    .search-section {
        margin: -20px 10px 30px;
        padding: 1rem;
        border-radius: 16px;
    }

    .search-form {
        gap: 10px;
        padding: 6px;
        border-radius: 12px;
    }

    .search-input, .search-select {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .search-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .albums-container {
        padding: 0 10px 30px;
    }

    .album-info {
        padding: 1rem;
    }

    /* Paginación extra pequeña para móviles */
    .pagination-wrapper {
        padding: 0 10px;
    }

    .pagination {
        gap: 2px;
        padding: 3px;
        justify-content: flex-start;
    }

    .page-link {
        padding: 6px 8px;
        min-width: 32px;
        font-size: 0.8rem;
    }

    .page-link[rel="prev"],
    .page-link[rel="next"] {
        padding: 6px;
        min-width: 32px;
    }
}

/* ========================================
   BOTÓN "VER MÁS ÁLBUMES"
   ======================================== */

.btn-back-albums {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-back-albums:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-back-albums i {
    opacity: 0.9;
}

/* ========================================
   LIGHTBOX MEJORADO
   ======================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.show {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    transition: transform 0.1s ease;
}

.lightbox-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 600px;
    width: 90%;
}

.lightbox-photo-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    line-height: 1.4;
}

.lightbox-cart-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.lightbox-cart-btn.add-to-cart {
    background: #0f5b01;
    color: white;
}

.lightbox-cart-btn.add-to-cart:hover {
    background: #083300;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(15, 91, 1, 0.25);
}

.lightbox-cart-btn.remove-from-cart {
    background: #dc3545;
    color: white;
}

.lightbox-cart-btn.remove-from-cart:hover {
    background: #c82333;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.25);
}

.lightbox-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lightbox-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f5b01;
    white-space: nowrap;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 12px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-nav {
    visibility: visible;
    opacity: 1;
}

.lightbox.show .lightbox-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estilos para fotos en el carrito */
.photo-card.in-cart {
    border: 4px solid #28a745;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.25);
}

.photo-card.in-cart:hover {
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.35);
}

.photo-btn.cart-btn.remove-from-cart {
    background: #dc3545;
    color: white;
}

.photo-btn.cart-btn.remove-from-cart:hover {
    background: #c82333;
}

/* ========================================
   RESPONSIVE LIGHTBOX Y BOTONES
   ======================================== */

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 1rem;
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    .lightbox-nav:hover {
        transform: translateY(-50%) scale(1.05);
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-image {
        max-height: 60vh;
    }

    .lightbox-actions {
        flex-direction: column;
        gap: 0.875rem;
        padding: 1rem 1.25rem;
        width: 90%;
        margin-top: 1rem;
        border-radius: 20px;
        max-width: 500px;
    }

    .lightbox-photo-name {
        text-align: center;
        font-size: 0.85rem;
        line-height: 1.35;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .lightbox-cart-btn {
        width: 100%;
        padding: 13px 20px;
        border-radius: 12px;
        font-size: 0.9rem;
        justify-content: center;
    }

    .lightbox-cart-btn #lightbox-cart-text {
        display: inline;
    }

    .lightbox-cart-btn i {
        font-size: 0.95rem;
    }

    .lightbox-price {
        font-size: 1.25rem;
        text-align: center;
        width: 100%;
    }

    /* Botón "Ver más álbumes" en móvil */
    .btn-back-albums {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .btn-back-albums i {
        display: none;
    }

    /* Checkbox en móvil */
    .photo-checkbox {
        width: 24px;
        height: 24px;
        top: 8px;
        right: 8px;
    }

    .checkbox-unchecked,
    .checkbox-checked {
        width: 24px;
        height: 24px;
    }

    .checkbox-checked i {
        font-size: 0.7rem;
    }

    .checkbox-unchecked i {
        font-size: 0.9rem;
    }

    .photo-info {
        padding: 0.75rem;
    }

    .photo-name {
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .photo-meta {
        font-size: 0.75rem;
    }

    .photo-cart-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .photo-cart-btn i {
        font-size: 0.8rem;
    }
}

/* ========================================
   VISTA EN LISTA DE FOTOS
   ======================================== */

/* Lista de fotos - vista alternativa en lista */
.photos-grid.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photos-grid.list .photo-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
}

.photos-grid.list .photo-image {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    margin-right: 1.5rem;
    aspect-ratio: 4/3;
}

.photos-grid.list .photo-info {
    flex: 1;
    padding: 0;
    margin-right: 1rem;
}

.photos-grid.list .photo-checkbox {
    display: none;
}

.photos-grid.list .photo-overlay {
    position: relative;
    background: transparent;
    opacity: 1;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.photos-grid.list .photo-actions {
    flex-direction: row;
    gap: 0.5rem;
}

.photos-grid.list .photo-btn {
    background: rgba(15, 91, 1, 0.1);
    color: #0f5b01;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.photos-grid.list .photo-btn:hover {
    background: #0f5b01;
    color: white;
}

.photos-grid.list .photo-btn.cart-btn {
    background: #0f5b01;
    color: white;
}

.photos-grid.list .photo-btn.cart-btn:hover {
    background: #083300;
}

.photos-grid.list .photo-name {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.photos-grid.list .photo-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
}

.photos-grid.list .photo-price {
    font-size: 1.1rem;
}

/* Responsive para vista lista */
@media (max-width: 768px) {
    .photos-grid.list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .photos-grid.list .photo-card {
        flex-direction: row;
        align-items: center;
        padding: 0.75rem;
    }

    .photos-grid.list .photo-image {
        width: 100px;
        height: 75px;
        flex-shrink: 0;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }

    .photos-grid.list .photo-info {
        margin-right: 0.5rem;
        margin-bottom: 0;
        flex: 1;
    }

    .photos-grid.list .photo-name {
        font-size: 0.9rem;
    }

    .photos-grid.list .photo-meta {
        font-size: 0.8rem;
    }

    .photos-grid.list .photo-overlay {
        position: relative;
        margin-left: 0;
        display: flex;
        align-items: center;
    }

    .photos-grid.list .photo-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .photos-grid.list .photo-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}