/* Common Sections CSS - SCode Theme */
/* Tái sử dụng cho tất cả các trang: Custom Page, Checkout, Cart, etc. */

/* ===== TYPOGRAPHY ===== */
.section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.section-title.h1 {
    font-size: 3rem;
}

.section-title.h2 {
    font-size: 2.5rem;
}

.section-title.h3 {
    font-size: 1.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ===== HERO SECTIONS ===== */
.hero-section {
    background: transparent;
    padding: 0;
    color: inherit;
    text-align: left;
}

.hero-section .hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-section .hero-description {
    font-size: 1.25rem;
    color: #fed7aa;
    margin-bottom: 2rem;
}

.hero-section .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.hero-section .btn-primary {
    background: white;
    color: #ff6a00;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-section .btn-primary:hover {
    background: #fef3c7;
    transform: translateY(-2px);
}

.hero-section .btn-secondary {
    border: 2px solid white;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-section .btn-secondary:hover {
    background: white;
    color: #ff6a00;
}

/* ===== SIDEBAR COMPONENTS ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.sidebar-widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* Recent Products Widget */
.recent-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-product-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.recent-product-image {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.recent-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-product-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-product-content {
    flex: 1;
    min-width: 0;
}

.recent-product-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.recent-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-product-title a:hover {
    color: #ff6a00;
}

.recent-product-price {
    font-size: 0.75rem;
    color: #ff6a00;
    font-weight: 500;
}

/* Categories Widget */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #374151;
    transition: background-color 0.3s ease;
}

.category-item:hover {
    background: #f9fafb;
}

.category-name {
    font-size: 0.875rem;
}

.category-count {
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

/* ===== PRODUCT GRIDS ===== */
.product-grid {
    display: grid;
    gap: 1.5rem;
}

.product-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.product-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.product-grid.cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

.product-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.product-image {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 12rem;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 10;
}

.product-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
}

.product-badge.sale {
    background: #ef4444;
    color: white;
}

.product-badge.new {
    background: #10b981;
    color: white;
}

.product-badge.hot {
    background: #ff6a00;
    color: white;
}

.product-badges-inline {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
    pointer-events: none;
}

.product-badges-inline .badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
}

.product-badges-inline .badge-sale {
    background: #ef4444;
}

.product-badges-inline .badge-new {
    background: #10b981;
}

.product-badges-inline .badge-hot {
    background: #f59e0b;
}

.product-badges-inline .badge-low {
    background: #f97316;
}

.product-badges-inline .badge-out {
    background: #6b7280;
}

.product-quick-add {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-card:hover .product-quick-add {
    opacity: 1;
}

.quick-add-btn {
    width: 2rem;
    height: 2rem;
    background: #ff6a00;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quick-add-btn:hover {
    background: #ff8a33;
}

.product-content {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #ff6a00;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ff6a00;
}

/* ===== SECTIONS ===== */
.section {
    padding: 4rem 0;
}

.section.bg-gray {
    background: #f9fafb;
}

.section.bg-dark {
    background: #111827;
    color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-subtitle {
    margin-bottom: 0;
}

/* ===== STATS SECTION ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6a00;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b7280;
    font-size: 1rem;
}

.section.bg-dark .stat-label {
    color: #d1d5db;
}

/* ===== CONTACT SECTION ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 4rem;
    margin: 0 auto;
}

.contact-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    background: #ff6a00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.contact-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.contact-info {
    color: #6b7280;
    font-size: 1rem;
}

/* ===== RESPONSIVE ===== */

/* Tablet Optimization */
@media (max-width: 1024px) {

    /* Hero Section - Giảm chiều cao sidebar và slider */
    #hero-main-section .flex>div:first-child>div,
    .hero-main-section .flex>div:first-child>div {
        height: 250px !important;
        /* Sidebar: 320px -> 250px */
    }

    #hero-main-section .flex-1>div,
    .hero-main-section .flex-1>div {
        height: 250px !important;
        /* Slider: 320px -> 250px */
    }

    /* Giảm padding và font size trong sidebar menu */
    #hero-main-section nav a,
    .hero-main-section nav a {
        padding: 6px 8px !important;
        font-size: 0.875rem !important;
    }

    #hero-main-section h3,
    .hero-main-section h3 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
}

@media (max-width: 768px) {
    .section-title.h1 {
        font-size: 2.5rem;
    }

    .section-title.h2 {
        font-size: 2rem;
    }

    .section-title.h3 {
        font-size: 1.25rem;
    }

    .hero-section .hero-title {
        font-size: 2.5rem;
    }

    .hero-section .hero-description {
        font-size: 1.125rem;
    }

    /* Hero Main Section - Mobile Optimization */
    #hero-main-section .flex,
    .hero-main-section .flex {
        flex-direction: column !important;
    }

    /* ===== HIDE SIDEBAR MENU ON MOBILE ===== */
    /* The sidebar with red bars looks broken on mobile */
    /* Better to hide it and rely on hamburger menu navigation */
    #hero-main-section .flex>div:first-child,
    .hero-main-section .flex>div:first-child {
        display: none !important;
    }

    /* Slider - Giảm chiều cao */
    #hero-main-section .flex-1>div,
    .hero-main-section .flex-1>div {
        height: 220px !important;
    }

    #hero-main-section .slider-container,
    .hero-main-section .slider-container {
        height: 220px !important;
    }

    /* Slider buttons - Giảm kích thước */
    #hero-main-section .slider-prev,
    #hero-main-section .slider-next,
    .hero-main-section .slider-prev,
    .hero-main-section .slider-next {
        width: 32px !important;
        height: 32px !important;
    }

    #hero-main-section .slider-prev svg,
    #hero-main-section .slider-next svg,
    .hero-main-section .slider-prev svg,
    .hero-main-section .slider-next svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Slider dots - Giảm kích thước */
    #hero-main-section .slider-dot,
    .hero-main-section .slider-dot {
        width: 8px !important;
        height: 8px !important;
    }

    /* Slider - Giảm chiều cao */
    #hero-main-section .flex-1>div,
    .hero-main-section .flex-1>div {
        height: 220px !important;
    }

    #hero-main-section .slider-container,
    .hero-main-section .slider-container {
        height: 220px !important;
    }

    /* Slider buttons - Giảm kích thước */
    #hero-main-section .slider-prev,
    #hero-main-section .slider-next,
    .hero-main-section .slider-prev,
    .hero-main-section .slider-next {
        width: 32px !important;
        height: 32px !important;
    }

    #hero-main-section .slider-prev svg,
    #hero-main-section .slider-next svg,
    .hero-main-section .slider-prev svg,
    .hero-main-section .slider-next svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Slider dots - Giảm kích thước */
    #hero-main-section .slider-dot,
    .hero-main-section .slider-dot {
        width: 8px !important;
        height: 8px !important;
    }

    /* Slider text content */
    #hero-main-section .slide .absolute,
    .hero-main-section .slide .absolute {
        bottom: 12px !important;
        left: 12px !important;
        right: 12px !important;
    }

    #hero-main-section .slide p,
    .hero-main-section .slide p {
        font-size: 0.875rem !important;
        margin-bottom: 8px !important;
    }

    #hero-main-section .slide a,
    .hero-main-section .slide a {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }

    .product-grid.cols-2,
    .product-grid.cols-3,
    .product-grid.cols-4,
    .product-grid.cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    /* Hero Section - Extra small mobile */
    #hero-main-section .flex>div:first-child>div,
    .hero-main-section .flex>div:first-child>div {
        max-height: 160px !important;
        padding: 10px !important;
    }

    #hero-main-section h3,
    .hero-main-section h3 {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }

    #hero-main-section nav,
    .hero-main-section nav {
        max-height: 120px;
    }

    #hero-main-section nav a,
    .hero-main-section nav a {
        padding: 5px 6px !important;
        font-size: 0.75rem !important;
    }

    /* Slider - Giảm chiều cao thêm */
    #hero-main-section .flex-1>div,
    .hero-main-section .flex-1>div {
        height: 180px !important;
    }

    #hero-main-section .slider-container,
    .hero-main-section .slider-container {
        height: 180px !important;
    }

    /* Slider buttons - Giảm kích thước thêm */
    #hero-main-section .slider-prev,
    #hero-main-section .slider-next,
    .hero-main-section .slider-prev,
    .hero-main-section .slider-next {
        width: 28px !important;
        height: 28px !important;
    }

    #hero-main-section .slider-prev svg,
    #hero-main-section .slider-next svg,
    .hero-main-section .slider-prev svg,
    .hero-main-section .slider-next svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Slider dots - Giảm kích thước thêm */
    #hero-main-section .slider-dot,
    .hero-main-section .slider-dot {
        width: 6px !important;
        height: 6px !important;
    }

    /* Slider text content */
    #hero-main-section .slide .absolute,
    .hero-main-section .slide .absolute {
        bottom: 8px !important;
        left: 8px !important;
        right: 8px !important;
    }

    #hero-main-section .slide p,
    .hero-main-section .slide p {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
        display: none;
        /* Ẩn mô tả trên mobile nhỏ */
    }

    #hero-main-section .slide a,
    .hero-main-section .slide a {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }

    /* Ẩn sidebar menu trên mobile để bố cục gọn hơn */
    #hero-main-section .hero-content-wrapper>div:first-child {
        display: none !important;
    }

    /* Sidebar menu - cuộn ngang gọn gàng trên mobile */
    #hero-main-section nav.space-y-0.5 {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding: 6px 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #hero-main-section nav.space-y-0.5::-webkit-scrollbar {
        display: none;
    }

    #hero-main-section nav.space-y-0.5 a {
        margin: 0 !important;
        min-width: 150px;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .product-grid.cols-2,
    .product-grid.cols-3,
    .product-grid.cols-4,
    .product-grid.cols-6 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FEATURED CATEGORIES HORIZONTAL ===== */
.featured-categories-horizontal {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.featured-categories-horizontal::-webkit-scrollbar {
    display: none;
}

.featured-category-card {
    flex: 0 0 240px;
    min-height: 96px;
}

@media (max-width: 640px) {
    .featured-category-card {
        flex-basis: 200px;
    }
}

/* Footer layering to avoid overlay issues on mobile */
footer,
.site-footer {
    position: relative;
    z-index: 1;
}

/* ===== UTILITIES ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smooth-scroll {
    scroll-behavior: smooth;
}