/* Custom CSS for Wooden Flooring Website */

:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #FF6B35;
    --dark-color: #2C1810;
    --light-color: #F5F5DC;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-500: #6C757D;
    --gray-900: #212529;
    --bs-secondary-text-emphasis: #6bd4a2;
    --brand-brown: #4a2e19;
    --brand-orange: #e07a5f;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Typography */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    margin-bottom: 0;
}

.brown-page {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
}

.navbar {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Mega Menu Styles */
.navbar .dropdown-mega-container {
    position: static;
}

.navbar .dropdown-menu-mega {
    width: 100%;
    left: 0;
    right: 0;
    padding: 2rem;
    background-color: #ffffff;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15);
    max-height: 90vh;
    overflow-y: auto;
}

/* Dropdown dạng cột đơn */
.dropdown-menu-column {
    min-width: 240px;
    padding: 0.5rem 0;
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Reset ul */
.dropdown-menu-column ul {
    margin: 0;
    padding: 0;
}

/* Item */
.dropdown-menu-column li {
    list-style: none;
}

/* Link */
.dropdown-menu-column .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    color: #495057;
    transition: all 0.2s ease;
}

/* Dấu chấm phía trước */
.dropdown-menu-column .dropdown-item::before {
    content: "•";
    margin-right: 0.6rem;
    font-size: 1rem;
    color: #495057;
}

/* Hover */
.dropdown-menu-column .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--secondary-color);
}

.dropdown-menu-column li + li .dropdown-item {
    position: relative;
}

.dropdown-menu-column li + li .dropdown-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    border-top: 1px solid #dee2e6;
}


/* Active (đang ở category đó) */
.dropdown-menu-column .dropdown-item.active {
    font-weight: 500;
    color: var(--secondary-color);
    background-color: rgba(13, 110, 253, 0.08);
}


/* ====== HOVER DROPDOWN - DESKTOP ONLY ====== */
@media (min-width: 992px) {
    .dropdown-mega-container:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        margin-top: 0;
    }

    .dropdown-mega-container .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        margin-top: 10px;
    }

    /* Disable caret click behavior on desktop */
    .dropdown-mega-container > .dropdown-toggle::after {
        margin-left: 6px;
    }
}


@media screen and (max-width: 992px) {
    .navbar .dropdown-menu-mega {
        max-height: 65vh;
    }
}

.navbar .mega-menu-col .group {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #212529;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--secondary-color);
}

.navbar .mega-menu-col .list-unstyled {
    margin: 0;
    padding: 0;
}

.navbar .mega-menu-col .list-unstyled a {
    display: block;
    text-decoration: none;
    color: #495057;
    padding: 0.3rem 0 0.3rem 1rem;
    font-size: 0.9rem;
    background-color: transparent !important;
    position: relative;
}

.navbar .mega-menu-col .list-unstyled a::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #495057;
    font-size: 1rem;
}

.navbar .mega-menu-col .list-unstyled a:hover {
    color: var(--secondary-color);
}

/* Bootstrap Color Overrides */
.text-primary {
    color: var(--primary-color) !important;
}

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

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    transform: translateY(-2px);
}

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

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

.text-accent {
    color: var(--accent-color);
}

