/* Customer Portal Styles */
.customer-main {
    margin-top: 70px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.featured-products {
    padding: 60px 0;
    background: var(--background);
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Utility to center a single product in the grid */
.products-grid.centered-single {
    grid-template-columns: 1fr; /* single column */
    justify-items: center;
}

/* Keep single product from stretching full width; center items */
.products-grid {
    justify-items: center; /* center grid items in their cells */
}

.products-grid .product-card {
    max-width: 420px; /* sensible card width */
    width: 100%;
}

/* If there's only one product, make it a bit wider but still centered */
.products-grid .product-card:only-child {
    max-width: 720px;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
    width: 100%;
    height: 200px;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
}

/* Slightly smaller images on small screens */
@media (max-width: 768px) {
    .product-image { height: 180px; }
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.product-category {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 40px 0 20px;
}

.search-filter {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    width: 300px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--white);
}

/* Cart Styles */
.cart-items {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    gap: 20px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--background);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.remove-btn {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-summary {
    background: var(--white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.summary-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    margin-bottom: 15px;
    color: var(--text-light);
}

/* Order Tracking */
.order-card {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.order-id {
    font-weight: bold;
    color: var(--primary-color);
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-shipped {
    background: #cce7ff;
    color: #004085;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Checkout Styles */
.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
}

.order-review {
    background: var(--background);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.order-review-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .search-filter {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .customer-main {
        margin-top: 120px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding: 20px 0 15px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .search-filter {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    .checkout-form {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-item {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }

    .products-grid .product-card,
    .cart-items,
    .cart-summary {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .order-summary {
        grid-template-columns: 1fr;
    }
    
    .tracking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-box-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .cart-item-name {
        font-size: 0.95rem;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
/* Auth Styles */
.login-body {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    min-height: 100vh;
    padding-top: 70px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 12px 30px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-dark);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-greeting {
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    white-space: nowrap;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
}

.user-greeting:hover {
    background: var(--primary-color);
    color: var(--white);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: var(--white);
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 5px;
    z-index: 1001;
    overflow: hidden;
    border: 1px solid var(--border);
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

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

.dropdown-content a:hover {
    background: var(--background);
    color: var(--primary-color);
}

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

.dropdown-content.show {
    display: block !important;
}

@media (max-width: 768px) {
    .user-dropdown {
        display: block;
        width: 100%;
        padding: 10px 20px;
    }
    
    .user-greeting {
        font-size: 0.9rem;
        padding: 10px 16px;
        width: 100%;
        display: block;
        text-align: center;
    }
    
    .dropdown-content {
        position: static;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: none;
        border: none;
        background: var(--background);
        margin-top: 10px;
        border-radius: 5px;
    }
    
    .dropdown-content.show {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .dropdown-content a {
        text-align: center;
        padding: 14px 16px;
        font-size: 0.95rem;
    }
}

/* Demo credentials */
.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: var(--background);
    border-radius: 5px;
    text-align: center;
}

.demo-credentials p {
    margin: 5px 0;
    font-size: 0.9rem;
}
/* Order Tracking Styles */
.tracking-search {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.search-box-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-box-container .search-box {
    flex: 1;
}

.search-help {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.tracking-result {
    display: none;
}

.order-tracking-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.order-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item strong {
    margin-bottom: 5px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Timeline Styles */
.tracking-timeline {
    margin-bottom: 30px;
}

.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
    z-index: 2;
}

.timeline-step.completed .timeline-marker {
    background: var(--primary-color);
    color: var(--white);
}

.timeline-step.current .timeline-marker {
    background: var(--secondary-color);
    color: var(--white);
    animation: pulse 2s infinite;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.9rem;
}

.shipping-info {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Order Items in Tracking */
.tracking-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.tracking-order-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 2;
}

.item-quantity {
    flex: 1;
    text-align: center;
}

.item-price {
    flex: 1;
    text-align: right;
    font-weight: 600;
}

.shipping-address {
    margin-top: 30px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
}

.shipping-address h4 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* Enhanced Orders List */
.orders-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.orders-filter label {
    margin-right: 10px;
    font-weight: 500;
}

.orders-filter select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--white);
}

.order-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.order-info {
    flex: 1;
}

.order-id {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.order-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-items-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--background);
    border-radius: 5px;
}

.order-item-preview {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-item-preview:last-child {
    margin-bottom: 0;
}

.more-items {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin-top: 10px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.order-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Status Colors */
.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #cce7ff;
    color: #004085;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}