:root {
    --primary-color: #20B2AA; /* LightSeaGreen */
    --secondary-color: #87CEEB; /* SkyBlue */
    --accent-color: #3CB371; /* MediumSeaGreen */
    --background-color: #F0F8FF; /* AliceBlue */
    --text-color: #333;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1750px; /* Optimized for FHD (7 items/row) */
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.2;
}

.nav-icon-link .icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.badge {
    background: #ff4400;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    position: absolute;
    top: -8px;
    right: -8px;
}

.badge-mobile {
    background: #ff4400;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 0.6rem;
    position: absolute;
    top: 2px;
    right: 25%;
}

.desktop-categories {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 10px;
}

.desktop-categories .container {
    display: flex;
    gap: 1.5rem;
}

.navbar .search-bar {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 5px 15px;
    margin: 0 20px;
    flex: 1;
    max-width: 400px;
}

.navbar .search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding: 5px;
}

.navbar .search-bar button {
    background: none;
    border: none;
    cursor: pointer;
}

.cat-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background 0.2s;
}

.cat-link:hover, .cat-link.active {
    background: #f0f0f0;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .desktop-categories {
        display: none;
    }
}

.nav-links a:hover {
    color: var(--primary-color);
}

.hero {
    text-align: center;
    padding: 1rem 0;
    background: var(--primary-color);
    color: white;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

.hero h1 {
    margin: 0;
    font-size: 2.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjusted for 7 items */
    gap: 1.2rem; /* Slightly tighter gap */
    padding-bottom: 4rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Price Tier Highlighting */
.product-card.tier-premium {
    border: 1px solid #ffd700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.15);
}
.product-card.tier-premium::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.1);
    pointer-events: none;
}

.product-card.tier-luxury {
    border: none;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.product-card.tier-luxury .product-image {
    transform: scale(1.02);
}
.product-card.tier-luxury .product-title {
    font-weight: 800;
    color: #2c3e50;
}

/* Tier Badges */
.tier-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.tier-badge.premium { background: linear-gradient(45deg, #f1c40f, #f39c12); }
.tier-badge.luxury { background: linear-gradient(45deg, #8e44ad, #c0392b); }
.tier-badge.deal { background: linear-gradient(45deg, #27ae60, #2ecc71); }

.product-image {
    display: block;
    width: 100%;
    aspect-ratio: 4/3; /* Consistent aspect ratio */
    object-fit: cover;
    transition: transform 0.5s;
}
.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px; /* Added spacing */
    margin-top: auto;
    background: #f8f9fa;
    padding: 12px 15px;
    margin: 10px -15px 0 -15px; /* Bleed to edges */
    border-top: 1px solid #eee;
}

/* Adjust Product Info to allow footer bleed */
.product-info {
    padding: 8px 15px 0 15px; /* Reduced top padding (was 15px) */
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.price-tag {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--accent-color);
    font-weight: 800;
}
.price-tag .currency {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
}
.price-tag .value {
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    line-height: 1;
}

.buy-now-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.buy-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,123,255,0.4);
    background: linear-gradient(135deg, #0069d9, #004085);
}
    color: white;
    background: #007bff;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.view-ebay-btn:hover {
    background: #0056b3;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-color);
}

.product-thumbnails {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    height: 40px;
}
.product-thumbnails img {
    height: 100%;
    width: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #1a9089;
}

.btn-secondary {
    background-color: #999;
}

.btn-danger {
    background-color: #e74c3c;
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Layout Classes (Replaces Inline Styles) */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.settings-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Mobile Elements (Hidden by default) */
.mobile-top-bar, .mobile-bottom-nav, .mobile-quick-nav {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Hide Desktop Elements */
    .desktop-header, .desktop-only {
        display: none;
    }

    /* Show Mobile Elements */
    .mobile-top-bar {
        display: block;
        position: sticky;
        top: 0;
        background: white;
        padding: 0.5rem 1rem;
        z-index: 1000;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .search-bar {
        background: #f5f5f5;
        border-radius: 20px;
        padding: 0.5rem 1rem;
        display: flex;
        align-items: center;
        border: 1px solid var(--primary-color);
    }

    .search-bar input {
        border: none;
        background: transparent;
        width: 100%;
        margin-left: 0.5rem;
        outline: none;
    }

    .mobile-quick-nav {
        display: flex;
        justify-content: space-around;
        padding: 1rem 0;
        background: white;
        margin-bottom: 1rem;
    }

    .quick-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.8rem;
        color: #666;
    }

    .quick-nav-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        padding: 0.5rem 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 1000;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #999;
        font-size: 0.7rem;
    }

    .nav-item.active {
        color: var(--primary-color);
    }

    .nav-icon {
        font-size: 1.5rem;
        margin-bottom: 0.1rem;
    }

    /* Adjust Main Content for Fixed Nav */
    .main-content {
        padding-bottom: 4rem; /* Space for bottom nav */
    }

    /* Mobile Product Grid (2 Columns) */
    .products-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .product-card {
        box-shadow: none;
        border: 1px solid #eee;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 0.5rem;
    }

    .product-title {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        height: auto; /* Allow auto height for clamp to work */
        min-height: 2.4em; /* Maintain alignment */
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    .product-description {
        display: none; /* Hide description on mobile grid */
    }

    .product-category {
        display: none;
    }

    .product-footer {
        margin-top: 0.5rem;
        flex-direction: column; /* Stack vertically on mobile */
        align-items: stretch; /* Full width items */
        justify-content: flex-start;
        gap: 5px;
    }

    .price-tag .value {
        font-size: 1.1rem; /* Slightly smaller price */
    }

    .buy-now-btn {
        width: 100%; /* Full width button */
        justify-content: center;
        padding: 6px 4px; 
        font-size: 0.75rem;
        box-sizing: border-box; /* Ensure padding doesn't overflow */
    }

    /* Other Layouts */
    .profile-layout, 
    .admin-layout, 
    .settings-form {
        grid-template-columns: 1fr;
    }

    .login-container {
        margin: 2rem auto;
        width: 90%;
        padding: 1.5rem;
        box-sizing: border-box;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* WhatsApp Chat Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 2000; /* Ensure it stays above bottom nav */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    fill: white;
}

@media screen and (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 80px; /* Moved up to avoid overlap with bottom nav */
        right: 20px;
    }
    .whatsapp-icon {
        width: 28px;
        height: 28px;
    }
}

/* Bazi Promotion Box */
.bazi-promo-box {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.15);
}

.promo-icon {
    font-size: 3rem;
    animation: float 3s ease-in-out infinite;
}

.promo-content {
    flex-grow: 1;
    text-align: left;
}

.promo-content h3 {
    margin: 0 0 0.5rem 0;
    color: #856404;
    font-size: 1.4rem;
}

.promo-content p {
    margin: 0;
    color: #533f03;
    font-size: 1rem;
}

.btn-promo {
    background: #ffc107;
    color: #333;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.btn-promo:hover {
    background: #ffdb4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .bazi-promo-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }
    .promo-content {
        text-align: center;
    }
    .promo-action {
        width: 100%;
    }
    .btn-promo {
        width: 100%;
        display: block;
        text-align: center;
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 550px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border-top: 6px solid #ffc107; /* Matches Promo Color */
    animation: slideUp 0.3s;
}

.modal-content h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #ccc;
    line-height: 20px;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #555;
}

.bazi-steps {
    margin-top: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    gap: 1rem;
}

.step-num {
    background: #ffc107;
    color: #533f03;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    font-weight: bold;
}

.step p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
}

.modal-footer-note {
    background: #fff8e1;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    text-align: center;
    color: #856404;
    font-size: 0.95rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

