/*
 * Custom CSS for HanbokLina Theme
 */

.site-logo .custom-logo-link img {
    max-height: 70px;
    width: auto;
}

/* Marquee Animation */
.js-marquee-wrapper {
    display: flex;
    white-space: nowrap;
}

.marquee-track {
    display: inline-block;
    padding-right: 0;
    /* Adjust time if you want faster/slower scroll */
    animation: marquee-scroll 45s linear infinite;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* =========================================
   WOOCOMMERCE SINGLE PRODUCT
========================================= */

/* --- 1. Product Gallery Swiper --- */
/* Tránh gallery tràn màn hình: grid column cần thu nhỏ được */
.product-gallery-wrapper {
    min-width: 0;
    overflow: hidden;
}

.product-gallery-swiper-wrapper {
    opacity: 1 !important;
    align-items: flex-start;
    max-width: 100%;
    min-width: 0;
}

.product-gallery-swiper-wrapper .product-gallery-swiper {
    min-width: 0;
    max-width: 100%;
}

.product-gallery-swiper-wrapper .product-gallery-main {
    width: 100%;
    max-width: 100%;
}

.product-gallery-swiper-wrapper .product-gallery-main .swiper-wrapper {
    box-sizing: border-box;
}

.product-gallery-swiper-wrapper .product-gallery-main .swiper-slide {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-gallery-swiper-wrapper .product-gallery-main .swiper-slide .woocommerce-product-gallery__image {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.product-gallery-swiper-wrapper .product-gallery-main .swiper-slide .woocommerce-product-gallery__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
}

@media (max-width: 991px) {
    .product-gallery-swiper-wrapper {
        flex-direction: column;
    }

    .product-gallery-swiper-wrapper .product-gallery-thumbs {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        margin-right: 0;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .product-gallery-swiper-wrapper .product-gallery-thumbs .product-gallery-thumb {
        flex-shrink: 0;
    }
}

/* --- 2. Product Summary Area --- */
.product-info-wrapper .summary {
    padding-left: 0;
}

.product-info-wrapper h1.product_title {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: #000;
}

.product-info-wrapper .price {
    font-size: 16px !important;
    font-weight: normal;
    color: #000 !important;
    margin-bottom: 32px;
}

.product-info-wrapper .price ins {
    text-decoration: none;
    font-weight: normal !important;
}

/* Variations Form */
.product-info-wrapper form.cart {
    margin-top: 0;
}

.product-info-wrapper table.variations {
    width: 100%;
    margin-bottom: 24px;
    border: none;
}

.product-info-wrapper table.variations tbody tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.product-info-wrapper table.variations .label {
    padding: 0;
    border: none;
    font-weight: normal;
    font-size: 16px;
    text-transform: uppercase;
    color: #000;
    line-height: normal !important;
}

.product-info-wrapper table.variations .value {
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.woo-variation-swatches .variable-items-wrapper {
    gap: 24px !important;
}

.woo-variation-swatches .variable-items-wrapper .variable-item {
    margin: 0 !important;
}

.product-info-wrapper table.variations .value select {
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
}

.product-info-wrapper table.variations .reset_variations {
    margin-left: 8px;
    font-size: 13px;
    color: #666;
    text-decoration: underline;
}

.product-info-wrapper table.variations .reset_variations:hover {
    color: #000;
}

/* Add To Cart Button Area */
.woocommerce-variation-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

.woocommerce-variation-add-to-cart .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    width: 120px;
    height: 48px;
}

.woocommerce-variation-add-to-cart .quantity input[type="number"] {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.woocommerce-variation-add-to-cart .quantity .plus,
.woocommerce-variation-add-to-cart .quantity .minus {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    color: #666;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: none;
    outline: none;
    font-size: 18px;
}

.woocommerce-variation-add-to-cart .quantity .plus:hover,
.woocommerce-variation-add-to-cart .quantity .minus:hover {
    background-color: #e5e7eb;
    color: #000;
}

.quantity input::-webkit-outer-spin-button,
.quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woocommerce-variation-add-to-cart .single_add_to_cart_button {
    background-color: #000 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    width: 100% !important;
    max-width: 300px;
    height: 48px !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px !important;
    margin-top: 16px;
}

.woocommerce-variation-add-to-cart .single_add_to_cart_button:hover {
    background-color: #333 !important;
}

/* Hide variation price duplicated at bottom by default WC */
.woocommerce-variation-price {
    display: none !important;
}

/* --- Single product: Đặt thuê button (reuse add-to-cart style) --- */
.product-info-wrapper .js-dat-thue-btn,
.woocommerce-variation-add-to-cart .js-dat-thue-btn {
    background-color: #000 !important;
    color: #fff !important;
    border: none;
    cursor: pointer;
}

/* --- Single product: Tabs smooth transition --- */
.wc-tabs-wrapper .woocommerce-Tabs-panel {
    transition: opacity 0.25s ease;
}

/* --- Single product: Tabs styling --- */
.woocommerce-tabs.wc-tabs-wrapper .tabs.wc-tabs li a {
    color: #6b7280 !important;
    /* text-gray-500 */
    transition: color 0.3s ease, border-color 0.3s ease;
}

.woocommerce-tabs.wc-tabs-wrapper .tabs.wc-tabs li a:hover {
    color: #000 !important;
}

.woocommerce-tabs.wc-tabs-wrapper .tabs.wc-tabs li.active a {
    color: #000 !important;
    border-color: #000 !important;
    cursor: default;
}


/* --------------------------------------------------------------------------
   GLOBAL POST/PAGE CONTENT STYLES (.entry-content)
   -------------------------------------------------------------------------- */
:where(.entry-content) {
    font-size: 16px;
}

:where(.entry-content) h1,
:where(.entry-content) h2,
:where(.entry-content) h3,
:where(.entry-content) h4,
:where(.entry-content) h5,
:where(.entry-content) h6 {
    font-weight: 700;
    margin-bottom: 10px;
}

:where(.entry-content) h1 {
    font-size: 22px;
}

:where(.entry-content) h2 {
    font-size: 20px;
}

:where(.entry-content) h3 {
    font-size: 18px;
}

:where(.entry-content) h4,
:where(.entry-content) h5,
:where(.entry-content) h6 {
    font-size: 16px;
}

:where(.entry-content) p {
    margin-bottom: 12px;
}

:where(.entry-content) ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-bottom: 12px;
}

:where(.entry-content) ol {
    list-style-type: decimal;
    padding-left: 2rem;
    margin-bottom: 12px;
}

:where(.entry-content) li {
    display: list-item;
}

:where(.entry-content) ul ul,
:where(.entry-content) ol ul {
    list-style-type: circle;
    margin-bottom: 0;
}

:where(.entry-content) ul ul ul,
:where(.entry-content) ol ul ul {
    list-style-type: square;
}

:where(.entry-content) ol ol,
:where(.entry-content) ul ol {
    list-style-type: lower-alpha;
    margin-bottom: 0;
}

/* --- Global: Custom Pagination --- */
.hanboklina-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.hanboklina-pagination .page-numbers.current {
    background-color: #000;
    color: #fff;
    font-weight: 700;
}

.hanboklina-pagination .page-numbers:not(.current):not(.dots):hover {
    color: #000;
}

.hanboklina-pagination .next.page-numbers i {
    color: #226688;
    /* Matches the requested arrow color */
}


.wc-tabs-wrapper .woocommerce-Tabs-panel.tab-panel-active {
    opacity: 1;
    max-height: none;
    position: relative;
    visibility: visible;
}

.wc-tabs-wrapper {
    position: relative;
    min-height: 120px;
}

/* --- Single product: Modal Đặt thuê (Removed as it is now a direct link) --- */

/* --- Package: Booking Popup & CF7 Styling --- */
#booking-modal .booking-modal-content {
    border-radius: 8px;
}

.wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpcf7-form p {
    margin-bottom: 0;
}

.wpcf7-form label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #000;
}

.wpcf7-form-control-wrap {
    display: block;
}

.wpcf7-form-control {
    width: 100% !important;
    padding: 8px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    color: #374151 !important;
    background-color: #fff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.wpcf7-form-control:focus {
    border-color: #000 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05) !important;
}

.wpcf7-submit {
    background-color: #000 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 14px 40px !important;
    border-radius: 0 !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
    margin-top: 10px !important;
}

.wpcf7-submit:hover {
    background-color: #333 !important;
    transform: translateY(-2px);
}

.wpcf7-spinner {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.wpcf7-response-output {
    margin: 20px 0 0 0 !important;
    padding: 12px 16px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    text-align: center !important;
    border-width: 1px !important;
}

.wpcf7-mail-sent-ok {
    border-color: #10b981 !important;
    color: #047857 !important;
    background-color: #ecfdf5 !important;
}

.wpcf7-validation-errors {
    border-color: #ef4444 !important;
    color: #991b1b !important;
    background-color: #fef2f2 !important;
}

/* Double column for some fields if needed */
.booking-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .booking-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Responsive Header Refinements --- */
@media (max-width: 991px) {
    .site-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .site-logo img {
        height: 28px !important;
        width: auto;
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom)); /* Height of the bottom bar + Safe area */
    }

    #mobile-bottom-nav {
        @apply bg-white/90 backdrop-blur-md !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        height: auto !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }

    #mobile-bottom-nav > div {
        height: 60px !important; /* Slightly taller for premium feel */
        @apply flex items-stretch;
    }

    #mobile-bottom-nav a, 
    #mobile-bottom-nav button {
        @apply flex-1 flex flex-col items-center justify-center gap-1.5 !important;
    }
}

