:root {
    --primary-color: #6b4ce6;
    --secondary-color: #8c72ff;
    --accent-color: #ff6b6b;
    --background-color: #f8f9fe;
    --text-color: #2c3e50;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.main-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.header-content h1 {
    margin: 0;
    font-size: 2rem;
}

#products {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.product {
    background: white;
    margin: 10px;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    width: 200px;
}

.product img {
    width: 100%;
    border-radius: var(--border-radius);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.product-link:hover {
    transform: scale(1.05);
}

.cart-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.item-details {
    flex: 1;
}

.item-details h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.item-details p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    padding: 2px 8px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.quantity-controls span {
    font-size: 0.9rem;
}

.cart-summary {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9rem;
}

.summary-row.total {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #ddd;
    font-weight: bold;
    font-size: 1rem;
}

#cart-info {
    background: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    margin: 0 auto;
}

#cart-info i {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    #cart-info {
        width: 80%;
    }
}

#place-order {
    display: none;
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#place-order:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #ff5252;
}

#place-order:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    background: #ff5252;
}

#cart-summary {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 10px 0;
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    border-bottom: none;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
}

.view-cart-btn {
    display: inline-block;
    padding: 5px 15px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-left: 15px;
    transition: background-color 0.2s;
}

.view-cart-btn:hover {
    background: var(--background-color);
}

#floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.auth-btn,
.order-btn {
    width: 100%;
    padding: 12px 20px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn {
    background-color: #4285f4;
    color: white;
}

.auth-btn:hover {
    background-color: #357ae8;
}

.order-btn {
    background-color: #28a745;
    color: white;
}

.order-btn:hover {
    background-color: #218838;
}

.auth-btn i,
.order-btn i {
    font-size: 1.2rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.nav-btn i {
    font-size: 1.2em;
}

.auth-required {
    display: none;
}

.no-auth-only {
    display: flex;
}

.user-signed-in .auth-required {
    display: flex;
}

.user-signed-in .no-auth-only {
    display: none;
}

.user-info {
    color: #fff;
    font-size: 0.9em;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-left: 10px;
}

#cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* Invoice Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #666;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.company-info h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.company-info p {
    margin: 5px 0;
    color: #666;
}

.invoice-details {
    text-align: right;
}

.customer-info {
    margin-bottom: 30px;
}

.invoice-items table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-items th,
.invoice-items td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.invoice-items th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.invoice-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #eee;
}

.download-btn {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #45a049;
}