/* Navigation */
.navbar {
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.25rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Multi-level Dropdown */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Review Cards */
.review-card {
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.review-avatar {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.review-stars {
    font-size: 0.9rem;
}

.review-stars i {
    margin-right: 2px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
    padding: 44px 0;
}

.hero-description {
    font-family: 'Playfair Display', 'Montserrat', serif;
    font-weight: 600;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.bg-main-gradient {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15) !important;
}

.product-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.product-card .name {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    display: block;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

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

/* Responsive for only Ipad mini */
@media (width: 768px) and (height: 1024px) {
    .ipad-center {
        justify-content: center !important;
        text-align: center !important;
    }
}

@media (max-width: 576px) {
    .product-image-wrapper {
        aspect-ratio: 1 / 1; /* ảnh vuông */
        width: 100%;
    }

    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-card {
        font-size: 14px;
        min-height: unset;
    }

    .product-card .card-body {
        padding: 0.5rem;
    }

    .product-card .card-title {
        font-size: 14px;
        line-height: 1.2;
        max-height: 2.4em;
        overflow: hidden;
    }

    .product-card .card-text {
        font-size: 13px;
        margin-bottom: 0;
    }

    .product-overlay a {
        font-size: 12px;
        padding: 6px 10px;
    }
}


/* Category Cards */
.category-card {
    height: 300px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: scale(1.02);
}

.category-card img {
    transition: all 0.3s ease;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6), rgba(139, 69, 19, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

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

.banner-post {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.sub-banner-post {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: -12px;
}

/* Contact Form */
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
}

.form-control {
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--bs-secondary-text-emphasis);
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

.contact-info {
    background: var(--gray-100);
    padding: 2rem;
    border-radius: 1rem;
    height: 100%;
}

.contact-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.contact-item:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    background: var(--dark-color) !important;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-200);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 0.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

.footer-certifications .badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }

    .hero-section .row {
        flex-direction: column-reverse;
    }

    .category-card {
        height: 250px;
    }

    .contact-info {
        margin-top: 2rem;
    }

    .dropdown-submenu .dropdown-menu {
        position: static !important;
        left: auto !important;
        box-shadow: none;
        border: none;
        background: var(--gray-100);
        margin-left: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Utilities */
.object-fit-cover {
    object-fit: cover;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Hover Effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.card {
    transition: all 0.3s ease;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

.product-card:hover {
    transform: translateY(-10px);
}

.rating-form .star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.25rem;
}

.rating-form .star-rating input[type="radio"] {
    display: none;
}

.rating-form .star-rating label {
    cursor: pointer;
    color: #6b7280;
    /* stone-500 for empty star */
    transition: color 0.2s ease-in-out;
}

.rating-form .star-rating svg {
    width: 2.5rem;
    height: 2.5rem;
}

.rating-form .star-rating label:hover,
.rating-form .star-rating label:hover~label {
    color: #ffc107;
    /* Bootstrap warning color */
}

.rating-form .star-rating input[type="radio"]:checked~label {
    color: #ffc107;
    /* Bootstrap warning color */
}

.sidebar {
    background-color: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

.pagination {
    --bs-pagination-focus-box-shadow: none;
    /* Disable default Bootstrap focus shadow */
}

.pagination .page-item {
    margin: 0 0.3rem;
}

.pagination .page-link {
    border: none;
    border-radius: 50% !important;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
    color: var(--gray-500);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: var(--gray-900);
}

.pagination .page-item.active .page-link {
    background-color: var(--secondary-color);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    transform: translateY(-1px);
}

.pagination .page-item.disabled .page-link {
    background-color: var(--gray-200);
    color: #adb5bd;
    box-shadow: none;
    pointer-events: none;
}

.search-container .dropdown-toggle::after {
    display: none;
}

.search-input {
    border: 1px solid #6c757d;
    background-color: #fff !important;
    padding-left: 2.5rem !important;
    color: var(--secondary-color) !important;
}

.search-input::placeholder {
    color: #adb5bd;
}

.search-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.25rem rgba(224, 122, 95, 0.5);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: #adb5bd;
}

.search-results {
    width: 100%;
    background-color: #fff;
    color: #212529;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15);
    max-height: 300px;
    overflow-y: auto;
}

.search-results .dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.search-results .dropdown-item:last-child {
    border-bottom: none;
}

.search-results .dropdown-item:hover {
    background-color: #f8f9fa;
}

.search-result-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.search-result-name {
    font-weight: 500;
    color: #343a40;
}

.search-result-type {
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    font-style: italic;
}

.search-result-type.product {
    background-color: #cfe2ff;
    color: #0a58ca;
}

.search-result-type.category {
    background-color: #d1e7dd;
    color: #146c43;
}

.search-result-arrow {
    margin-left: auto;
    color: #6c757d;
}

.btn-brand-gold {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-brand-gold:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-outline-light:hover {
    color: var(--brand-brown);
}

.cursor-pointer {
    cursor: pointer;
}

.contact .contact-widget {
    position: relative;   
}

.contact .contact-options {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.contact .contact-options .option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.contact .contact-options .option:hover {
    background-color: #f0f0f0;
    border-radius: 6px;
}

.contact .contact-options img {
    width: 44px;
    height: 44px;
    animation: shake 1s ease-in-out infinite;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

/* Thêm độ trễ ngẫu nhiên cho từng icon */
.contact .contact-options .contact-widget:nth-child(1) img {
    animation-delay: 0s;
}

.contact .contact-options .contact-widget:nth-child(2) img {
    animation-delay: 0.5s;
}

.contact .contact-options .contact-widget:nth-child(3) img {
    animation-delay: 1s;
}

input.error, textarea.error {
	background: url('/images/unchecked.gif') no-repeat right 12px center;
    border: 1px solid red;
    padding-right: 36px;
}

input.valid, textarea.valid {
	background: url('/images/checked.gif') no-repeat right 12px center;
    padding-right: 36px;
}

label.error {
    color: red;
    font-size: 13px;
}

.loader {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: rgba(0 0 0 / 0.3);
}

.loader .dotted-loader {
    width: 100px;
    height: 100px;
    border-width: 4px;
    border-color: #0075ff;
    border-style: solid solid dotted dotted;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -50px;
    margin-left: -50px;
    animation: rotate-right 2s linear infinite;
    z-index: 100;
}

.loader.show {
    display: block;
}

.dotted-loader::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border-width: 4px;
    border-color: #009688;
    border-style: solid dotted solid dotted;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: rotate-left 1s linear infinite;
}

@keyframes rotate-right {
    from {
        transform: rotate(0);
    }
    
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-left {
    from {
        transform: rotate(0);
    }
    
    to {
        transform: rotate(-360deg);
    }
}

#banner {
  height: 334px;
}

#banner .owl-stage-outer, #aboutUs .owl-stage-outer,
#banner .owl-stage, #aboutUs .owl-stage,
#banner .owl-item, #aboutUs .owl-item {
  height: 100%;
  border-radius: 16px;
}

#banner img, #aboutUs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.about-content .text-description:last-child {
    margin-bottom: 0;
}

.product-discount {
    position: absolute;
    color: red;
    top: 5px;
    left: 10px;
    font-weight: bold;
    font-style: italic;
    font-size: 16px;
    background: white;
    padding: 2px 16px;
    border-radius: 12px;
    box-shadow: 0px 0px 20px 5px black;
}

.hide-price {
    font-size: 13px;
    font-style: italic;
    text-decoration: line-through;
    color: red;
    opacity: 75%;
}

.related_list .title {
    font-size: 16px;
}

.related_list .product-discount {
    font-size: 12px;
    padding: 0 12px;
}

.related_list .product-card .card-img-top {
    height: 100px;
}

.related_list .product-card {
    border-radius: 4px;
}

.related_list .card-body {
    padding: 4px 8px;
}

.related_list .card-img-top {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.related_list .product-card .name {
    font-size: 13px;
    margin-bottom: 4px;
    color: #0a58ca;
}

.related_list .product-card .name:hover {
    color: green;
}

.related_list .product-card .hide-price {
    font-size: 11px;
}

.related_list .product-card .show-price {
    font-size: 13px;
}

.design-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.design-card:hover {
    transform: translateY(-5px);
}

.design-image-wrapper {
    height: 280px;
    overflow: hidden;
}

.design-image {
    height: 100%;
    transition: transform 0.3s ease;
}

.design-card:hover .design-image {
    transform: scale(1.1);
}

.design-overlay {
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.design-hover-effect {
    background: rgba(0,123,255,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.design-card:hover .design-hover-effect {
    opacity: 1;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.design-content {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.design-card:hover .design-content {
    transform: translateY(0);
}

.article-card {
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
}

.article-card:hover .article-image {
    transform: scale(1.1);
}

.article-card:hover .article-overlay {
    opacity: 1 !important;
}

.hover-primary:hover {
    color: var(--bs-primary) !important;
    transition: color 0.3s ease;
}

.article-image-wrapper {
    border-radius: 0.5rem 0.5rem 0 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.banner-post {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 992px) {
    .article-image-wrapper {
        aspect-ratio: 1 / 1;
    }
}

.article-date .badge {
    font-size: 0.75rem;
    font-weight: 600;
}
