/* ===== ESTILOS PARA DETALLE DE POST ===== */

/* Post Detail */
.post-detail {
    max-width: 800px;
    margin: 0 auto 4rem;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Listas más limpias y escaneables */
.oc-post-content ul,
.oc-post-content ol{
    margin: 12px 0;
    padding-left: 20px;
}

.oc-post-content li{
    margin-bottom: 6px;
}

/* Strong / Em con look viral */
.oc-post-content strong{
    font-weight: 700;
    background: rgba(255, 217, 61, 0.3);
    padding: 2px 6px;
    border-radius: 6px;
}

.oc-post-content em{
    font-style: italic;
    color: #555;
}

/* Separación visual entre secciones */
.oc-post-content h2{
    border-left: 4px solid #FFD93D;
    padding-left: 12px;
}

/* Meme automático usando :has (mejora progresiva) */
@supports(selector(p:has(strong))) {
    .oc-post-content p:has(strong:only-child),
    .oc-post-content p:has(em:only-child) {
        text-align: center;
        font-size: 20px;
        font-weight: 800;
        margin: 24px 0;
        padding: 16px;
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(255,217,61,0.28), rgba(78,205,196,0.18));
        border: 1px solid rgba(20,21,26,0.10);
    }
}

/* Fallback JS: punchline */
.oc-post-content p.oc-punchline{
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin: 24px 0;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,217,61,0.28), rgba(78,205,196,0.18));
    border: 1px solid rgba(20,21,26,0.10);
}

.post-header {
    padding: 2rem 2rem 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-category {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-category a {
    color: white;
    text-decoration: none;
}

.post-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.post-author {
    font-weight: 600;
    color: #333;
}

.post-date {
    color: #888;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.post-excerpt {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.6;
    font-style: italic;
}

.post-hero-image {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    background: #f8f9fa;
}

/* ===== ESTILO VIRAL / REDES PARA POST ===== */
.oc-post-page{
    background: transparent;
}

.oc-post-hero{
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    max-height: 80vh;
    overflow: hidden;
    background: #0b0c10;
}

.oc-post-hero > img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
    display: block;
    transform: none;
}

.oc-post-hero-overlay{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0.20) 55%, transparent);
}

.oc-post-hero-chips{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.oc-chip{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 900;
    font-size: 13px;
    color: #111;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
}

.oc-chip--meta{
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.20);
}

.oc-post-hero-title{
    margin: 0;
    color: #fff;
    font-weight: 950;
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-size: clamp(30px, 4.2vw, 54px);
    text-shadow: 0 12px 35px rgba(0,0,0,0.45);
}

.oc-post-hero-excerpt{
    margin: 12px 0 22px;
    color: rgba(255,255,255,0.92);
    font-weight: 800;
    font-size: clamp(14px, 1.7vw, 18px);
    line-height: 1.35;
    max-width: 70ch;
}

.oc-post-article{
    margin: 26px auto 0;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(20,21,26,0.08);
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    padding: 22px;
}

.oc-post-meta-row{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.oc-post-author{
    font-weight: 900;
    color: #14151a;
}

.oc-post-share-hint{
    font-weight: 900;
    color: rgba(20,21,26,0.62);
    font-size: 13px;
}

/* Contenido escaneable */
.oc-post-content{
    max-width: 720px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(20,21,26,0.92);
}

.oc-post-content p{
    margin: 0 0 12px;
    max-width: none;
}

.oc-post-content p + p{
    margin-top: 0;
}

.oc-post-content h2,
.oc-post-content h3{
    margin: 28px 0 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.oc-post-content h2{
    margin-top: 32px;
    font-size: 22px;
}

.oc-post-content h3{
    font-size: 1.25rem;
}

/* Imágenes integradas como bloque visual */
.oc-post-content img{
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin: 18px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* Bloques destacados */
.oc-post-content blockquote,
.oc-post-content .block-quote{
    background: #FFF3CD;
    padding: 16px;
    border-radius: 12px;
    font-weight: 900;
    border: 1px solid rgba(20,21,26,0.10);
    margin: 18px 0;
}

.oc-post-content .meme{
    font-weight: 950;
    font-size: 20px;
    text-align: center;
    margin: 24px 0;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,217,61,0.35), rgba(255,107,107,0.25));
    border: 1px solid rgba(20,21,26,0.10);
}

.oc-post-content .highlight,
.oc-post-content .frase-destacada{
    padding: 16px;
    border-radius: 12px;
    background: rgba(78,205,196,0.18);
    border: 1px solid rgba(78,205,196,0.30);
    font-weight: 900;
    margin: 18px 0;
}

/* Fases: headings tipo sección visual */
.oc-post-content h2{
    position: relative;
    padding-left: 14px;
}

.oc-post-content h2::before{
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #FFD93D, #FF6B6B);
}

.oc-post-cta{
    margin-top: 18px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

@media (max-width: 560px){
    .oc-post-article{padding: 18px;}
    .oc-post-hero{max-height: 68vh;}

    .oc-post-hero{
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: #fff;
        aspect-ratio: auto;
        max-height: none;
        overflow: visible;
    }

    .oc-post-hero > img{
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 16px;
        margin: 0 16px;
        width: calc(100% - 32px);
        object-position: 50% 35%;
    }

    .oc-post-hero-overlay{
        position: static !important;
        inset: auto !important;
        background: rgba(255,255,255,0.92) !important;
        padding: 14px 0 16px !important;
        display: block !important;
    }

    .oc-post-hero-title{
        color: #14151a;
        text-shadow: none;
        font-size: clamp(22px, 7vw, 30px);
        line-height: 1.15;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    /* When JS moves excerpt below the image */
    .oc-post-hero.oc-hero-mobile-reflow .oc-post-hero-excerpt{
        margin: 0 16px;
        color: rgba(20,21,26,0.78);
        font-weight: 800;
        text-shadow: none;
        max-width: 70ch;
    }

    .oc-post-hero-chips .oc-chip--meta{
        background: rgba(20,21,26,0.06);
        color: rgba(20,21,26,0.78);
        border-color: rgba(20,21,26,0.10);
        backdrop-filter: none;
    }
}

.post-hero-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ===== ESTILOS PARA DETALLE DE POST ===== */

/* Estilos específicos para post.php */
.post-detail .post-content {
    padding: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    background: white;
    position: relative;
    z-index: 1;
}

/* Estilos específicos para index.php (títulos sobre imagen) */
.post-card:not(.vip-post) .post-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 1rem 1rem 0.8rem;
    color: white;
}

.post-card:not(.vip-post) .post-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff !important;
    line-height: 1.1;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.95);
    display: block;
    text-align: left;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Estilos específicos para posts-grid-section (sección 3) */
.posts-grid-section .post-card .post-content {
    position: relative !important;
    background: white !important;
    padding: 1rem !important;
    color: #333 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
}

.posts-grid-section .post-card .post-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    line-height: 1.3 !important;
    text-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 0.5rem 0 !important;
    text-align: left !important;
}

