/* ===== COMPONENTS STYLES ===== */

/* Product Cards */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f8f9fa;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #9a0167;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.add-to-cart-btn {
    flex: 1;
    padding: 10px 16px;
    background: #9a0167;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #7a0152;
}

.quick-view-btn {
    padding: 10px 16px;
    background: transparent;
    color: #9a0167;
    border: 2px solid #9a0167;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-view-btn:hover {
    background: #9a0167;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white !important;
    font-weight: 700;
    text-shadow: none;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Checkout Modal */
.checkout-modal {
    max-width: 800px;
}

.checkout-form {
    display: grid;
    gap: 1.5rem;
}

.checkout-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

.checkout-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #9a0167;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

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

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

.cart-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.cart-item-variant {
    font-size: 0.9rem;
    color: #666;
}

.cart-item-price {
    font-weight: 600;
    color: #9a0167;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: #9a0167;
    color: #9a0167;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.cart-total {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
    text-align: right;
}

.cart-total h4 {
    font-size: 1.5rem;
    color: #333;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #9a0167;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Components */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cart-item-quantity {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 5% auto;
        width: 98%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Component-specific styles */

/* File Upload Styling */
.upload-area {
    position: relative;
    overflow: hidden;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

/* Canvas Preview Styling */
#previewCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

/* Color Card Interactions */
.color-card.selected {
    border: 3px solid #667eea;
    background: #f0f4ff;
    transform: translateY(-5px) scale(1.02);
}

.color-card.selected h3 {
    color: #667eea;
}

/* Form Enhancements */
.form-group input:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 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 #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error States */
.success {
    border-color: #10b981;
    background: #f0fdf4;
}

.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.success-message {
    color: #10b981;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #10b981;
    margin-top: 1rem;
}

.error-message {
    color: #ef4444;
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ef4444;
    margin-top: 1rem;
}

.warning-message {
    color: #f59e0b;
    background: #fffbeb;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
    margin-top: 1rem;
}

/* Smooth Transitions */
.color-card,
.feature-card,
.pricing-card,
.upload-area {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effects */
.color-card:hover img {
    transform: scale(1.05);
}

.color-card img {
    transition: transform 0.3s ease;
}

/* Focus States for Accessibility */
.btn:focus,
.color-card:focus,
.upload-area:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .nav-menu a {
        font-size: 1.2rem;
        padding: 1rem 2rem;
        border-radius: 8px;
        transition: background 0.3s ease;
    }
    
    .nav-menu a:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .color-card {
        padding: 1rem;
    }
    
    .color-card img {
        width: 80px;
        height: 96px;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .footer,
    .btn {
        display: none;
    }
    
    .hero,
    .features,
    .design-section,
    .colors-section,
    .pricing-section,
    .contact-section {
        padding: 20px 0;
        background: white;
    }
    
    .color-card,
    .feature-card,
    .pricing-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}