/*
Theme Name: GeneratePress Child
Theme URI: https://yoursite.com
Description: Child theme for GeneratePress with custom top bar menu below primary navigation
Author: Subhash Lovanshi
Template: generatepress
Version: 1.0.7
Text Domain: generatepress-child
*/

/* ============================================
   CUSTOM TOP BAR - HORIZONTAL SLIDER
   ============================================ */

.custom-top-bar-container {
    width: 100%;
    background: #000000;
    border-bottom: 2px solid #333333;
    position: relative;
    z-index: 98;
}

.custom-top-bar {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0;
}

.custom-top-bar-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 3px 15px;
    white-space: nowrap;
}

.custom-top-bar-wrapper::-webkit-scrollbar {
    height: 4px;
}

.custom-top-bar-wrapper::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

.custom-top-bar-wrapper::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 10px;
    transition: background 0.3s;
}

.custom-top-bar-wrapper::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

.custom-top-bar-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    align-items: center !important;
    white-space: nowrap !important;
}

.custom-top-bar-menu li {
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    position: relative;
    display: inline-block !important;
    float: none !important;
}

.custom-top-bar-menu li a {
    display: inline-block !important;
    padding: 5px 15px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    position: relative;
    line-height: 1.4 !important;
}

.custom-top-bar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.custom-top-bar-menu li a:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

.custom-top-bar-menu li.current-menu-item a,
.custom-top-bar-menu li.current_page_item a,
.custom-top-bar-menu li.current-menu-ancestor a {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.custom-top-bar-menu li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 15px;
    background: #444444;
    z-index: 1;
}

.custom-top-bar-menu .sub-menu,
.custom-top-bar-menu ul ul {
    display: none !important;
}

.custom-top-bar.admin-notice {
    animation: slideDown 0.5s ease;
    background: #fff3cd !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-top-bar-wrapper {
    cursor: grab;
}

.custom-top-bar-wrapper:active {
    cursor: grabbing;
}

/* Desktop */
@media (min-width: 1025px) {
    .custom-top-bar-wrapper {
        padding: 4px 20px;
    }
    
    .custom-top-bar-menu li a {
        padding: 6px 18px !important;
        font-size: 13px !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .custom-top-bar-wrapper {
        padding: 3px 15px;
    }
    
    .custom-top-bar-menu li a {
        padding: 5px 15px !important;
        font-size: 13px !important;
    }
}

/* Mobile Landscape */
@media (min-width: 481px) and (max-width: 767px) {
    .custom-top-bar-wrapper {
        padding: 3px 12px;
    }
    
    .custom-top-bar-menu li a {
        padding: 5px 14px !important;
        font-size: 12px !important;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .custom-top-bar-wrapper {
        padding: 2px 10px;
    }
    
    .custom-top-bar-menu li a {
        padding: 4px 12px !important;
        font-size: 12px !important;
    }
    
    .custom-top-bar-wrapper::-webkit-scrollbar {
        height: 3px;
    }
    
    .custom-top-bar-menu li:not(:last-child)::after {
        height: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 319px) {
    .custom-top-bar-menu li a {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }
    
    .custom-top-bar-wrapper {
        padding: 2px 8px;
    }
}

.custom-top-bar-menu li {
    animation: fadeIn 0.5s ease backwards;
}

.custom-top-bar-menu li:nth-child(1) { animation-delay: 0.05s; }
.custom-top-bar-menu li:nth-child(2) { animation-delay: 0.1s; }
.custom-top-bar-menu li:nth-child(3) { animation-delay: 0.15s; }
.custom-top-bar-menu li:nth-child(4) { animation-delay: 0.2s; }
.custom-top-bar-menu li:nth-child(5) { animation-delay: 0.25s; }
.custom-top-bar-menu li:nth-child(6) { animation-delay: 0.3s; }
.custom-top-bar-menu li:nth-child(7) { animation-delay: 0.35s; }
.custom-top-bar-menu li:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-top-bar-menu li a:focus {
    outline: 2px solid #666666;
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.2) !important;
}

@media print {
    .custom-top-bar-container {
        display: none !important;
    }
}

/* ============================================
   SIDEBAR: 3 POSTS PER ROW (MOBILE + DESKTOP)
   ============================================ */

.topbar-sidebar-area {
    margin-bottom: 30px;
}

.topbar-categories-widget {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.topbar-categories-widget .widget-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #0073aa;
    color: #333;
}

/* Grid: 3 Columns (Desktop + Mobile) */
.topbar-categories-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
    gap: 15px;
    margin: 0;
    padding: 0;
}

.topbar-post-item {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.topbar-post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.topbar-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.topbar-post-thumbnail {
    width: 100%;
    height: 103px;
    overflow: hidden;
    position: relative;
    background: #e0e0e0;
}

.topbar-post-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: fit;
    transition: transform 0.4s ease;
}

.topbar-post-item:hover .topbar-post-thumbnail img {
    transform: scale(1.1);
}

.topbar-post-thumbnail.topbar-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 40px;
}

