/* Custom CSS for the website */

/*
 * Màu sắc của trang web được định nghĩa trong file dynamic-colors.css
 * Các biến màu sắc có thể được cấu hình trong phần cài đặt màu sắc hệ thống
 */

/* General Styles */
body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Text color utility */
.text-pink {
    color: var(--primary-pink) !important;
}

/* Custom Button Styles */
.btn-pink {
    background-color: var(--primary-pink);
    border-color: var(--primary-pink);
    color: white;
}

.btn-pink:hover {
    background-color: var(--primary-pink-dark);
    border-color: var(--primary-pink-dark);
    color: white;
}

.btn-outline-pink {
    border-color: var(--primary-pink);
    color: var(--primary-pink);
}

.btn-outline-pink:hover {
    background-color: var(--primary-pink);
    color: white;
}

/* Section Title Styles */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: bold;
    color: var(--primary-pink);
}

.section-title::before,
.section-title::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    width: 50px;
}

.section-title::before {
    right: 100%;
    margin-right: 15px;
    background: linear-gradient(
        to left,
        var(--primary-pink),
        transparent
    ); /* Từ đậm đến nhạt */
}

.section-title::after {
    left: 100%;
    margin-left: 15px;
    background: linear-gradient(
        to right,
        var(--primary-pink),
        transparent
    ); /* Từ đậm đến nhạt */
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Image Hover Effects */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* Custom Navbar Styles */
.navbar-pink {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-pink .navbar-nav {
    gap: 10px; /* Add gap between nav items */
}

.navbar-pink .nav-spacing {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem; /* Consistent gap between menu items */
}

@media (max-width: 992px) {
    .navbar-pink .nav-spacing {
        justify-content: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }
}

.navbar-pink .nav-link {
    color: #333;
    font-weight: 600; /* Slightly bolder */
    font-size: 0.95rem; /* Slightly larger */
    padding: 0.5rem 0.75rem; /* Reduced horizontal padding */
    transition: color 0.3s ease, border-color 0.3s ease;
    border-bottom: 2px solid transparent;
    text-align: center; /* Center text */
    letter-spacing: 0.2px; /* Slightly increased letter spacing */
    white-space: nowrap; /* Prevent text wrapping */
}

.navbar-pink .nav-link:hover,
.navbar-pink .nav-link.active {
    color: var(--primary-pink);
    border-bottom: none; /* Remove border bottom */
}

.navbar-pink .nav-link::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-pink);
    transition: width 0.3s;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.navbar-pink .nav-link:hover::after {
    width: 70%;
}

.navbar-pink .nav-link.active::after {
    width: 80%;
    height: 2.5px;
}

.navbar-pink .nav-item {
    position: relative;
}

/* Footer Styles */
.footer {
    background-color: #f8f9fa;
    padding: 3rem 0;
}

.footer-title {
    color: var(--primary-pink);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-pink);
}

/* Social Media Icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #6c757d;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-pink);
    color: white;
}

/* Custom Carousel Styles */
/* Hide carousel controls completely */
.carousel-control-prev,
.carousel-control-next {
    display: none;
}

/* Carousel indicators */
.carousel-indicators {
    bottom: 15px;
    margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    margin: 0 6px;
    border: none;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background-color: var(--primary-pink);
    opacity: 1;
    transform: scale(1.2);
}

/* Make carousel swipeable */
.carousel {
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    background-color: #f8f9fa; /* Light background for when image doesn't fill container */
}

.carousel:active {
    cursor: grabbing;
}

/* Fixed aspect ratio container for carousel */
#heroCarousel {
    position: relative;
    width: 100%;
}

/* Create a fixed aspect ratio container (1920:800 = 2.4:1) */
#heroCarousel::before {
    content: "";
    display: block;
    padding-top: calc(
        100% / 2.4
    ); /* 41.67% - this maintains the 1920:800 aspect ratio */
}

#heroCarousel .carousel-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#heroCarousel .carousel-item {
    height: 100%;
    background-color: #f8f9fa;
}

.carousel img {
    pointer-events: none; /* Prevent image dragging */
    -webkit-user-drag: none;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from cover to contain to show full image */
    object-position: center; /* Center the image */
}

