/**
 * Section Product Card Styles - Copy từ products/index.php
 * Exact clone của B&O product card
 */

:root {
    --bo-black: #000000;
    --bo-white: #ffffff;
    --bo-gray-50: #fafafa;
    --bo-gray-100: #f5f5f5;
    --bo-gray-200: #e5e5e5;
    --bo-gray-300: #d4d4d4;
    --bo-gray-400: #a3a3a3;
    --bo-gray-500: #737373;
    --bo-gray-600: #525252;
    --bo-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Products Grid - B&O Layout
   ============================================ */
.bo-products {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px 10px;
}

.bo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    background: transparent;
}

.bo-grid.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   Product Card - B&O Style
   ============================================ */
.bo-card {
    position: relative;
    background: var(--bo-gray-100);
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: boFadeIn 0.5s ease forwards;
}

.bo-card:nth-child(1) {
    animation-delay: 0.05s;
}

.bo-card:nth-child(2) {
    animation-delay: 0.1s;
}

.bo-card:nth-child(3) {
    animation-delay: 0.15s;
}

.bo-card:nth-child(4) {
    animation-delay: 0.2s;
}

.bo-card:nth-child(5) {
    animation-delay: 0.25s;
}

.bo-card:nth-child(6) {
    animation-delay: 0.3s;
}

.bo-card:nth-child(7) {
    animation-delay: 0.35s;
}

.bo-card:nth-child(8) {
    animation-delay: 0.4s;
}

@keyframes boFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* Featured Card - 2x2 */
.bo-card--featured {
    grid-column: span 2;
    grid-row: span 2;
}

/* Card Header */
.bo-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 12px;
    gap: 10px;
}

.bo-card--featured .bo-card__header {
    padding: 25px 25px 15px;
}

.bo-card__name {
    font-size: 13px;
    font-weight: 400;
    color: var(--bo-black);
    margin: 0;
    line-height: 1.4;
}

.bo-card--featured .bo-card__name {
    font-size: 14px;
}

.bo-card__badge {
    font-size: 11px;
    font-weight: 400;
    color: var(--bo-black);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Card Media/Image */
.bo-card__link {
    display: block;
    flex: 1;
    text-decoration: none;
}

.bo-card__media {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    overflow: hidden;
    background: var(--bo-gray-100);
}

.bo-card--featured .bo-card__media {
    min-height: 400px;
}

.bo-card__no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bo-gray-300);
}

.bo-card__no-image svg {
    width: 48px;
    height: 48px;
}

.bo-card__sale {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bo-black);
    color: var(--bo-white);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    z-index: 10;
}

/* ============================================
   Image Slider - B&O Style
   Desktop: Hover fade | Mobile: Swipe + thin scrollbar
   ============================================ */
.bo-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.bo-slider__wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.bo-slider__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

.bo-slider__slide:first-child {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}

.bo-slider__slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.bo-card--featured .bo-slider__slide img {
    object-fit: cover;
    padding: 0;
}

/* Desktop: Hover fade effect */
@media (min-width: 992px) {
    .bo-slider:hover .bo-slider__slide:first-child {
        opacity: 0;
    }

    .bo-slider:hover .bo-slider__slide:nth-child(2) {
        opacity: 1;
    }

    /* Hide scrollbar on desktop */
    .bo-slider__scrollbar {
        display: none !important;
    }
}

/* Mobile/Tablet: Thin scrollbar indicator (B&O style) */
.bo-slider__scrollbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--bo-gray-200);
}

.bo-slider__scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 1px;
    background: var(--bo-black);
    transition: left 0.3s ease;
}

.bo-slider__scrollbar-thumb.is-second {
    left: 50%;
}

/* Active slide state for mobile */
@media (max-width: 991px) {
    .bo-slider__slide.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    .bo-slider__slide:not(.is-active) {
        opacity: 0;
        pointer-events: none;
    }
}

/* Card Footer */
.bo-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 20px;
    margin-top: auto;
    position: relative;
    z-index: 25;
    background: var(--bo-gray-100);
}

.bo-card--featured .bo-card__footer {
    padding: 20px 25px 25px;
}

/* Price Wrapper with Hover Animation */
.bo-card__price-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 18px;
}

.bo-card__price {
    font-size: 13px;
    font-weight: 400;
    color: var(--bo-black);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bo-card--featured .bo-card__price {
    font-size: 14px;
}

.bo-card__price-original {
    font-size: 13px;
    font-weight: 400;
    color: var(--bo-gray-500);
    text-decoration: line-through;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

.bo-card--featured .bo-card__price-original {
    font-size: 14px;
}

/* Desktop Hover Effect */
@media (min-width: 992px) {
    .bo-card:hover .bo-card__price-wrapper.has-sale .bo-card__price {
        transform: translateY(-20px);
        opacity: 0.7;
    }

    .bo-card:hover .bo-card__price-wrapper.has-sale .bo-card__price-original {
        opacity: 1;
    }
}

/* Mobile: Always show both prices stacked */
@media (max-width: 991px) {
    .bo-card__price-wrapper.has-sale {
        min-height: 34px;
    }

    .bo-card__price-wrapper.has-sale .bo-card__price-original {
        opacity: 1;
        position: relative;
        top: auto;
        margin-top: 2px;
    }
}

/* Colors/Variants Button */
.bo-card__colors {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: opacity 0.2s ease;
}

.bo-card__colors:hover {
    opacity: 0.6;
}

.bo-card__colors-label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--bo-gray-500);
    text-transform: uppercase;
}

