/* ===== CUSTOM CSS FOR TECHSTORE E-COMMERCE ===== */

/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Navigation Styles */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Hero Section */
.hero-section {
    position: relative;
}

.carousel-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.carousel-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.carousel-inner {
    position: relative;
    z-index: 1;
}

.min-vh-75 {
    min-height: 75vh;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: transform 0.3s ease;
}

.feature-icon:hover {
    transform: translateY(-5px);
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-lg);
}

.product-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    text-decoration: none;
    flex-grow: 1;
}

.product-title:hover {
    color: var(--primary-color);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-rating {
    margin-bottom: 1rem;
}

.rating-stars {
    color: var(--warning-color);
    margin-right: 0.5rem;
}

.rating-count {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.btn-add-to-cart {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-cart:hover {
    background: linear-gradient(45deg, var(--info-color), var(--primary-color));
    transform: translateY(-2px);
}

.btn-quick-view {
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Category Buttons */
.category-btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.category-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart Modal */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.25rem;
}

/* Search Functionality */
.search-highlight {
    background-color: var(--warning-color);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Social Links */
.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    line-height: 40px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

/* Product Filter Animation */
.product-item {
    transition: all 0.3s ease;
}

.product-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .carousel-bg {
        min-height: 70vh;
        text-align: center;
    }
    
    .hero-section .col-lg-6:last-child {
        margin-top: 2rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .category-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
    
    .product-image {
        height: 200px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Tablet Specific */
@media (min-width: 768px) and (max-width: 1024px) {
    .carousel-bg {
        min-height: 80vh;
    }
    
    .product-image {
        height: 220px;
    }
}

/* Desktop Enhancements */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .product-image {
        height: 280px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    .btn,
    .modal,
    footer {
        display: none !important;
    }
    
    .product-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .product-card:hover {
        transform: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .carousel-item {
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #2d3748 !important;
        color: #fff;
    }
    
    .product-card {
        background-color: #4a5568;
        color: #fff;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #718096;
        color: #fff;
    }
}

/* Custom Utilities */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-color), var(--info-color)) 1;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Success/Error Messages */
.alert-custom {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-success-custom {
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-error-custom {
    background: linear-gradient(45deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--info-color);
}

/* Checkout Modal Styles */
.checkout-steps {
    position: relative;
}

.step-card {
    display: none;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.step-card.active {
    display: block;
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.step-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.step-header h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

.step-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.order-summary-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 20px;
}

.security-badges {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

/* Payment Method Styles */
.payment-methods .form-check {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.payment-methods .form-check:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.payment-methods .form-check-input:checked + .form-check-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Stripe Elements Styling */
#card-element {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.3s ease;
}

#card-element:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Order Items Styles */
.order-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
}

.order-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
}

.order-item-details {
    flex-grow: 1;
}

.order-item-details h6 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.order-item-details p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.order-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

/* Orders History Styles */
.order-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.order-number {
    font-weight: 700;
    color: var(--primary-color);
}

.order-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.processing {
    background: #cce5ff;
    color: #004085;
}

.order-status.shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.order-status.delivered {
    background: #d4edda;
    color: #155724;
}

.order-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.order-items-preview {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.order-item-preview {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.order-item-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Progress Steps */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.checkout-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #dee2e6;
    z-index: 1;
}

.progress-step {
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    z-index: 2;
    position: relative;
}

.progress-step.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.progress-step.completed {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

/* Responsive Checkout */
@media (max-width: 768px) {
    .checkout-steps {
        padding: 0;
    }
    
    .step-card {
        padding: 1rem;
    }
    
    .order-summary-card {
        position: static;
        margin-top: 2rem;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .order-items-preview {
        flex-wrap: wrap;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Order Confirmation Styles */
.order-confirmation-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.confirmation-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.confirmation-item:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--primary-color);
}