/* --- Back to Top Button --- */
#back-to-top {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Position exactly above the bottom bar on mobile */
@media (max-width: 991px) {
    #back-to-top {
        bottom: calc(76px + env(safe-area-inset-bottom)) !important; /* 60px bar + 16px gap */
        right: 16px !important;
    }
}

#back-to-top:hover {
    transform: scale(1.1);
}

/* Base spin for older browsers if needed, but Tailwind handles it */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Single Product: Gallery Pagination --- */
/* --- Single Product: Gallery Pagination (Mobile Focus) --- */
.productMainSwiper .swiper-pagination-bullet {
    background: #000;
    opacity: 0.2;
    width: 6px;
    height: 6px;
    transition: all 0.3s ease;
}

.productMainSwiper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 20px;
    border-radius: 4px;
}

/* --- Single Product: WooCommerce Elements --- */
/* Mobile/Tablet Styles Only */
@media (max-width: 1023px) {
    .product-info-wrapper .summary.entry-summary {
        @apply gap-4;
    }

    .product-info-wrapper h1.product_title {
        @apply text-2xl font-bold uppercase leading-tight mb-2;
    }

    .product-info-wrapper p.price {
        @apply text-xl font-semibold text-black mb-4;
    }

    .product-info-wrapper .variations {
        @apply w-full mb-6;
    }

    .product-info-wrapper .variations tr {
        @apply flex flex-col mb-4;
    }

    .product-info-wrapper .variations td.label {
        @apply pb-2;
    }

    .product-info-wrapper .variations td.value {
        @apply w-full;
    }

    .product-info-wrapper .variations select {
        @apply w-full border border-gray-200 rounded-sm px-4 py-2 text-sm focus:border-black outline-none transition-colors;
    }

    .product-info-wrapper .quantity {
        @apply flex items-center h-12 mb-4;
    }

    .product-info-wrapper .quantity .minus,
    .product-info-wrapper .quantity .plus {
        @apply w-12 h-full bg-gray-50 hover:bg-gray-100 border border-gray-200 text-gray-600 transition-colors flex items-center justify-center cursor-pointer;
    }

    .product-info-wrapper .quantity input.qty {
        @apply w-14 h-full border-y border-x-0 border-gray-200 text-center text-sm font-medium outline-none focus:ring-0;
    }

    .product-info-wrapper form.cart {
        @apply flex flex-col gap-4 mt-6;
    }

    .product-info-wrapper .single_add_to_cart_button,
    .product-info-wrapper .js-dat-thue-btn {
        @apply w-full h-12 bg-black text-white text-[13px] font-bold uppercase tracking-widest hover:bg-gray-900 transition-colors rounded-sm flex items-center justify-center;
    }

    .product-info-wrapper .js-dat-thue-btn {
        @apply bg-transparent border border-black text-black hover:bg-black hover:text-white;
    }

    /* Tabs & Related Products Mobile (Forced Refined Style) */
    .woocommerce div.product .woocommerce-tabs.wc-tabs-wrapper {
        @apply mt-10 pt-10 border-t border-gray-100 !important;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs {
        @apply flex flex-nowrap items-center gap-8 mb-8 overflow-x-auto pb-4 border-b border-gray-100 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        @apply flex-shrink-0 mb-[-1px] !important;
        display: block !important;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    /* Tabs & Related Products Mobile (Pure CSS Refined Style) */
    .woocommerce div.product .woocommerce-tabs.wc-tabs-wrapper {
        margin-top: 40px !important;
        padding-top: 40px !important;
        border-top: 1px solid #f1f1f1 !important;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 32px !important;
        margin-bottom: 32px !important;
        overflow-x: auto !important;
        padding-bottom: 16px !important;
        border-bottom: 1px solid #f1f1f1 !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        flex-shrink: 0 !important;
        margin-bottom: -1px !important;
        display: block !important;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        display: inline-block !important;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.15em !important;
        font-weight: 700 !important;
        color: #9ca3af !important; /* text-gray-400 */
        padding: 0 0 12px 0 !important;
        border-bottom: 2px solid transparent !important;
        transition: all 0.3s ease !important;
        white-space: nowrap !important;
        background: transparent !important;
        border-top: 0 !important;
        border-right: 0 !important;
        border-left: 0 !important;
        border-radius: 0 !important;
    }

    .woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
        color: #000 !important;
        border-bottom-color: #000 !important;
    }

    .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel {
        padding: 0 !important;
        color: #4b5563 !important; /* text-gray-600 */
        line-height: 1.8 !important;
        font-size: 14px !important;
    }

    .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel div {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
    }

    section.related.products h2,
    section.upsells.products h2 {
        @apply text-lg font-bold uppercase text-center mb-8 tracking-widest;
    }

    section.related.products ul.products,
    section.upsells.products ul.products {
        @apply grid grid-cols-2 gap-4;
    }
}

/* Base Desktop Styles (Only minor enhancements) */
@media (min-width: 1024px) {
    .product-info-wrapper h1.product_title {
        @apply text-3xl font-bold uppercase leading-tight mb-2;
    }
    .product-info-wrapper p.price {
        @apply text-2xl font-semibold text-black mb-6;
    }
    .woocommerce-tabs.wc-tabs-wrapper {
        @apply mt-20 border-t border-gray-100 pt-16;
    }
    .woocommerce-tabs ul.tabs {
        @apply flex items-center justify-center gap-12 mb-12;
    }
    .woocommerce-tabs ul.tabs li a {
        @apply text-sm uppercase tracking-widest font-bold text-gray-400 hover:text-black transition-colors pb-2 border-b-2 border-transparent;
    }
    .woocommerce-tabs ul.tabs li.active a {
        @apply text-black border-black;
    }
    section.related.products, section.upsells.products {
        @apply mt-24 border-t border-gray-100 pt-20;
    }
}

/* --- Global: Category Nav --- */
.cateNav.active {
    border-color: #000 !important;
    pointer-events: none;
    cursor: default;
}