.bo-card__colors-count {
    font-size: 11px;
    color: var(--bo-gray-400);
}

.bo-card__colors-icon {
    width: 22px;
    height: 22px;
    border: 1px solid var(--bo-gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    margin-left: 4px;
}

.bo-card__colors-icon svg {
    width: 10px;
    height: 10px;
    stroke: var(--bo-gray-500);
    transition: transform 0.25s ease;
}

.bo-card__colors.is-open .bo-card__colors-icon {
    background: var(--bo-black);
    border-color: var(--bo-black);
}

.bo-card__colors.is-open .bo-card__colors-icon svg {
    stroke: var(--bo-white);
    transform: rotate(45deg);
}

/* Variants Panel - B&O Style */
.bo-card__variants {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 55px;
    top: 0;
    background: var(--bo-gray-100);
    z-index: 20;
    overflow: hidden;
}

.bo-card__variants.is-open {
    display: flex;
    flex-direction: column;
    animation: boFadeInSlow 0.6s ease forwards;
}

/* Fade effect at top and bottom */
.bo-card__variants::before,
.bo-card__variants::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 10;
}

.bo-card__variants::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bo-gray-100) 0%, transparent 100%);
}

.bo-card__variants::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bo-gray-100) 0%, transparent 100%);
}

@keyframes boFadeInSlow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bo-card__variants-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bo-card__variants-list::-webkit-scrollbar {
    display: none;
}

/* Show scrollbar only when > 3 variants */
.bo-card__variants-list.has-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--bo-black) transparent;
}

.bo-card__variants-list.has-scroll::-webkit-scrollbar {
    display: block;
    width: 1px;
}

.bo-card__variants-list.has-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.bo-card__variants-list.has-scroll::-webkit-scrollbar-thumb {
    background: var(--bo-black);
}

/* Variant Item */
.bo-card__variant-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
}

.bo-card__variant-item:hover {
    background: transparent;
}

.bo-card__variant-thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: transparent;
    flex-shrink: 0;
}

.bo-card__variant-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bo-card__variant-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--bo-black);
    margin-bottom: 4px;
    text-align: center;
}

.bo-card__variant-price {
    font-size: 13px;
    color: var(--bo-gray-500);
    text-align: center;
}

/* Featured product variants - 2 column grid */
.bo-card--featured .bo-card__variants {
    top: 0;
}

.bo-card--featured .bo-card__variants-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 30px;
}

.bo-card--featured .bo-card__variant-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px 20px;
}

.bo-card--featured .bo-card__variant-info {
    align-items: center;
    text-align: center;
}

.bo-card--featured .bo-card__variant-name,
.bo-card--featured .bo-card__variant-price {
    text-align: center;
}

