/**
 * PreOrder Manager Public Styles
 */

/* Main Container */
.preorder-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header Section */
.preorder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.sale-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.sale-date {
    font-size: 1.2rem;
    opacity: 0.9;
}

.sale-date strong {
    color: #ffd700;
}

/* Products Section */
.products-section h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

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

.product-image {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 20px;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

.product-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
}

.product-status {
    text-align: right;
}

.stock-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.product-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.quantity-selector label {
    font-weight: 600;
    color: #333;
    margin: 0;
    min-width: 70px;
}

.quantity-select {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.quantity-select:focus {
    outline: none;
    border-color: #667eea;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Cart Section */
.cart-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.sticky-top {
    position: sticky;
    top: 20px;
}

.cart-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #764ba2;
    padding-bottom: 10px;
}

.cart-items {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

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

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.cart-item-details {
    font-size: 0.85rem;
    color: #666;
}

.cart-item-price {
    font-weight: 600;
    color: #28a745;
}

.cart-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 10px;
}

.cart-item-remove:hover {
    background: #c82333;
}

.cart-summary {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.cart-subtotal,
.cart-fee {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cart-subtotal span:first-child,
.cart-fee span:first-child {
    font-weight: 500;
    color: #666;
}

.cart-subtotal span:last-child,
.cart-fee span:last-child {
    font-weight: 600;
    color: #333;
}

.cart-fee {
    color: #007cba;
}

.fee-details {
    display: block;
    font-size: 0.85em;
    color: #999 !important;
    margin-top: 4px;
    font-style: italic;
}

.cart-total {
    padding-top: 12px !important;
    border-top: 2px solid #333 !important;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.cart-total span {
    color: #28a745;
}

/* Backorder Warning */
.backorder-warning {
    margin-bottom: 20px;
}

.backorder-warning .alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 0;
}

/* Customer Information */
.customer-info h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.contact-method-selector {
    margin-bottom: 20px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input {
    margin-right: 8px;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
}

.contact-input-group {
    margin-bottom: 15px;
}

.contact-input-group .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-input-group .form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    margin-top: 20px;
}

.place-order-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.place-order-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.place-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Utility Classes */
.text-muted {
    color: #666 !important;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.bg-success {
    background-color: #28a745;
    color: white;
}

.bg-warning {
    background-color: #ffc107;
    color: #000;
}

.bg-danger {
    background-color: #dc3545;
    color: white;
}

.bg-primary {
    background-color: #007cba;
    color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .preorder-header {
        padding: 30px 20px;
    }
    
    .sale-info h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .preorder-portal {
        padding: 15px 0;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .preorder-header {
        padding: 25px 15px;
    }
    
    .sale-info h2 {
        font-size: 1.8rem;
    }
    
    .sale-date {
        font-size: 1rem;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    .product-details {
        padding: 15px;
    }
    
    .cart-section {
        margin-top: 30px;
        position: static;
    }
    
    .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quantity-selector label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .preorder-header {
        padding: 20px 15px;
    }
    
    .sale-info h2 {
        font-size: 1.5rem;
    }
    
    .products-section h3,
    .cart-section h3 {
        font-size: 1.3rem;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    .cart-total {
        font-size: 1.3rem;
    }
    
    .place-order-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .preorder-portal {
        max-width: none;
        padding: 0;
    }
    
    .product-card,
    .cart-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .add-to-cart-btn,
    .place-order-btn,
    .cart-item-remove {
        display: none;
    }
    
    .preorder-header {
        background: none !important;
        color: #000 !important;
        border: 1px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .preorder-portal {
        color: #fff;
    }
    
    .product-card,
    .cart-section {
        background: #2d3748;
        border-color: #4a5568;
        color: #fff;
    }
    
    .product-name,
    .cart-total,
    .customer-info h5 {
        color: #fff;
    }
    
    .product-description,
    .stock-info {
        color: #cbd5e0;
    }
    
    .contact-input-group .form-control,
    .quantity-select {
        background: #4a5568;
        border-color: #718096;
        color: #fff;
    }
    
    .text-muted {
        color: #cbd5e0 !important;
    }
}

/* Animation for cart updates */
.cart-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Empty cart state */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.success-message h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.order-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
}