* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.nav-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.page-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

/* Products page layout - cart below products on all screens */
#products.page-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.products-title {
    margin-bottom: 20px;
}

/* On mobile, cart appears first (before products) */
@media (max-width: 1024px) {
    #products.page-section {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        padding: 10px; /* Reduce padding on mobile */
    }
    
    .products-title {
        order: 1;
        margin-bottom: 20px;
    }
    
    /* Reorder: cart first on mobile */
    #products.page-section .products-grid {
        order: 2;
    }
    
    #products.page-section .cart-section {
        order: 1;
        position: sticky;
        top: 0;
        z-index: 10;
        background: #f8f9fa;
        margin-left:auto; 
        margin-right:auto;
        padding: 20px;
        border-radius: 0; /* Remove border radius on mobile for full width */
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

.page-section.hidden {
    display: none !important;
}

.section.hidden {
    display: none !important;
}

/* Home Page Styles */
.home-content {
    max-width: 900px;
    margin: 0 auto;
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #666;
    text-align: left;
}

.info-section {
    margin: 30px 0;
}

.info-section h3 {
    text-align: center;
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.info-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.info-card p {
    color: #666;
    line-height: 1.6;
}

.cta-section {
    text-align: center;
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.cta-section h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1em;
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

/* Large screens - ensure products appear next to each other */
@media (min-width: 1025px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        min-width: 0; /* Important for grid items to shrink properly */
    }
    
    .product-card {
        min-width: 0; /* Important for grid items to shrink properly */
        width: 100%;
    }
}

/* Extra large screens - more columns */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 30px;
    }
}

/* iPad and tablet resolutions - 3 columns */
@media (min-width: 768px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
}

.product-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-icon {
    font-size: 4em;
    color: white;
}

.welcome-image {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: block;
}

@media (max-width: 480px) {
    .welcome-image {
        max-width: 180px;
    }
}

.product-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.product-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
}

.product-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

/* Cart Styles */
.cart-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    text-align: left; /* Items left-aligned */
    width: 100%;
    max-width: 800px; /* Limit width for centering */
    margin-left: auto;
    margin-right: auto;
}

.cart-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.cart-items {
    margin-bottom: 20px;
}

.cart-section #checkoutBtn {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 300px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 10px;
}

.cart-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    min-width: 0; /* Important for flexbox text overflow */
}

.cart-item-info strong {
    flex: 1;
    min-width: 0; /* Critical for text-overflow in flexbox */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
    font-size: 1em;
}

.cart-item-price {
    color: #667eea;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto; /* Push price to the right */
}

.cart-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9em;
}

.cart-item-remove:hover {
    background: #c82333;
}

.cart-total {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #667eea;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Checkout Styles */
.checkout-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.checkout-form {
    max-width: 600px;
    margin: 0 auto;
}

.order-summary {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.order-total {
    text-align: right;
    font-size: 1.5em;
    margin-top: 20px;
    color: #667eea;
    font-weight: bold;
}

.payment-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.payment-method-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-top: 10px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.payment-method-select:hover {
    border-color: #667eea;
}

.payment-method-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Form actions for checkout */
.checkout-form .form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* Success Section */
.success-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    text-align: center;
    color: white;
}

.success-content {
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.success-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.download-links {
    margin: 30px 0;
}

.download-link {
    display: block;
    background: white;
    color: #667eea;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.download-link:hover {
    transform: translateX(5px);
}

/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.floating-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.floating-cart-btn .cart-icon {
    font-size: 1.2em;
}

.floating-cart-btn .cart-count {
    background: white;
    color: #667eea;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: bold;
}

.floating-cart-btn.hidden {
    display: none;
}

@media (min-width: 1025px) {
    .floating-cart-btn {
        display: none !important; /* Hide on desktop when cart is visible */
    }
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a3f8f 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-primary:focus {
    outline: 3px solid rgba(102, 126, 234, 0.4);
    outline-offset: 2px;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Admin Styles */
.admin-content {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-intro {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.json-actions {
    margin-bottom: 30px;
    text-align: center;
}

.json-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.admin-form .form-group {
    margin-bottom: 25px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="file"],
.admin-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.admin-form textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-form small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.image-preview {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.admin-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.admin-products-list {
    margin-top: 40px;
}

.admin-products-list h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.admin-hint {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.admin-product-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.admin-product-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 15px;
}

.admin-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.admin-product-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
    min-height: 50px;
}

.admin-product-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
    min-height: 60px;
}

.admin-product-details {
    margin-bottom: 15px;
}

.admin-product-card .product-price {
    font-size: 1.3em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.pdf-status {
    font-size: 0.85em;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.pdf-status.has-pdf {
    background: #d4edda;
    color: #155724;
}

.pdf-status.no-pdf {
    background: #f8d7da;
    color: #721c24;
}

.admin-product-card .product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.admin-product-card .btn-small {
    padding: 10px 20px;
    font-size: 0.9em;
    width: 100%;
}

/* Contact Page Styles */
.contact-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.contact-content h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.2em;
}

.contact-intro {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.contact-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.contact-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.contact-card h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
}

.contact-card p {
    margin: 8px 0;
    opacity: 0.95;
}

.contact-card a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transition: border-color 0.3s ease;
}

.contact-card a:hover {
    border-bottom-color: white;
}

.contact-detail {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 8px;
}

.contact-form-wrapper {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.contact-form-wrapper h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.4em;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
}

.contact-form .form-group label {
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

.contact-form .form-group input,
.contact-form .form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.contact-form .btn {
    align-self: flex-start;
    min-width: 150px;
    margin-top: 10px;
}

#contactStatus {
    border-radius: 8px;
}

#contactStatus.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#contactStatus.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.8;
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    header h1 {
        font-size: 2em;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }
    
    .product-card {
        width: 100%;
        max-width: 100%;
    }
    
    .admin-products-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    /* Smaller cart items on mobile */
    .cart-item {
        padding: 8px;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .cart-item-info {
        gap: 8px;
    }
    
    .cart-item-info strong {
        font-size: 0.9em;
    }
    
    .cart-item-price {
        font-size: 0.9em;
    }
    
    .cart-item-remove {
        padding: 5px 10px;
        font-size: 0.85em;
    }
    
    .cart-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    /* Reduce page margins on mobile */
    .container {
        padding: 5px;
    }
    
    .page-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    header {
        margin-bottom: 15px;
    }
    
    .welcome-section {
        margin-bottom: 20px;
    }
    
    .info-section {
        margin: 20px 0;
    }
    
    .cta-section {
        margin-top: 20px;
        padding: 20px;
    }
    
    .checkout-section,
    .success-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    .empty-cart {
        padding: 15px;
    }

    /* Contact page mobile styles */
    .contact-container {
        grid-template-columns: 1fr;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .contact-form-wrapper {
        padding: 20px;
    }}