/* Improve carousel indicators and controls visibility */
.carousel-indicators {
    z-index: 15;
}

/* Carousel controls styling */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.7;
    z-index: 15;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    background-size: 50%;
}

@media (max-width: 768px) {
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Improve carousel caption positioning */
.carousel-caption {
    position: absolute;
    right: 15%;
    bottom: 20px;
    left: 15%;
    z-index: 10;
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: center;
}

/* Make carousel caption visible on all screen sizes */
@media (max-width: 767.98px) {
    .carousel-caption.d-none.d-md-block {
        display: block !important;
        padding: 10px;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

    .carousel-caption .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Product Card Styles */
.product-card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img-container {
    overflow: hidden;
    border-radius: 0.375rem 0.375rem 0 0;
    aspect-ratio: 4/3;
}

.product-img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

/* Product title styles moved to inline CSS in blade files */
.product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    max-height: 2.4em;
    overflow: hidden;
    position: relative;
    display: block;
}

.product-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Overlay effect for product cards */
.overlay-effect {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .overlay-effect {
    opacity: 1;
}

.overlay-effect .btn {
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.product-card:hover .overlay-effect .btn {
    transform: translateY(0);
    opacity: 1 !important;
}

/* News Card Styles */
.news-card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* News Container Layout */
.news-container {
    display: flex;
    gap: 1.5rem;
    height: 450px;
    margin-bottom: 2rem;
}

/* Featured Post Styles */
.featured-post {
    flex: 0 0 50%;
    max-width: 50%;
    height: 100%;
}

.featured-post-card {
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background-color: white;
}

.featured-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.featured-post-img {
    height: 100%;
    position: relative;
}

.featured-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.featured-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9),
        rgba(0, 0, 0, 0.5) 50%,
        transparent
    );
}

.featured-post-content {
    color: white;
}

.featured-post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.featured-post-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-pink);
    color: white;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.featured-post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(var(--primary-color-rgb), 0.5);
    color: white;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.featured-post-category:hover {
    background-color: rgba(var(--primary-color-rgb), 0.7);
    color: white;
}

.featured-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.featured-post-date {
    font-size: 0.875rem;
    opacity: 0.8;
}

.featured-post-read-more {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: rgba(var(--primary-color-rgb), 0.3);
    color: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.featured-post-card:hover .featured-post-read-more {
    background-color: rgba(var(--primary-color-rgb), 0.5);
}

/* Small Posts Styles */
.small-posts {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0.75rem;
}

.small-post {
    flex: 0 0 calc((100% - 1.5rem) / 3); /* Fixed height - exactly 1/3 of container minus gaps */
    min-height: 130px; /* Minimum height for each small post */
    position: relative;
    display: flex;
    margin: 0;
}

.small-post-card {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease,
        background-color 0.3s ease;
    cursor: pointer;
    align-items: stretch;
}

.small-post-card:hover {
    background-color: #fffafa;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.small-post-img {
    width: auto;
    height: 100%;
    aspect-ratio: 1/1;
    min-width: 0;
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
    border-radius: 0.5rem 0 0 0.5rem;
}

.small-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.small-post-card:hover .small-post-img img {
    transform: scale(1.1);
}

.small-post-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.small-post-categories {
    margin-bottom: 0.5rem;
}

.small-post-category {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-pink);
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.small-post-category:hover {
    background-color: rgba(var(--primary-color-rgb), 0.2);
}

.small-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.small-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.75rem;
}

.small-post-date {
    color: #6c757d;
}