.bo-card--featured .bo-card__variant-thumb {
    width: 150px;
    height: 150px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .bo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bo-card--featured {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .bo-products {
        padding: 20px 20px 60px;
    }
}

@media (max-width: 768px) {
    .bo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bo-card--featured {
        grid-column: span 2;
        grid-row: span 1;
    }

    .bo-card--featured .bo-card__media {
        min-height: 280px;
    }

    .bo-card__media {
        min-height: 180px;
    }

    .bo-card__header {
        padding: 15px 15px 10px;
    }

    .bo-card__footer {
        padding: 12px 15px 15px;
    }

    .bo-card__name {
        font-size: 12px;
    }

    .bo-card__price {
        font-size: 12px;
    }

    .bo-card__colors-label {
        font-size: 10px;
    }

    /* Mobile variant panel */
    .bo-card__variants {
        top: 0;
    }

    .bo-card__variants-list {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .bo-card__variants-list::-webkit-scrollbar {
        display: none;
    }

    .bo-card.variants-open .bo-slider__scrollbar {
        display: none !important;
    }

    .bo-card--featured .bo-card__variants-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px 15px;
    }

    .bo-card--featured .bo-card__variant-item {
        padding: 12px 10px;
    }

    .bo-card--featured .bo-card__variant-thumb {
        width: 100px;
        height: 100px;
    }

    .bo-card--featured .bo-card__variant-name {
        font-size: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .bo-card--featured .bo-card__variant-price {
        font-size: 11px;
    }

    .bo-card__variant-item {
        gap: 10px;
        padding: 10px 12px;
    }

    .bo-card__variant-thumb {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .bo-card__variant-info {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .bo-card__variant-name {
        font-size: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        max-width: 100%;
    }

    .bo-card__variant-price {
        font-size: 11px;
    }

    .bo-card__variants-list {
        padding: 15px 12px;
    }
}

@media (max-width: 480px) {
    .bo-products {
        padding: 15px 10px 40px;
    }

    .bo-card__header {
        padding: 12px 12px 8px;
    }

    .bo-card__footer {
        padding: 10px 12px 12px;
    }

    .bo-card__name {
        font-size: 11px;
    }

    .bo-card__badge {
        font-size: 10px;
    }

    .bo-card__price {
        font-size: 11px;
    }

    .bo-card__colors-label,
    .bo-card__colors-count {
        display: none;
    }

    .bo-card__colors-icon {
        margin-left: 0;
    }

    .bo-card--featured .bo-card__variants-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 15px 10px;
    }

    .bo-card--featured .bo-card__variant-item {
        padding: 10px 8px;
    }

    .bo-card--featured .bo-card__variant-thumb {
        width: 80px;
        height: 80px;
    }

    .bo-card--featured .bo-card__variant-name {
        font-size: 11px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .bo-card--featured .bo-card__variant-price {
        font-size: 10px;
    }

    .bo-card__variant-item {
        gap: 8px;
        padding: 8px 10px;
    }

    .bo-card__variant-thumb {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .bo-card__variant-info {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .bo-card__variant-name {
        font-size: 11px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .bo-card__variant-price {
        font-size: 10px;
    }

    .bo-card__variants-list {
        padding: 10px 8px;
    }
}

/* ============================================
   Product Slider Section
   ============================================ */
.section-product-slider {
    width: 100%;
}

.product-slider-wrapper {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 40px;
}

.product-slider-wrapper::-webkit-scrollbar {
    display: none;
}

.product-slider-track {
    display: flex;
    gap: 24px;
    padding: 10px 0;
}

.product-slider-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.product-slider-item .bo-card {
    height: 100%;
}

@media (max-width: 768px) {
    .product-slider-wrapper {
        padding: 0 20px;
    }

    .product-slider-item {
        flex: 0 0 260px;
    }
}

/* ============================================
   Hero Banner Video Embed (YouTube/Vimeo)
   ============================================ */
.hero-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-video-embed iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    /* 16:9 aspect ratio */
    min-width: 177.78vh;
    /* 16:9 aspect ratio */
    min-height: 100vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Section Hero Banner */
.section-hero-banner {
    position: relative;
    width: 100%;
    margin-top: -60px;
    /* Pull up behind transparent header */
    padding-top: 60px;
    /* Restore visual space */
}

.section-hero-banner .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.section-hero-banner .hero-bg img,
.section-hero-banner .hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-hero-banner .hero-overlay {
    position: absolute;
    inset: 0;
    background: #000;
}

.section-hero-banner .hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: inherit;
    padding: 80px 40px;
    color: #fff;
}

.section-hero-banner .hero-align-center {
    align-items: center;
    text-align: center;
}

.section-hero-banner .hero-align-left {
    align-items: flex-start;
    text-align: left;
}

.section-hero-banner .hero-align-right {
    align-items: flex-end;
    text-align: right;
}

.section-hero-banner .hero-subtitle {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 15px;
}

.section-hero-banner .hero-title {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.15;
    margin: 0 0 20px;
    max-width: 800px;
}

.section-hero-banner .hero-desc {
    font-size: 16px;
    max-width: 600px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 30px;
}

.section-hero-banner .hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.section-hero-banner .hero-buttons .btn {
    padding: 12px 30px;
    font-size: 14px;
    border: 1px solid #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.section-hero-banner .hero-buttons .btn-primary {
    background: #fff;
    color: #000;
}

.section-hero-banner .hero-buttons .btn-primary:hover {
    background: transparent;
    color: #fff;
}

.section-hero-banner .hero-buttons .btn-outline {
    background: transparent;
    color: #fff;
}

.section-hero-banner .hero-buttons .btn-outline:hover {
    background: #fff;
    color: #000;
}

@media (max-width: 768px) {
    .section-hero-banner {
        margin-top: -60px;
    }

    .section-hero-banner .hero-content {
        padding: 60px 20px;
    }

    .section-hero-banner .hero-title {
        font-size: 2rem;
    }

    .section-hero-banner .hero-desc {
        font-size: 14px;
    }
}

/* ============================================
   Section Header Styles
   ============================================ */
.section-header {
    margin-bottom: 30px;
}

.section-header .section-subtitle {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 8px 0;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.section-header .section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.view-all-link:hover {
    opacity: 0.7;
}

.view-all-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .section-header .section-title {
        font-size: 20px;
    }

    .view-all-link {
        font-size: 13px;
    }
}