/* Asegurar que category-button no sea afectado por estilos de post */
.category-button {
    display: inline-block !important;
    padding: 1rem 2rem !important;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 150px !important;
    text-align: center !important;
    flex: 0 1 auto !important;
    white-space: nowrap !important;
    border: none !important;
    margin: 0 !important;
}

/* Párrafos y separaciones en el contenido */
.post-content p {
    margin-bottom: 1.5rem;
    text-align: left;
}

.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 2rem 0;
}

.post-content h1, 
.post-content h2, 
.post-content h3, 
.post-content h4, 
.post-content h5, 
.post-content h6 {
    margin: 2rem 0 1rem 0;
    color: #2c3e50;
    font-weight: 700;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.8rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.3rem; }
.post-content h5 { font-size: 1.1rem; }
.post-content h6 { font-size: 1rem; }

/* Imágenes dentro del contenido */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Para imágenes con atributos dimensionales */
.post-content img[height][width] {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    margin: 1.5rem auto;
}

/* Products Section */
.products-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6c757d 0%, #495057 100%);
    opacity: 0.8;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6c757d 0%, #495057 100%);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto 2rem;
    text-align: center;
    line-height: 1.4;
    font-weight: 400;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
    justify-items: center;
    align-items: start;
    padding-bottom: 0;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    width: fit-content;
    max-width: 200px;
    margin-bottom: 0;
}

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

.product-gallery {
    position: relative;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.product-main-image {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card:hover .product-main-image {
    transform: scale(1.05);
}

.image-counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.image-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.image-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-indicator.active,
.image-indicator:hover {
    background: white;
    transform: scale(1.2);
}

.image-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    overflow-x: auto;
}

.thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail.active {
    border-color: #667eea;
}

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

.thumbnail.more-images {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
}

.product-info {
    padding: 0.5rem 0.75rem 0 0.75rem;
    margin-bottom: 0;
    text-align: center;
}

.product-brand {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-align: center;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 0.8rem;
    line-height: 1;
}

.star.filled {
    color: #f7a400;
}

.star.half {
    color: #f7a400;
    position: relative;
}

.star.empty {
    color: #ddd;
}

.rating-text {
    font-size: 0.8rem;
    color: #666;
}

.product-price {
    margin-bottom: 0.25rem;
    text-align: center;
}

.price-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2c3e50;
}

.price-currency {
    font-size: 0.9rem;
    color: #666;
    margin-left: 0.2rem;
}

.price-unavailable {
    font-size: 1.1rem;
    color: #999;
    font-style: italic;
}

.product-category {
    display: none;
}

.amazon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #ffa41c 0%, #ff8c00 100%);
    color: white;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

.product-meta {
    display: none;
}

.amazon-button:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 164, 28, 0.3);
}

.amazon-logo {
    width: 16px;
    height: 16px;
}

.product-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.products-disclaimer {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 2rem;
}

.products-disclaimer small {
    color: #666;
    line-height: 1.5;
}

/* Related Posts */
.related-posts {
    max-width: 980px;
    margin: 54px auto;
    padding: 0 16px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    justify-content: center;
    gap: 14px;
    margin-top: 2rem;
}

.related-post-card {
    background: rgba(255,255,255,0.92);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(20,21,26,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.10);
}

.related-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.related-post-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% 30%;
    transition: transform 0.3s ease;
}

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

.related-post-content {
    padding: 12px 12px 14px;
}

.related-post-content h3 {
    font-size: 15px;
    font-weight: 900;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.related-post-content p {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .post-detail {
        margin: 0 0 2rem;
        border-radius: 0;
    }
    
    .post-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-hero-image {
        max-height: 300px;
    }
    
    .post-hero-image img {
        max-height: 300px;
    }
    
    .post-content {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.8rem;
        max-width: 400px;
        justify-items: center;
    }
    
    .product-card {
        width: fit-content;
        max-width: 180px;
    }
    
    .main-image-container {
        height: 350px;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .post-header {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-hero-image {
        max-height: 250px;
    }
    
    .post-hero-image img {
        max-height: 250px;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 280px;
        margin: 0 auto;
        justify-items: center;
    }
    
    .product-card {
        width: fit-content;
        max-width: 280px;
    }
    
    .main-image-container {
        height: 320px;
    }
    
    .product-main-image {
        width: auto;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
        object-position: center;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .image-thumbnails {
        padding: 0.75rem;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
}
