/* ========================================================================
   CUSTOM CSS - MARKETBOB THEME MODIFICATIONS
   ======================================================================== */

/* ------------------------------------------------------------------------
   Navigation Bar - Text Color Override
   ------------------------------------------------------------------------ */
/* Main navigation links - dark text color */
.nav-bar .link {
    color: #2d3436 !important;
}

/* Hover state - primary brand color */
.nav-bar .link:hover {
    color: var(--primary_color) !important;
}

/* ------------------------------------------------------------------------
   Cart Button - Style Match with Login Button
   ------------------------------------------------------------------------ */
/* Cart button outline style with primary color border */
.cart-btn .btn-outline-light {
    border-color: var(--primary_color);
    color: var(--primary_color);
    background-color: transparent;
}

/* Cart button hover/focus/active states */
.cart-btn .btn-outline-light:active,
.cart-btn .btn-outline-light:focus,
.cart-btn .btn-outline-light:hover {
    background-color: var(--primary_color);
    border-color: var(--primary_color);
    color: #fff;
}

/* ------------------------------------------------------------------------
   Desktop Mode - Navigation Dropdown (≥992px)
   ------------------------------------------------------------------------ */
@media (min-width: 992px) {
    /* Dropdown button white text on desktop */
    .nav-bar.nav-bar-sm .drop-down .drop-down-btn {
        color: #ffffff !important;
        transition: transform 0.2s ease;
    }

    /* Lift effect on hover */
    .nav-bar.nav-bar-sm .drop-down .drop-down-btn:hover {
        color: #ffffff !important;
        transform: translateY(-2px);
        transition: transform 0.2s ease;
    }
}

/* ------------------------------------------------------------------------
   Mobile/Tablet Mode - Navigation Dropdown (<992px)
   ------------------------------------------------------------------------ */
@media (max-width: 991px) {
    /* Dropdown button muted text on mobile */
    .nav-bar.nav-bar-sm .drop-down .drop-down-btn {
        color: var(--text_muted);
        transition: color 0.2s ease;
    }

    /* Primary color on hover for mobile */
    .nav-bar.nav-bar-sm .drop-down .drop-down-btn:hover {
        color: var(--primary_color);
        transition: color 0.2s ease;
    }
}

/* ------------------------------------------------------------------------
   Search Form Reverse - Placeholder & Icon Color
   ------------------------------------------------------------------------ */
/* Dark placeholder text */
.form-search.form-search-reverse .form-control::placeholder {
    color: #2d3436 !important;
}

/* Dark icon and button color */
.form-search.form-search-reverse button,
.form-search.form-search-reverse .icon {
    color: #2d3436 !important;
}

/* ------------------------------------------------------------------------
   Secondary Navigation Bar - Reduced Height
   ------------------------------------------------------------------------ */
/* Compact nav bar height */
.nav-bar.nav-bar-sm .nav-bar-container {
    height: 48px !important;
}

/* Search input height adjustment */
.form-search.form-search-reverse .form-control {
    height: 39px !important;
    border: 1px solid var(--primary_color) !important;
}

/* Search input focus state with primary color */
.form-search.form-search-reverse .form-control:focus {
    border-color: var(--primary_color) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 116, 190, 0.15) !important;
}

/* ------------------------------------------------------------------------
   Navigation Dropdown - Default Text Color
   ------------------------------------------------------------------------ */
/* Dropdown button dark text */
.nav-bar .drop-down .drop-down-btn {
    color: #2d3436 !important;
}

/* Maintain dark text on hover */
.nav-bar .drop-down .drop-down-btn:hover {
    color: #2d3436 !important;
}

/* ------------------------------------------------------------------------
   Screenshot Swiper Thumbnails - 4:3 Aspect Ratio
   ------------------------------------------------------------------------ */
/* Thumbnail container with fixed dimensions */
.itemSwiper .swiper-slide {
    position: relative;
    width: 104px !important;
    height: 78px !important;
    overflow: hidden;
    border-radius: 8px;
}

/* Absolute positioning for image wrapper */
.itemSwiper .swiper-slide .item-slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Cover image with centered crop */
.itemSwiper .swiper-slide .item-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

/* ------------------------------------------------------------------------
   Item Card Images - Tỉ lệ 4:3 cố định cho tất cả các trang
   (Category, Search, Browse, Archive, Tag, etc.)
   ------------------------------------------------------------------------ */

/* Container cho hình ảnh - Tạo tỉ lệ 4:3 */
.item .item-header {
    position: relative !important;
    width: 100% !important;
    padding: 8px !important;
}

/* Link wrapper bên trong item-header - Tỉ lệ 4:3 */
.item .item-header > a {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 75% !important; /* 4:3 ratio */
    overflow: hidden !important;
    border-radius: 8px !important;
}

/* Image thực tế - Absolute position */
.item .item-header > a > img.item-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Video container wrapper - Tỉ lệ 4:3 */
.item .item-header > a:has(.item-video),
.item .item-header > .item-video {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 75% !important; /* 4:3 ratio */
    overflow: hidden !important;
}

/* Video element - Tỉ lệ 4:3 */
.item .item-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.item .item-video video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
}

/* Audio container - Tỉ lệ 4:3 */
.item .item-audio {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 75% !important; /* 4:3 ratio */
    overflow: hidden !important;
    border-bottom: 1px solid var(--border_color) !important;
}

.item .item-audio .item-audio-wave {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100% - 40px) !important;
}

/* ------------------------------------------------------------------------
   Item Badge - Ẩn badge Free và Premium
   ------------------------------------------------------------------------ */
/* Ẩn badge Free */
.item-badge.item-badge-free {
    display: none !important;
}

/* Ẩn badge Premium */
.item-badge.item-badge-premium {
    display: none !important;
}

/* ------------------------------------------------------------------------
   Navigation Menu Button - Color Adjustments
   ------------------------------------------------------------------------ */
/* Menu button primary color on main nav */
.nav-bar .nav-bar-menu-btn {
    color: var(--primary_color);
}

/* Menu button muted color on secondary nav */
.nav-bar.nav-bar-sm .nav-bar-menu-btn {
    color: var(--text_muted);
}

/* ------------------------------------------------------------------------
   Fancybox Lightbox - Background cho hình ảnh trong suốt
   ------------------------------------------------------------------------ */
.fancybox-image,
.fancybox-spaceball {
    background-color: #F8FAFC !important;
}

/* ------------------------------------------------------------------------
   Header Inner - Giảm padding trên/dưới
   ------------------------------------------------------------------------ */
.header-inner {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}


/* ------------------------------------------------------------------------
   Icon Display Fix - Ensure FontAwesome icons display correctly
   ------------------------------------------------------------------------ */
.btn .fa-solid,
.btn .fas,
.btn .fa {
    display: inline-block !important; /* Force display for icons inside buttons */
}

/* ------------------------------------------------------------------------

/* ------------------------------------------------------------------------
   Preview Page - Ad Block Layout
   ------------------------------------------------------------------------ */
.preview-body {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px); /* Total height minus the top nav bar */
    background-color: #f0f2f5; /* A light background color for the ad areas */
}

.preview-ad-container {
    flex-shrink: 0; /* Prevent ad containers from shrinking */
    text-align: center;
    padding: 10px 0;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-ad-container.preview-ad-top {
    border-bottom: 1px solid #ddd;
}

.preview-ad-container.preview-ad-bottom {
    border-top: 1px solid #ddd;
}

.iframe-container {
    flex-grow: 1; /* Allow the iframe container to take up all available space */
    overflow: hidden; /* Hide any potential overflow */
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================================================
   END OF CUSTOM CSS
   ======================================================================== */