/* Reset và font chữ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #1a237e;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
}

.logo h1 span {
    color: #ffab00;
}

.logo p {
    font-size: 12px;
    color: #e0e0e0;
}

nav {
    flex: 1;
    margin: 0 20px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
}

nav ul li a:hover, nav ul li a.active {
    color: #ffab00;
}

/* Dropdown menu cho danh mục */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: #333 !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #1a237e !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Search bar */
.search-container {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.search-container input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.search-container button {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 5px;
    cursor: pointer;
}

.search-container button:hover {
    background: #0056b3;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

.search-bar input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.search-bar button {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-bar button:hover {
    background: #0056b3;
}

.user-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.btn-login, .btn-register, .btn-account, .btn-logout {
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-login {
    color: white;
    border: 1px solid white;
}

.btn-login:hover, .btn-login.active {
    background-color: white;
    color: #1a237e;
}

.btn-register {
    background-color: #ffab00;
    color: #1a237e;
    border: 1px solid #ffab00;
}

.btn-register:hover, .btn-register.active {
    background-color: #ffc107;
    border-color: #ffc107;
}

.btn-account {
    background-color: #4caf50;
    color: white;
    border: 1px solid #4caf50;
}

.btn-account:hover, .btn-account.active {
    background-color: #45a049;
    border-color: #45a049;
}

.btn-logout {
    background-color: #e53935;
    color: white;
    border: 1px solid #e53935;
}

.btn-logout:hover, .btn-logout.active {
    background-color: #c62828;
    border-color: #c62828;
}

.cart-icon {
    color: white;
    font-size: 20px;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    color: #ffab00;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 0;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.cta-button:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Main Content Layout */
.main-content {
    padding: 40px 0 60px 0;
}

.main-content .container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.categories-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.categories-sidebar h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 5px;
}

.category-item a {
    display: block;
    padding: 12px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-item a:hover {
    background: #f8f9fa;
    color: #007bff;
    transform: translateX(5px);
}

.category-item.active a {
    background: #007bff;
    color: white;
}

/* Products Main Section */
.products-main {
    flex: 1;
}

.products-header {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.products-header h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    font-weight: 600;
}

.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-bar button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: #0056b3;
}

.sort-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
}

.product-description {
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
    flex: 1;
}

.product-category {
    color: #007bff;
    font-size: 0.9em;
    margin: 0 0 10px 0;
}

.product-price {
    font-size: 1.3em;
    font-weight: bold;
    color: #e74c3c;
    margin: 0 0 10px 0;
}

.product-stock {
    color: #27ae60;
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

.add-to-cart-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    width: 100%;
}

.add-to-cart-btn:hover {
    background: #0056b3;
}

.no-products {
    text-align: center;
    color: #666;
    font-style: italic;
    grid-column: 1 / -1;
    padding: 40px;
}

.error {
    text-align: center;
    color: #e74c3c;
    grid-column: 1 / -1;
    padding: 40px;
}

/* Auth section */
.auth-section {
    padding: 80px 0;
    background-color: #f5f5f5;
    min-height: calc(100vh - 200px);
}

.auth-form {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a237e;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a237e;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #1a237e;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.2);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.form-options label {
    display: flex;
    align-items: center;
    color: #666;
    cursor: pointer;
}

.form-options input {
    margin-right: 8px;
}

.forgot-password {
    color: #1a237e;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: #1a237e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: #303f9f;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-footer a {
    color: #1a237e;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #1a237e;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #ffab00;
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-section p {
    margin-bottom: 10px;
    color: #e0e0e0;
}

.footer-section i {
    margin-right: 10px;
    color: #ffab00;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: #ffab00;
    color: #1a237e;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #b0bec5;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .products-main {
        order: 1;
    }
    
    .categories-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .categories-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .category-item {
        margin-bottom: 0;
    }
    
    .category-item a {
        padding: 8px 16px;
        border: 1px solid #ddd;
        border-radius: 20px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .category-item.active a {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
}

@media (max-width: 768px) {
    /* Header Mobile */
    header .container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .logo h1 {
        font-size: 1.8em;
    }
    
    .logo p {
        font-size: 0.9em;
    }
    
    nav {
        order: 3;
        width: 100%;
    }
    
    nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .search-container {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    .search-container input {
        width: calc(100% - 50px);
        padding: 10px 15px;
        font-size: 16px; /* Tránh zoom trên iOS */
    }
    
    .search-container button {
        width: 40px;
        height: 40px;
        padding: 0;
    }
    
    .user-actions {
        order: 1;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    .btn-login, .btn-register, .btn-account, .btn-logout {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 80px;
    }
    
    /* Main Content Mobile */
    .main-content {
        padding: 20px 0 40px 0;
    }
    
    .main-content .container {
        padding: 0 15px;
    }
    
    .products-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .products-header h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .products-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .sort-controls select {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
    }
    
    /* Products Grid Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    
    .product-card {
        margin-bottom: 0;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-info h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .product-description {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .product-category {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .product-price {
        font-size: 1.2em;
        margin-bottom: 8px;
    }
    
    .product-stock {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .add-to-cart-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Categories Mobile */
    .categories-sidebar {
        padding: 15px;
    }
    
    .categories-sidebar h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .categories-list {
        gap: 6px;
    }
    
    .category-item a {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Footer Mobile */
    footer {
        padding: 30px 0 20px 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .footer-section {
        width: 100%;
    }
    
    .footer-section h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .footer-section p {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .social-icons {
        justify-content: center;
        gap: 15px;
    }
    
    .social-icons a {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .copyright {
        margin-top: 20px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Extra Small Mobile */
    header .container {
        padding: 10px 15px;
    }
    
    .logo h1 {
        font-size: 1.6em;
    }
    
    .logo p {
        font-size: 0.8em;
    }
    
    nav ul {
        gap: 5px;
    }
    
    nav ul li a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .search-container input {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .search-container button {
        width: 35px;
        height: 35px;
    }
    
    .btn-login, .btn-register, .btn-account, .btn-logout {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .main-content .container {
        padding: 0 10px;
    }
    
    .products-header {
        padding: 12px;
    }
    
    .products-header h2 {
        font-size: 1.2em;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-info h3 {
        font-size: 1em;
    }
    
    .product-price {
        font-size: 1.1em;
    }
    
    .add-to-cart-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .categories-sidebar {
        padding: 12px;
    }
    
    .categories-list {
        gap: 4px;
    }
    
    .category-item a {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .footer-section h3 {
        font-size: 1em;
    }
    
    .footer-section p {
        font-size: 13px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Mobile touch devices */
    .btn-login, .btn-register, .btn-account, .btn-logout,
    .add-to-cart-btn, .category-item a {
        min-height: 44px; /* Apple's recommended touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-container button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .product-card {
        cursor: pointer;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .category-item a:active {
        transform: scale(0.95);
    }
}

/* Landscape orientation fixes */
@media (max-width: 768px) and (orientation: landscape) {
    header .container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo {
        flex: 1;
        min-width: 200px;
    }
    
    .search-container {
        flex: 2;
        min-width: 250px;
    }
    
    .user-actions {
        flex: 1;
        min-width: 150px;
    }
    
    .main-content .container {
        flex-direction: row;
        gap: 15px;
    }
    
    .sidebar {
        width: 200px;
        flex-shrink: 0;
    }
    
    .products-main {
        flex: 1;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Auth section responsive */
@media (max-width: 768px) {
    .auth-section {
        padding: 20px 0;
    }
    
    .auth-form {
        max-width: 100%;
        margin: 0 15px;
        padding: 20px;
    }
    
    .auth-form h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 16px; /* Tránh zoom trên iOS */
    }
    
    .form-options {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .form-options label {
        font-size: 14px;
    }
    
    .forgot-password {
        font-size: 14px;
        text-align: center;
    }
    
    .btn-submit {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    .auth-footer {
        margin-top: 20px;
        text-align: center;
    }
    
    .auth-footer p {
        font-size: 14px;
    }
    
    .auth-footer a {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .auth-form {
        margin: 0 10px;
        padding: 15px;
    }
    
    .auth-form h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
    
    .btn-submit {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Account page responsive */
@media (max-width: 768px) {
    .account-container {
        padding: 20px 15px;
    }
    
    .account-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .account-header h1 {
        font-size: 1.5em;
    }
    
    .account-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .account-sidebar {
        width: 100%;
        order: 1;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        border: none;
        background: none;
    }
    
    .sidebar-menu a {
        flex: 1;
        min-width: 120px;
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        text-align: center;
        font-size: 14px;
        background: white;
    }
    
    .sidebar-menu a.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .account-main {
        width: 100%;
        order: 2;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .tab-content h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .info-group {
        margin-bottom: 15px;
    }
    
    .info-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .info-group input,
    .info-group textarea {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .btn-save {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    .order-item {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .order-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .order-id {
        font-size: 14px;
    }
    
    .order-status {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .order-item p {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .order-total {
        font-size: 16px;
        margin-top: 10px;
    }
    
    .address-item {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .address-item p {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .btn-add-address {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    .security-item {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .security-item strong {
        font-size: 16px;
    }
    
    .security-item p {
        font-size: 14px;
    }
    
    .btn-change {
        padding: 8px 16px;
        font-size: 14px;
        align-self: flex-start;
    }
    
    .logout-section {
        margin-top: 30px;
        padding: 20px 15px;
    }
    
    .btn-logout {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .account-container {
        padding: 15px 10px;
    }
    
    .account-header h1 {
        font-size: 1.3em;
    }
    
    .sidebar-menu a {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .tab-content h2 {
        font-size: 1.2em;
    }
    
    .info-group input,
    .info-group textarea {
        padding: 8px 10px;
        font-size: 16px;
    }
    
    .btn-save,
    .btn-add-address,
    .btn-logout {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .order-item,
    .address-item {
        padding: 12px;
    }
    
    .security-item {
        padding: 12px;
    }
    
    .btn-change {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Performance and UX improvements */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent text selection on buttons */
.btn-login, .btn-register, .btn-account, .btn-logout,
.add-to-cart-btn, .category-item a, .search-container button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth transitions */
.product-card, .category-item a, .btn-login, .btn-register,
.btn-account, .btn-logout, .add-to-cart-btn {
    transition: all 0.2s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lazy loading placeholder */
.product-image img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image img.lazy.loaded {
    opacity: 1;
}

/* Pull to refresh indicator */
.pull-to-refresh {
    height: 60px;
    display: flex;
        align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    transform: translateY(-60px);
    transition: transform 0.3s ease;
    }
    
.pull-to-refresh.active {
    transform: translateY(0);
}

/* Swipe gestures for mobile */
.swipeable {
    touch-action: pan-y;
}

/* Better focus states for accessibility */
button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }
    
    .btn-login, .btn-register, .btn-account, .btn-logout {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    header, footer, .sidebar, .user-actions, .search-container {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modal popup for admin edit */
.admin-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 32px 28px 24px 28px;
  min-width: 340px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: adminModalIn 0.2s;
    }
@keyframes adminModalIn {
  from { transform: translateY(40px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.admin-modal h2 {
  margin-top: 0;
  font-size: 1.3em;
  margin-bottom: 18px;
}
.admin-modal .modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 1.5em;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.admin-modal .modal-close:hover {
  color: #e53935;
}
.admin-modal label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.admin-modal input, .admin-modal textarea, .admin-modal select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 15px;
  background: #fafbfc;
  resize: none;
}
.admin-modal textarea {
  min-height: 60px;
  max-height: 200px;
    }
.admin-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.admin-modal .btn {
  padding: 8px 18px;
  border-radius: 5px;
  border: none;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  background: #1976d2;
  color: #fff;
  transition: background 0.2s;
}
.admin-modal .btn:hover {
  background: #1565c0;
}
.admin-modal .btn-cancel {
  background: #eee;
  color: #222;
}
.admin-modal .btn-cancel:hover {
  background: #ccc;
}

.btn-edit {
  color: #fff;
  background: #43a047;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}
.btn-edit:hover {
  background: #388e3c;
}