/* Nút tìm kiếm tùy chỉnh */
.btn-search-custom {
    background-color: #C60D00;
    color: white;
    border: none;
    transition: background-color 0.3s;
    width: 100%;
    border-radius: 8px;
}

.btn-search-custom:hover {
    background-color: #E82D20;
    color: white;
}

.btn-search-custom:active {
    background-color: #A50B00;
    color: white;
}

/* Subcategory Slider Styles */
.subcategory-slider {
    position: relative;
    margin-bottom: 40px;
    clear: both;
    overflow: visible;
}

.subcategory-item {
    padding: 8px;
}

.subcategory-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    padding: 10px;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.subcategory-link:hover {
    background-color: #f8f9fa;
    border-color: #C60D00;
    color: #C60D00;
}

.subcategory-image {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 0.25rem;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

.subcategory-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.subcategory-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subcategory Grid Styles (cho màn hình lớn) */
.subcategory-grid {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 0;
    margin: 0 -5px;
}

/* Subcategory Scroll Styles (cho màn hình nhỏ) */
.subcategory-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    margin: 0 -5px;
    scrollbar-width: thin;
    scrollbar-color: #C60D00 #f0f0f0;
}

.subcategory-scroll::-webkit-scrollbar {
    height: 6px;
}

.subcategory-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.subcategory-scroll::-webkit-scrollbar-thumb {
    background-color: #C60D00;
    border-radius: 10px;
}

/* Horizontal List Group Style */
.subcategory-item {
    display: flex;
    padding: 0 5px;
    margin-bottom: 10px;
}

/* Grid mode - 6 items per row */
.subcategory-grid .subcategory-item {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

/* Scroll mode - fixed width items */
.subcategory-scroll .subcategory-item {
    flex: 0 0 auto;
    width: 250px;
    max-width: none;
}

.subcategory-link {
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    padding: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.subcategory-link:hover {
    background-color: #f8f9fa;
    border-color: #C60D00;
    color: #C60D00;
}

.subcategory-image {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 0.25rem;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

.subcategory-image i.fas {
    font-size: 24px;
    color: #C60D00;
}

/* Fix for overlapping issues */
.subcategory-slider {
    position: relative;
    z-index: 1;
    margin-bottom: 0px;
    overflow: hidden;
}

.products-view__list {
    position: relative;
    z-index: 1;
    clear: both;
}

/* Responsive grid for products */
@media (max-width: 767.98px) {
    .products-list__body {
        display: flex !important;
        flex-wrap: wrap !important;
        margin: 0 -5px;
    }

    .products-list__item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 0 5px;
        margin: 0 0 15px 0 !important;
        width: auto !important;
    }

    .product-card {
        margin-bottom: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .product-card__image {
        margin-bottom: 8px;
        height: auto;
    }

    .product-card__image img {
        max-width: 100%;
        height: auto;
    }

    .product-card__info {
        padding: 0 5px;
        flex-grow: 1;
    }

    .product-card__name {
        font-size: 12px;
        line-height: 1.3;
        height: 32px;
        overflow: hidden;
        margin-bottom: 4px;
    }

    .product-card__name a {
        font-size: 12px;
    }

    .product-card__prices {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .product-card__availability {
        display: none;
    }

    .product-card__buttons .btn {
        padding: 4px 8px;
        font-size: 12px;
        width: 100%;
    }
}

.clearfix {
    display: block;
    clear: both;
    height: 0;
    visibility: hidden;
    overflow: hidden;
}

/* Custom button styling for consistent look */
.btn-custom-action {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Responsive cart styling */
.cart-items {
    width: 100%;
}

.cart-header {
    background-color: #f8f9fa;
    font-weight: bold;
    padding: 10px 0;
    border-bottom: 2px solid #dee2e6;
}

.cart-item {
    transition: background-color 0.2s;
    border-bottom: 1px solid #dee2e6;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

.cart-total {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 15px 10px;
    margin-top: 15px;
    border: 1px solid #dee2e6;
}

@media (max-width: 767.98px) {
    .cart-items {
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
        overflow: hidden;
        background-color: white;
    }

    .cart-item {
        margin-bottom: 0;
        padding: 15px 10px;
        border-bottom: 1px solid #dee2e6;
        border-radius: 0;
        box-shadow: none;
        background-color: white;
    }

    .cart-item:nth-child(odd) {
        background-color: #f9f9f9;
    }

    .cart-item:last-child {
        border-bottom: none;
    }

    .cart-item > div {
        padding: 5px 10px;
        margin-bottom: 8px;
    }

    .cart-item .fw-bold {
        display: inline-block;
        width: 100px;
        color: #555;
        font-size: 0.9rem;
        background-color: #f0f0f0;
        padding: 3px 8px;
        border-radius: 4px;
        margin-right: 5px;
    }

    .cart-item .product-name {
        font-weight: 500;
        display: inline-block;
        margin-top: 5px;
    }

    .cart-total {
        margin-top: 0;
        border-top: 2px solid #dee2e6;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
        background-color: #f8f9fa;
        padding: 15px;
    }

    .btn-danger.btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        line-height: 1.5;
        border-radius: 0.2rem;
        margin-top: 5px;
    }
}

/* Additional fixes for overlapping */
.products-view__list {
    margin-top: 30px;
}

/* Post Card Styles */
.post-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* SEO Optimized Styles */
.brand-link {
    font-weight: bold;
    text-decoration: none;
}

.brand-link:hover {
    text-decoration: underline;
}

.product-description-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.price-amount {
    font-weight: bold;
    color: #e74c3c;
}

/* Accessibility improvements */
button[aria-label] {
    position: relative;
}

/* Loading optimization */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

/* Structured data elements - hidden from visual display */
meta[itemprop] {
    display: none;
}
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-card__image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    border-radius: 5px 5px 0 0;
}

.post-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card__image a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

.post-card__info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-card__date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #C60D00;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-width: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none;
  
}

.post-card__date-day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.post-card__date-month {
    font-size: 12px;
    line-height: 1;
}

.post-card__name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
    height: 45px;
    overflow: hidden;
}

.post-card__name a {
    color: #333;
    text-decoration: none;
}

.post-card__name a:hover {
    color: #C60D00;
}

.post-card__description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.post-card__read-more {
    margin-top: auto;
}

.block-posts .btn-danger {
    background-color: #C60D00;
    border-color: #C60D00;
    border-radius: 8px;
}

.block-posts .btn-danger:hover {
    background-color: #E82D20;
    border-color: #E82D20;
}


.block-posts {
    padding: 40px 0;
    background-color: #f9f9f9;
}

@media (max-width: 767.98px) {
    .post-card__name {
        font-size: 14px;
        height: 40px;
    }

    .post-card__description {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .post-card__info {
        padding: 10px;
    }
}

.subcategory-slider + .clearfix + .products-view__list {
    margin-top: 0;
}
