/* Demo1 Integration CSS - Bridge between Template1 and Demo1 functionality */

/* Fix for overlapping navigation bars */
#templatemo_nav_top {
    position: relative;
    z-index: 1030;
    margin-bottom: 0;
}

.navbar.navbar-expand-lg.navbar-light.shadow {
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-top: 0;
    background: white;
}

/* Smooth loading and prevent flickering */
body {
    margin: 0;
    padding: 0;
    padding-top: 0 !important; /* Override the 70px padding from original style.css */
}

html {
    margin: 0;
    padding: 0;
}

/* Stable navigation positioning */
#templatemo_nav_top {
    margin-top: 0;
    padding-top: 0;
    position: relative;
    z-index: 1030;
}

.navbar.navbar-expand-lg.navbar-light.shadow {
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-top: 0;
    background: white;
    min-height: 76px; /* Prevent layout shift */
}

/* Prevent layout shifts */
.container {
    margin-top: 0;
    padding-top: 0;
}

/* Smooth transitions for dynamic content */
.carousel-item {
    transition: transform 0.6s ease-in-out;
}

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Optimize rendering */
* {
    box-sizing: border-box;
}

/* Remove aggressive overrides that can cause conflicts */
.navbar:first-child {
    margin-top: 0;
}

/* Fix container alignment */
.navbar .container {
    position: relative;
}

/* Ensure navigation items are properly positioned */
.navbar-nav {
    position: relative;
    z-index: 1025;
}

/* Fix for mobile navigation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        border: 1px solid #eee;
        border-radius: 0.375rem;
        margin-top: 0.5rem;
        padding: 1rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .navbar.navbar-expand-lg.navbar-light.shadow {
        position: relative;
    }
}

/* Navigation Fixes */
.navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
    display: block !important;
    visibility: visible !important;
}

.navbar-nav .nav-link:hover {
    color: #59ab6e !important;
}

.navbar-collapse {
    flex-grow: 1;
}

.navbar-collapse.show {
    display: flex !important;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Ensure navigation visibility */
.navbar-nav {
    visibility: visible;
    opacity: 1;
}

.nav-item {
    visibility: visible;
}

/* Override any template conflicts */
.navbar-expand-lg .navbar-nav {
    flex-direction: row;
}

.navbar-expand-lg .navbar-collapse {
    display: flex;
    flex-basis: auto;
}

/* Mobile Navigation */
@media (max-width: 991.98px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Icon spacing and visibility */
.nav-link i {
    margin-right: 0.5rem;
}

/* Preserve existing demo1 functionality while applying template1 styling */

/* Cart badge styling to work with template1 */
.nav-item-with-badge {
    position: relative;
}

.nav-item-with-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #59ab6e;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 18px;
    text-align: center;
}

/* 3D Model Viewer Integration */
model-viewer {
    width: 100%;
    height: 400px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Custom Print Shop specific styles */
.customization-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Product actions for customizable items */
.product-actions-detail {
    margin-top: 20px;
}

.add-to-cart-btn {
    background: #59ab6e;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #4a9660;
    color: white;
    text-decoration: none;
}

/* Auth forms styling */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 40px;
}

.auth-header h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #59ab6e;
    box-shadow: 0 0 5px rgba(89, 171, 110, 0.3);
}

.btn-primary {
    background: #59ab6e;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background: #4a9660;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: #59ab6e;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Cart styling */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cart-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 15px;
}

/* Breadcrumbs styling */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #59ab6e;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Alert messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .cart-container {
        padding: 10px;
    }
    
    model-viewer {
        height: 300px;
    }
}

/* Product image styling */
.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card {
    transition: box-shadow 0.3s ease;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Ensure consistent card heights */
.card.h-100 {
    display: flex;
    flex-direction: column;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body .mt-auto {
    margin-top: auto !important;
}

/* Product image fallback styling */
.card-img-top.bg-light {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
}

/* Featured products section styling */
.featured-products .card {
    border-radius: 0.5rem;
}

.featured-products .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}