.topbar-post-content {
    padding: 12px;
}

.topbar-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

.topbar-post-link:hover .topbar-post-title {
    color: #0073aa;
}

.topbar-post-meta {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.topbar-post-date {
    display: inline-flex;
    align-items: center;
}

.topbar-post-date::before {
    content: '📅';
    margin-right: 4px;
    font-size: 10px;
}

.topbar-sidebar-notice {
    border-radius: 6px;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE: 3 POSTS PER ROW (ALL DEVICES)
   ============================================ */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    .topbar-post-thumbnail {
        height: 120px;
    }
    
    .topbar-post-title {
        font-size: 15px;
    }
}

/* Desktop (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .topbar-post-thumbnail {
        height: 103px;
    }
    
    .topbar-post-title {
        font-size: 14px;
    }
}

/* Tablet (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    
    .topbar-post-thumbnail {
        height: 103px;
    }
    
    .topbar-post-title {
        font-size: 13px;
        min-height: 38px;
    }
    
    .topbar-post-content {
        padding: 10px;
    }
}

/* Mobile (481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
        gap: 12px;
    }
    
    .topbar-post-thumbnail {
        height: 120px;
    }
    
    .topbar-post-title {
        font-size: 12px;
        min-height: 36px;
    }
    
    .topbar-post-content {
        padding: 8px;
    }
    
    .topbar-categories-widget {
        padding: 15px;
    }
    
    .topbar-post-meta {
        font-size: 10px;
    }
}

/* Small Mobile (320px to 480px) */
@media (max-width: 480px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
        gap: 10px;
    }
    
    .topbar-post-thumbnail {
        height: 120px;
    }
    
    .topbar-post-title {
        font-size: 11px;
        min-height: 32px;
        -webkit-line-clamp: 2;
    }
    
    .topbar-post-content {
        padding: 8px;
    }
    
    .topbar-categories-widget {
        padding: 12px;
        border-radius: 6px;
    }
    
    .topbar-categories-widget .widget-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .topbar-post-meta {
        font-size: 10px;
    }
    
    .topbar-post-date::before {
        content: '';
        margin-right: 0;
    }
}

/* Extra Small Mobile (below 320px) */
@media (max-width: 319px) {
    .topbar-categories-posts-grid {
        grid-template-columns: repeat(3, 1fr); /* Still 3 columns */
        gap: 8px;
    }
    
    .topbar-post-thumbnail {
        height: 90px;
    }
    
    .topbar-post-title {
        font-size: 10px;
        min-height: 30px;
    }
    
    .topbar-post-content {
        padding: 6px;
    }
}

@media print {
    .topbar-categories-widget {
        display: none;
    }
}


/* ============================================
   SINGLE POST: MOBILE SPECIFICATIONS BOX
   ============================================ */

.mobile-specifications-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.specs-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.spec-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.spec-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
    border-color: #0073aa;
}

.spec-item.spec-price {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    border: none;
    grid-column: span 2;
}

.spec-item.spec-price .spec-label,
.spec-item.spec-price .spec-value {
    color: #ffffff;
}

.spec-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.spec-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spec-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.spec-value {
    font-size: 16px;
    color: #333;
    font-weight: 700;
}

/* Responsive for Single Post Specs */
@media (max-width: 991px) {
    .specs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .spec-item.spec-price {
        grid-column: span 3;
    }
}

@media (max-width: 767px) {
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .spec-item.spec-price {
        grid-column: span 2;
    }
    
    .mobile-specifications-box {
        padding: 20px 15px;
    }
    
    .specs-title {
        font-size: 20px;
    }
    
    .spec-item {
        padding: 12px;
    }
    
    .spec-icon {
        font-size: 24px;
    }
    
    .spec-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .spec-item.spec-price {
        grid-column: span 1;
    }
    
    .spec-item {
        padding: 10px;
    }
}