* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
    width: 100%;
}

/* ========== TOP BAR - GIỐNG TRANG CHỦ ========== */
.top-bar {
    background: linear-gradient(135deg, #ff9eb7 0%, #ffb3c6 100%);
    color: white;
    padding: 8px 0;
    font-size: 13px;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left, .top-bar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.top-bar a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Marquee Text - Chữ chạy */
.marquee-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    max-width: 900px;
    margin: 0 15px;
}

.marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
    color: white;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.marquee-container:hover .marquee-text {
    animation-play-state: paused;
}

/* ========== MAIN HEADER - GIỐNG TRANG CHỦ ========== */
.main-header {
    background: linear-gradient(135deg, #ffb3c6 0%, #ffc9d6 100%);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(255, 158, 183, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 20px;
    background: #ff6b9d;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

.search-bar button:hover {
    background: #ff5a8f;
}

/* ========== NAVIGATION MENU - GIỐNG TRANG CHỦ ========== */
.nav-menu {
    background: white;
    border-bottom: 1px solid #ffcdd9;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-content::-webkit-scrollbar {
    height: 0;
}

.nav-item {
    padding: 12px 0;
    color: #ff6b9d;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover {
    color: #ff5a8f;
    border-bottom-color: #ff6b9d;
}

.nav-item.active {
    color: #ff5a8f;
    border-bottom-color: #ff6b9d;
    font-weight: bold;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #ff6b9d;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ========== CATEGORY PAGE CONTENT ========== */
.category-page {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

/* ========== SIDEBAR FILTER ========== */
.sidebar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ffe4ec;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-option:hover {
    color: #ff6b9d;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ffe4ec;
    border-radius: 4px;
    font-size: 13px;
}

.apply-btn {
    width: 100%;
    padding: 10px;
    background: #ff6b9d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
}

.apply-btn:hover {
    background: #ff5a8f;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffe4ec;
}

.category-title {
    font-size: 24px;
    color: #ff6b9d;
    font-weight: bold;
}

.sort-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ffe4ec;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.sort-btn:hover,
.sort-btn.active {
    background: #ff6b9d;
    color: white;
    border-color: #ff6b9d;
}

/* ========== PRODUCT GRID ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.product-card {
    background: white;
    border: 1px solid #ffe4ec;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2);
}

.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #fff0f5, #ffe4ec);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b9d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 40px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.stars {
    color: #ffc107;
    font-size: 12px;
}

.sold-count {
    color: #888;
    font-size: 12px;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 16px;
    color: #ff6b9d;
    font-weight: bold;
}

.product-discount {
    font-size: 11px;
    color: #888;
    text-decoration: line-through;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ffe4ec;
}

.page-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ffe4ec;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover,
.page-btn.active {
    background: #ff6b9d;
    color: white;
    border-color: #ff6b9d;
}

/* ========== FOOTER - GIỐNG TRANG CHỦ ========== */
.footer {
    background: linear-gradient(135deg, #fff5f8, #ffe4ec);
    padding: 40px 0 20px 0;
    margin-top: 50px;
    border-top: 2px solid #ffcdd9;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #ff6b9d;
}

.payment-icons, .shipping-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.payment-icon, .shipping-icon {
    background: white;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.payment-icon img, .shipping-icon img {
    max-width: 100%;
    height: 30px;
    object-fit: contain;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.social-link:hover {
    color: #ff6b9d;
}

.app-download {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.qr-code {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-button {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.app-button:hover {
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.2);
}

.app-button img {
    height: 24px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ffcdd9;
    color: #888;
    font-size: 12px;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    /* Fix tràn ngang */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    /* Top Bar */
    .top-bar-content {
        font-size: 11px;
        gap: 10px;
        padding: 0 10px;
    }

    .top-bar-left, .top-bar-right {
        gap: 8px;
    }

    /* Marquee */
    .marquee-container {
        max-width: calc(100vw - 180px);
        margin: 0 10px;
        font-size: 11px;
    }

    /* Header */
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0 10px;
    }

    .logo {
        font-size: 24px;
    }

    .search-bar {
        width: 100%;
        order: 3;
    }

    /* Nav Menu */
    .nav-content {
        padding: 0 10px;
        gap: 15px;
    }

    .nav-item {
        font-size: 13px;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 0 10px;
        margin: 20px 10px;
    }

    /* Category Page */
    .category-page {
        grid-template-columns: 1fr;
        padding: 0 10px;
        margin-left: 10px;
        margin-right: 10px;
        transform: translateX(-16px);
    }

    /* Ẩn sidebar trên mobile */
    .sidebar {
        display: none;
    }

    /* Main Content */
    .main-content {
        padding: 15px 10px;
    }

    /* Category Header */
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .category-title {
        font-size: 20px;
        width: 100%;
    }

    .sort-options {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .sort-options::-webkit-scrollbar {
        height: 4px;
    }

    .sort-options::-webkit-scrollbar-thumb {
        background: #ffb3c6;
        border-radius: 2px;
    }

    .sort-btn {
        font-size: 12px;
        padding: 6px 12px;
        flex-shrink: 0;
    }

    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-image {
        font-size: 40px;
    }

    .product-info {
        padding: 8px;
    }

    .product-name {
        font-size: 12px;
        min-height: 34px;
    }

    .product-price {
        font-size: 14px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .payment-icons, .shipping-icons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .marquee-container {
        max-width: calc(100vw - 150px);
        font-size: 10px;
    }

    .top-bar-content {
        font-size: 10px;
        padding: 0 5px;
    }

    .header-content,
    .nav-content {
        padding: 0 5px;
    }

    .category-page,
    .breadcrumb {
        margin-left: 5px;
        margin-right: 5px;
        padding: 0 5px;
    }

    .main-content {
        padding: 15px 8px;
    }

    .category-title {
        font-size: 18px;
    }

    .sort-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}
/* FIX LỆCH MOBILE - QUAN TRỌNG */
@media (max-width: 768px) {
    .category-page {
        transform: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 15px 10px !important;
        box-sizing: border-box !important;
    }

    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .product-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}
/* Phiên bản đơn giản - không cần bù padding */
@media (max-width: 768px) {
    .pagination {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 15px 5px;
        margin: 20px 0 0;
        justify-content: flex-start;
        scrollbar-width: thin;
    }

    .pagination .page-btn {
        flex: 0 0 auto;
        padding: 10px 16px;
        font-size: 15px;
        min-width: 42px;
    }
}