/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #4a00e0, #8e2de2);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container {
    flex: 1;
}

.logo img {
    height: 100%;
    width: auto;
    border-radius: 8px;
}

/* Search Bar Styles */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 300px;
    margin: 0 20px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 15px;
    background: transparent;
    font-size: 14px;
}

.search-bar button {
    background: #4a00e0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #3a00b0;
}

.contact-info {
    flex-shrink: 0;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.breadcrumb a {
    color: #4a00e0;
    text-decoration: none;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #666;
}

/* Main Content Styles */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #4a00e0;
    font-size: 2rem;
}

/* Category Grid - Updated for 4-5 items per row */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #4a00e0;
}

.category-img {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.category-img img {
    max-width: 80px;
    max-height: 70px;
    border-radius: 8px;
    object-fit: contain;
}

.category-content h3 {
    color: #4a00e0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
}

.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.product-content {
    padding: 1.5rem;
}

.product-content h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.product-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a00e0;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.no-products h3 {
    color: #666;
    margin-bottom: 1rem;
}

/* Product Page Styles - Fixed Half/Half Layout */
.product-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-to-categories {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.back-to-categories:hover {
    background: #5a6268;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Left Side - Image and Description */
.product-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 400px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem;
    width: 100%;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.product-emoji {
    font-size: 6rem;
}

.product-info {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
}

.product-info h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.product-description-full {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Right Side - Prices Only */
.product-right {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.product-right h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

/* Denominations */
.denominations {
    margin: 0 0 2rem 0;
}

.denominations h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.denomination-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.denomination-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.denomination-option:hover,
.denomination-option.selected {
    border-color: #4a00e0;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.denomination-amount {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.denomination-price {
    color: #4a00e0;
    font-weight: bold;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.buy-now-btn {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.buy-now-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.buy-now-btn:not(:disabled):hover {
    background: #128C7E;
}

/* Subcategories Overlay Styles */
.subcategories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.subcategories-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.subcategories-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.back-btn {
    background: none;
    border: none;
    color: #4a00e0;
    cursor: pointer;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: #3a00b0;
    transform: translateX(-5px);
}

.subcategory-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.subcategory-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px solid transparent;
    text-align: left;
    width: 100%;
}

.subcategory-item:hover {
    background: #e9ecef;
    border-color: #4a00e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.subcategory-img {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.subcategory-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.subcategory-content {
    flex: 1;
}

.subcategory-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.subcategory-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Footer Styles */
footer {
    background: #343a40;
    color: white;
    padding: 2rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    margin-bottom: 1rem;
    color: #4a00e0;
}

.footer-column a {
    display: block;
    color: #adb5bd;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #495057;
    color: #adb5bd;
}


/* Mobile Responsive Styles - Vertical Split Layout */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-bar {
        order: 2;
        min-width: 100%;
        margin: 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .category-card {
        padding: 0.8rem;
        min-height: 120px;
    }
    
    .category-img {
        height: 50px;
        font-size: 2rem;
    }
    
    .category-img img {
        max-width: 50px;
        max-height: 50px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* Product Header Fix */
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .product-header h1 {
        font-size: 1.3rem;
        line-height: 1.3;
        margin: 0;
    }
    
    .back-to-categories {
        align-self: flex-start;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* Product Page - Vertical Split Layout */
    .product-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-height: none;
    }
    
    .product-left {
        gap: 1rem;
        order: 1;
    }
    
    .product-image {
        height: 150px;
        min-height: 150px;
        border-radius: 10px;
    }
    
    .product-emoji {
        font-size: 2.5rem;
    }
    
    .product-image img {
        max-width: 80%;
        max-height: 80%;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-info h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .product-description-full {
        font-size: 0.9rem;
        line-height: 1.4;
        max-height: 80px;
        overflow: hidden;
        position: relative;
    }
    
    .product-description-full:after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 30px;
        background: linear-gradient(transparent, white);
    }
    
    .product-right {
        position: static;
        padding: 1.5rem;
        order: 2;
        background: #f8f9ff;
        border: 2px solid #4a00e0;
        border-radius: 15px;
    }
    
    .product-right h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        color: #4a00e0;
        text-align: center;
    }
    
    .denominations {
        margin: 0 0 1.5rem 0;
    }
    
    .denominations h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .denomination-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .denomination-option {
        padding: 0.8rem 0.5rem;
        background: white;
    }
    
    .denomination-amount {
        font-size: 1rem;
        font-weight: bold;
    }
    
    .denomination-price {
        font-size: 1rem;
        font-weight: bold;
    }
    
    .buy-now-btn {
        padding: 15px;
        font-size: 1.1rem;
        margin-top: 0;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    }
    
    .subcategories-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .subcategories-content {
        width: 95%;
        padding: 1.5rem;
        max-height: calc(100vh - 80px);
    }
    
    .subcategory-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .subcategory-img {
        width: 50px;
        height: 50px;
    }
}

/* Extra small mobile optimization */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Product page further optimization */
    .product-image {
        height: 120px;
        min-height: 120px;
    }
    
    .product-emoji {
        font-size: 2rem;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-description-full {
        max-height: 60px;
        font-size: 0.85rem;
    }
    
    .product-right {
        padding: 1rem;
    }
    
    .denomination-options {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    
    .denomination-option {
        padding: 0.7rem 0.4rem;
    }
    
    .buy-now-btn {
        padding: 12px;
        font-size: 1rem;
    }
}

/* For very small heights */
@media (max-height: 600px) and (max-width: 768px) {
    .product-image {
        height: 100px;
        min-height: 100px;
    }
    
    .product-emoji {
        font-size: 1.8rem;
    }
    
    .product-description-full {
        max-height: 50px;
        font-size: 0.8rem;
    }
    
    .product-right {
        padding: 1rem;
    }
    
    .denomination-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ensure buy button is always visible with sticky positioning on mobile */
@media (max-width: 768px) {
    .product-right {
        position: sticky;
        bottom: 10px;
        z-index: 100;
        margin-top: 1rem;
    }
}
/* No Products and Back Link */
.no-products {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.no-products h3 {
    color: #666;
    margin-bottom: 1rem;
}

.back-to-home {
    display: inline-block;
    background: #4a00e0;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background 0.3s;
}

.back-to-home:hover {
    background: #3a00b0;
}