/* =========================
   Productos Grid Catálogo Categorías - Estilos
   ========================= */

/* Contenedor principal */
.pgcc-wrapper{
    max-width: 1280px;
    margin: 40px auto;
    font-family: Arial, Helvetica, sans-serif;
    padding: 0 16px;
    position: relative;
}

/* Listado principal */
.pgcc-list{
    width: 100%;
    position: relative;
}

.pgcc-topbar{
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E9F3FB;
}

.pgcc-topbar-right{
    font-size: 18px;
    color: #143E6B;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading overlay */
.pgcc-loading-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 100;
    border-radius: 8px;
}

.pgcc-loading-overlay.active{
    display:  flex;
}

.pgcc-spinner{
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3371D7;
    border-radius: 50%;
    animation: pgcc-spin 1s linear infinite;
    margin-bottom: 15px;
}

.pgcc-loading-text{
    color: #143E6B;
    font-weight: 600;
}

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

.pgcc-initial-loading{
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #666;
    font-size: 16px;
}

/* Grid */
.pgcc-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    transition: opacity 0.3s ease;
    min-height: 400px;
}

.pgcc-grid.loading{
    opacity: 0.5;
}

/* Item */
.pgcc-item{
    background: none;
    border: 1px solid #ececec;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 360px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pgcc-item:hover{
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
    transform: translateY(-4px);
    border-color: #3371D7;
}

/* Thumb */
.pgcc-thumb{
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f6f6f6;
    min-height: 200px;
    margin-bottom: 15px;
}

.pgcc-thumb img{
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: #f6f6f6;
}

.pgcc-thumb img.pgcc-lazy{
    opacity: 0.3;
    filter: blur(5px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.pgcc-thumb img.pgcc-loaded{
    opacity: 1;
    filter: blur(0);
}

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

/* Title */
.pgcc-title{
    font-size: 20px;
    margin: 0 0 8px;
    line-height: 1.3;
    min-height: 52px;
}

.pgcc-title a{
    color: #143E6B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pgcc-title a:hover{
    color: #3371D7;
    text-decoration: underline;
}

/* Categories text */
.pgcc-cats{
    font-size: 13px;
    color: #8a8a8a;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Excerpt */
.pgcc-excerpt{
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    flex: 1;
    line-height: 1.5;
}

/* Button */
.pgcc-button{
    display: inline-block;
    padding: 10px 24px;
    background: #3371D7;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    align-self: flex-start;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.pgcc-button:hover{
    background: #2a5cb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 113, 215, 0.3);
}

/* Pagination */
.pgcc-pagination{
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pgcc-pages{
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pgcc-pages li a{
    display: inline-block;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #dfe7f5;
    color: #143E6B;
    text-decoration: none;
    font-weight: 700;
    min-width: 42px;
    text-align: center;
    transition: all 0.2s ease;
}

.pgcc-pages li a:hover:not(.pgcc-page-current){
    background: #E9F3FB;
    border-color: #3371D7;
    transform: translateY(-2px);
}

.pgcc-pages li a.pgcc-page-current{
    background: #143E6B;
    color: #fff;
    border-color: #143E6B;
    cursor: default;
}

/* Estados de carga y error */
.pgcc-error{
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #d33;
    background: #ffeaea;
    border-radius: 8px;
}

.pgcc-no-results{
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1200px){
    .pgcc-wrapper{
        max-width: 100%;
        padding: 0 24px;
    }
    
    .pgcc-grid{
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px){
    .pgcc-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .pgcc-item{
        min-height: 340px;
    }
    
    .pgcc-thumb img{
        height: 180px;
    }
}

@media (max-width: 768px){
    .pgcc-wrapper{
        padding: 0 16px;
        margin: 30px auto;
    }
    
    .pgcc-topbar-right{
        font-size: 16px;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 600px){
    .pgcc-grid{
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pgcc-item{
        min-height: auto;
        padding: 15px;
    }
    
    .pgcc-thumb{
        min-height: 180px;
    }
    
    .pgcc-thumb img{
        height: 180px;
    }
    
    .pgcc-title{
        font-size: 18px;
        min-height: auto;
    }
    
    .pgcc-pages{
        gap: 4px;
    }
    
    .pgcc-pages li a{
        padding: 8px 12px;
        min-width: 36px;
    }
}

@media (max-width: 480px){
    .pgcc-wrapper{
        padding: 0 12px;
        margin: 20px auto;
    }
    
    .pgcc-grid{
        gap: 12px;
    }
    
    .pgcc-item{
        padding: 12px;
    }
    
    .pgcc-button{
        width: 100%;
        text-align: center;
    }
}