.small-post-read-more {
    color: var(--primary-pink);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.small-post-read-more:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

/* Product Card Styles */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay .btn {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.product-card:hover .product-overlay .btn {
    transform: translateY(0);
}

.product-attribute {
    font-size: 0.75rem;
    color: var(--primary-pink);
    font-weight: 500;
}

.product-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.product-card:hover .product-title {
    color: var(--primary-pink);
}

.product-price {
    font-weight: 700;
    color: var(--accent-color);
}

/* Ẩn mũi tên trong card sản phẩm */
.product-arrow {
    display: none;
}

.btn-pink {
    background-color: var(--primary-pink);
    color: white;
    border: none;
}

.btn-pink:hover {
    background-color: var(--primary-color-dark);
    color: white;
}

.bg-pink {
    background-color: var(--primary-pink);
}

/* Post Card Styles */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.post-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-img {
    transform: scale(1.1);
}

.post-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-overlay {
    opacity: 1;
}

.post-category {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-pink);
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.post-category:hover {
    background-color: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-pink);
    text-decoration: none;
}

.post-category-active {
    background-color: var(--primary-pink);
    color: white;
}

.post-category-active:hover {
    background-color: var(--primary-color-dark);
    color: white;
}

.post-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: var(--primary-pink);
    color: white;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.post-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.post-title-link {
    text-decoration: none;
    color: inherit;
}

.post-card:hover .post-title {
    color: var(--primary-pink);
}

.post-excerpt {
    font-size: 0.875rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-date,
.post-views {
    font-size: 0.75rem;
    color: #888;
}

.post-read-more {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-pink);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-read-more {
    opacity: 1;
}

.card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.post-category,
.post-title-link,
.post-read-more,
.post-img-link,
.featured-post-category,
.small-post-category {
    position: relative;
    z-index: 2;
}

/* Make sure the card is positioned relatively for absolute positioning of card-link */
.featured-post-card,
.small-post-card {
    position: relative;
    cursor: pointer;
}

/* Responsive adjustments for posts */
@media (max-width: 767px) {
    .post-img-container {
        aspect-ratio: 3/2;
    }

    .post-title {
        font-size: 0.9rem;
    }

    .post-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .post-date,
    .post-views {
        font-size: 0.7rem;
    }
}

/* Responsive adjustments for products */
@media (max-width: 767px) {
    .product-img-container {
        aspect-ratio: 3/2;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }
}

/* Responsive adjustments for news */
@media (max-width: 992px) {
    .news-container {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .featured-post,
    .small-posts {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .featured-post {
        height: 300px;
        margin-bottom: 1rem;
    }

    .small-post {
        flex: 0 0 120px;
        height: 120px;
        margin-bottom: 0.5rem;
        display: flex;
    }

    .small-post-card {
        align-items: center;
    }

    .small-post-img {
        width: 120px;
        min-width: 120px;
        height: 120px;
        aspect-ratio: 1/1;
        flex: 0 0 auto;
    }

    .small-post-content {
        flex: 1;
        padding: 0.75rem;
        overflow: hidden;
    }

    .small-post-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.3rem;
    }

    .small-post-meta {
        margin-top: auto;
    }
}

@media (max-width: 576px) {
    .featured-post {
        height: 250px;
    }

    .featured-post-overlay {
        padding: 1rem;
    }

    .featured-post-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .small-post {
        flex: 0 0 100px;
        height: 100px;
        display: flex;
    }

    .small-post-card {
        align-items: center;
    }

    .small-post-img {
        width: 100px;
        min-width: 100px;
        height: 100px;
        aspect-ratio: 1/1;
        flex: 0 0 auto;
    }

    .small-post-content {
        flex: 1;
        padding: 0.5rem;
        overflow: hidden;
    }

    .small-post-title {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .small-post-meta {
        font-size: 0.7rem;
        margin-top: auto;
        display: flex;
        justify-content: space-between;
    }

    .small-post-read-more {
        display: none;
    }
}

/* Breadcrumb Styles */
.custom-breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.custom-breadcrumb .breadcrumb-item.active {
    color: var(--primary-pink);
}

/* Cursor pointer for all clickable elements */
.cursor-pointer {
    cursor: pointer;
}

/* Mobile Menu Styles */
.offcanvas {
    width: 80% !important;
    max-width: 300px;
}

@media (min-width: 768px) {
    .offcanvas {
        width: 25% !important;
    }
}

/* Back to Top Button */
#back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-title::before,
    .section-title::after {
        width: 30px;
    }

    .product-img-container {
        height: auto;
    }

    .product-title {
        font-size: 0.8rem;
        height: 2.4rem;
    }

    .product-price {
        font-size: 0.9rem;
    }
}
