/* Archibite - Architecture Marketplace Styles */

/* Typography - Toffu.co inspired clean minimal style */
:root {
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
}

body {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    background-color: var(--beige-bg);
}

/* Heading Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h1, .h1 {
    font-weight: var(--font-weight-bold);
    font-size: 2.5rem;
}

h2, .h2 {
    font-weight: var(--font-weight-semibold);
    font-size: 2rem;
}

h3, .h3 {
    font-weight: var(--font-weight-semibold);
    font-size: 1.5rem;
}

h4, .h4 {
    font-weight: var(--font-weight-medium);
    font-size: 1.25rem;
}

h5, .h5 {
    font-weight: var(--font-weight-medium);
    font-size: 1.125rem;
}

h6, .h6 {
    font-weight: var(--font-weight-medium);
    font-size: 1rem;
}

/* Button Typography */
.btn {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: -0.01em;
    font-size: 0.9rem;
}

.btn-lg {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
}

.btn-sm {
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
}

/* Navigation Typography */
.navbar-brand {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold) !important;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.nav-link {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

/* Card and Text Elements */
.card-title {
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
}

.card-text {
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
}

.text-muted {
    font-weight: var(--font-weight-normal);
}

/* Form Elements */
.form-label {
    font-weight: var(--font-weight-medium);
    font-size: 0.9rem;
}

.form-control, .form-select {
    font-family: var(--font-family-primary);
    font-size: 0.9rem;
    font-weight: var(--font-weight-normal);
}

/* Lead Text */
.lead {
    font-size: 1.1rem;
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
}

/* Display Typography */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
}

/* Small Text */
small, .small {
    font-size: 0.8rem;
    font-weight: var(--font-weight-normal);
}

/* Category Filter Styling */
.category-filters .nav-pills .nav-link {
    color: var(--dark-green);
    background: transparent;
    border: 1px solid var(--border-color);
    margin: 0 0.25rem;
    font-weight: var(--font-weight-medium);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: var(--transition);
}

.category-filters .nav-pills .nav-link:hover {
    background-color: var(--beige-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.category-filters .nav-pills .nav-link.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-filters .nav-pills .nav-link i {
    font-size: 0.8rem;
}

/* Responsive category filters */
@media (max-width: 768px) {
    .category-filters .nav-pills {
        flex-wrap: wrap;
        justify-content: center !important;
    }
    
    .category-filters .nav-pills .nav-link {
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Nested Dropdown Menu Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
    margin-top: 0;
    margin-left: -1px;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    border-radius: 0 6px 6px 6px;
    display: none !important;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block !important;
}

.dropdown-submenu .dropdown-toggle::after {
    transform: rotate(-90deg);
    float: right;
    margin-top: 8px;
}

/* Category parent item with integrated dropdown button */
.category-parent-item {
    padding: 0;
    margin: 0;
}

.category-parent-item .dropdown-item {
    border: none;
    margin: 0;
    border-radius: 0;
}

.dropdown-toggle-btn {
    background: transparent;
    border: none;
    color: inherit;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-toggle-btn i {
    transition: transform 0.2s;
}

.dropdown-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.category-submenu .dropdown-menu {
    border: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.05);
}

.category-submenu .dropdown-item {
    padding-left: 3rem;
    font-size: 0.9rem;
}

/* Mobile responsive for nested dropdowns */
@media (max-width: 768px) {
    /* Clean mobile dropdown styling */
    .navbar-nav .dropdown-menu {
        padding: 0.5rem 0;
        box-sizing: border-box;
    }
    
    /* Prevent overflow */
    .navbar-nav .dropdown-menu * {
        box-sizing: border-box;
        max-width: 100%;
    }
    
    /* Category parent item - simple, no background */
    .category-parent-item {
        padding: 0;
        margin: 0;
        background-color: transparent;
        display: flex;
        align-items: stretch;
    }
    
    .category-parent-item .dropdown-item {
        color: white;
        padding: 0.75rem 1rem;
        margin: 0;
        border-radius: 0;
        flex-grow: 1;
        background-color: transparent;
        border: none;
    }
    
    .category-parent-item .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-toggle-btn {
        color: white;
        padding: 0.75rem 1rem;
        background-color: transparent;
        border: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        min-width: 44px;
    }
    
    .dropdown-toggle-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Category submenu on mobile */
    .category-submenu {
        background-color: rgba(0, 0, 0, 0.2);
    }
    
    .category-submenu .dropdown-menu {
        background-color: transparent;
        padding: 0.25rem 0;
        border: none;
        box-shadow: none;
    }
    
    .category-submenu .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.5rem 1rem 0.5rem 2.5rem;
        margin: 0;
        background-color: transparent;
        border: none;
    }
    
    .category-submenu .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    /* Hide desktop dropdown toggle arrows */
    .navbar .dropdown-toggle::after {
        display: none !important;
    }
    
    /* Categories without children styling */
    .navbar .dropdown-menu > li:not(.dropdown-submenu) > .dropdown-item {
        background-color: transparent;
        color: white;
        padding: 0.75rem 1rem;
        margin: 0;
    }
    
    .navbar .dropdown-menu > li:not(.dropdown-submenu) > .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Make categories dropdown wider for longer names */
.navbar .dropdown-menu {
    min-width: 250px;
}

/* Fix category filter dropdown positioning and z-index */
.card .btn-group {
    position: relative;
    z-index: 1050;
}

.card .btn-group .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0 !important;
    right: auto !important;
    z-index: 1051 !important;
    min-width: 180px;
    margin-top: 2px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    background-color: white;
    transform: none !important;
}

.card .btn-group .dropdown-toggle-split {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Force dropdown to appear on left side */
.card .btn-group .dropdown-menu.show {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 100% !important;
    transform: translate(0, 0) !important;
}

/* Ensure dropdowns don't get cut off */
.card-body {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.card {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.card.bg-light {
    overflow: visible !important;
    z-index: 1000;
}

/* Make sure the categories section container doesn't clip dropdowns */
.container {
    overflow: visible !important;
}

.row {
    overflow: visible !important;
}

:root {
    --beige-bg: #F8E2D1;
    --beige-light: #dcbfa8;
    --beige-dark: #ae7d54;
    --dark-green: #173425;
    --medium-green: #506c60;
    --light-green: #506c60;
    --terracotta: #c06145;
    --terracotta-light: #d4815f;
    --terracotta-dark: #8b4632;
    --text-dark: #1a1a1a;
    --text-dark-green: #173425;
    --text-light: #506c60;
    --border-color: #dcbfa8;
    --shadow: 0 2px 15px rgba(23, 52, 37, 0.1);
    --shadow-hover: 0 8px 30px rgba(23, 52, 37, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* New Color Scheme Buttons */
.btn-dark-green {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
    color: white;
}

.btn-dark-green:hover {
    background-color: var(--medium-green);
    border-color: var(--medium-green);
    color: white;
}

.btn-terracotta {
    background-color: var(--terracotta);
    border-color: var(--terracotta);
    color: white;
}

.btn-terracotta:hover {
    background-color: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
    color: white;
}

.btn-beige {
    background-color: var(--beige-light);
    border-color: var(--beige-dark);
    color: var(--text-dark);
}

.btn-beige:hover {
    background-color: var(--beige-dark);
    border-color: var(--beige-dark);
    color: var(--text-dark);
}

.btn-outline-dark-green {
    color: var(--dark-green);
    border-color: var(--dark-green);
}

.btn-outline-dark-green:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
    color: white;
}

/* Override Bootstrap primary color for legacy support */
.btn-primary {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

.btn-primary:hover {
    background-color: var(--medium-green);
    border-color: var(--medium-green);
}

.bg-primary {
    background-color: var(--dark-green) !important;
}

.text-primary {
    color: var(--dark-green) !important;
}

.btn-outline-primary {
    color: var(--dark-green);
    border-color: var(--dark-green);
}

.btn-outline-primary:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* New Color Classes */
.text-dark-green {
    color: var(--dark-green) !important;
}

.text-terracotta {
    color: var(--terracotta) !important;
}

.bg-terracotta {
    background-color: var(--terracotta) !important;
}

.text-beige {
    color: var(--beige-dark) !important;
}

.bg-beige {
    background-color: var(--beige-bg) !important;
}

.bg-beige-light {
    background-color: var(--beige-light) !important;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--beige-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    transition: var(--transition);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
    transform: translateY(-1px);
}

/* Hero Banner Gallery - Toffu Style */
.hero-banner-gallery {
    position: relative;
    height: 900px;
    overflow: hidden;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
}

.banner-slide::before {
    content: '';
    position: absolute;
    inset: -5%;
    background: inherit;
    background-size: cover !important;
    background-position: center !important;
    animation: heroBannerZoom 18s ease-in-out infinite alternate;
    z-index: 0;
}

.banner-slide .container {
    position: relative;
    z-index: 1;
}

@keyframes heroBannerZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

.banner-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-banner-content {
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-banner-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    color: #ffffff !important;
}

.hero-banner-subtitle {
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
    color: #ffffff !important;
}

.hero-banner-description {
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #ffffff !important;
}

/* Legacy Banner Gallery */
.banner-gallery {
    position: relative;
    height: 750px;
    overflow: hidden;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.banner-content {
    z-index: 2;
}

.banner-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.banner-image {
    text-align: center;
    opacity: 0.7;
}

.banner-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: white;
    transform: scale(1.2);
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Hero Section */
.hero-section {
    background-color: var(--beige-light);
    position: relative;
}

.hero-illustration {
    text-align: center;
    padding: 2rem;
}

.architecture-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.grid-item {
    width: 60px;
    height: 60px;
    background-color: var(--beige-bg);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    background-color: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Product Cards */
.product-card {
    height: 100%;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-card .card-img-top {
    transition: var(--transition);
    background-color: var(--light-gray);
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    overflow: hidden;
}

#featured-products-container .row,
#recent-products-container .row {
    display: flex;
    flex-wrap: wrap;
}

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

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.product-card .card-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Category Cards */
.category-card {
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.category-card .card-body {
    padding: 2rem 1.5rem;
}

.category-card i {
    transition: var(--transition);
}

.category-card:hover i {
    transform: scale(1.1);
    color: var(--terracotta) !important;
}

/* Stats Section */
.stats-section {
    background-color: var(--beige-light);
}

.stat-item {
    padding: 2rem 1rem;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-item i {
    transition: var(--transition);
}

.stat-item:hover i {
    transform: scale(1.1);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    border-width: 1px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--dark-green);
    box-shadow: 0 0 0 0.2rem rgba(45, 56, 33, 0.1);
}

.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
}

/* Rating Stars */
.rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating i {
    font-size: 0.875rem;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Pagination */
.pagination {
    --bs-pagination-border-radius: var(--border-radius);
}

.page-link {
    color: var(--dark-green);
    border-color: var(--border-color);
}

.page-link:hover {
    color: white;
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

.page-item.active .page-link {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--dark-green);
}

/* Footer */
footer {
    background-color: var(--text-dark) !important;
}

footer h5, footer h6 {
    color: white;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    transform: translateX(2px);
}

/* Social Links */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Upload Guidelines */
.upload-guidelines {
    background-color: var(--beige-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

/* Vendor Dashboard */
.vendor-stats .card {
    background: linear-gradient(135deg, var(--dark-green), var(--medium-green));
    color: white;
    border: none;
}

/* Featured Vendors */
.vendor-card {
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.vendor-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.vendor-stat {
    padding: 0.5rem;
}

.vendor-stat i {
    font-size: 1.25rem;
    display: block;
}

.vendor-stat .fw-bold {
    font-size: 1.5rem;
    line-height: 1.2;
}

/* Product Mini Previews */
.product-mini {
    transition: var(--transition);
    cursor: pointer;
}

.product-mini:hover {
    transform: scale(1.05);
}

.recent-products {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Cart */
.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

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

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .stats-section .stat-item {
        margin-bottom: 2rem;
    }
    
    .card-columns {
        column-count: 1;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #2c3e50;
        --text-dark: #ecf0f1;
        --text-light: #bdc3c7;
        --border-color: #34495e;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--dark-green);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Product Image Gallery */
.thumbnail-image {
    transition: var(--transition);
    border-width: 2px;
}

.thumbnail-image:hover {
    transform: scale(1.05);
    border-color: var(--dark-green) !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   (Desktop view remains unchanged)
   ============================================ */

/* Tablet and Mobile - General Improvements */
@media (max-width: 991px) {
    /* Better navbar spacing on tablets */
    .navbar-nav {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .navbar-nav .nav-item {
        padding: 0.25rem 0;
    }
    
    /* Improve dropdown touch targets */
    .navbar-nav .dropdown-menu {
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        background-color: #2c2c2c;
        margin-top: 0.5rem;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100%;
        overflow-y: visible;
        overflow-x: hidden;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Fix dropdown text color */
    .navbar-nav .dropdown-menu .dropdown-item {
        color: #fff;
        padding: 0.75rem 1.25rem;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item i {
        color: #fff;
    }
    
    /* Fix dropdown showing */
    .navbar-nav .dropdown.show .dropdown-menu {
        display: block;
    }
}

/* Collapse button styling for filters and sort */
.card-header .btn-link .fa-chevron-down {
    transition: transform 0.3s ease;
}

.card-header .btn-link.collapsed .fa-chevron-down {
    transform: rotate(0deg);
}

.card-header .btn-link:not(.collapsed) .fa-chevron-down {
    transform: rotate(180deg);
}

/* Mobile sort and filter cards - consistent styling */
@media (max-width: 991px) {
    .card-header .btn-link {
        padding: 0.5rem 0;
    }
    
    #sortCollapse:not(.show),
    #filtersCollapse:not(.show) {
        display: none !important;
    }
    
    /* Sort dropdown list styling */
    #sortCollapse .list-group {
        margin: 0;
    }
    
    #sortCollapse .list-group-item {
        border: none;
        border-radius: 6px;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    #sortCollapse .list-group-item:last-child {
        margin-bottom: 0;
    }
    
    #sortCollapse .list-group-item.active {
        background-color: var(--primary);
        border-color: var(--primary);
        color: #000000 !important;
        font-weight: 600;
    }
    
    /* Closer spacing between sort and filters dropdowns */
    .mobile-sort-card {
        margin-bottom: 0.1rem !important;
    }
    
    .col-lg-3.mb-4 {
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Reduce spacing below search/sort section on mobile */
    .row.mb-4 {
        margin-bottom: 0.5rem !important;
    }
}

/* Mobile Devices - Comprehensive Optimizations */
@media (max-width: 768px) {
    /* Typography - Better readability on mobile */
    body {
        font-size: 14px;
    }
    
    p, .card-text {
        font-size: 0.9rem;
    }
    
    h1, .h1, .display-4 {
        font-size: 2.25rem !important;
        line-height: 1.2;
    }
    
    h2, .h2 {
        font-size: 2rem !important;
        line-height: 1.3;
    }
    
    h3, .h3 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Hero Banner - Mobile responsive */
    .hero-banner-gallery {
        height: 500px !important;
    }
    
    .hero-banner-title {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
    }
    
    .hero-banner-subtitle {
        font-size: 0.75rem !important;
    }
    
    .hero-banner-description {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    /* Hide old banner gallery section on mobile */
    .banner-gallery {
        display: none !important;
    }
    
    .banner-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem;
    }
    
    .banner-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    /* Hero Section - Mobile friendly with background image */
    .hero-section {
        background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                          url('/static/images/Architect_workspace_with_tools_4bde57e1.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        padding: 4rem 1.5rem !important;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .hero-section .display-4 {
        font-size: 3.5rem !important;
        font-weight: 800 !important;
        line-height: 1.1;
        margin-bottom: 1.5rem !important;
        color: #ffffff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .hero-section .lead {
        font-size: 1.05rem;
        margin-bottom: 2rem;
        line-height: 1.6;
        color: #ffffff !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .hero-section .btn {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    }
    
    /* Hide the illustration image on mobile since it's now the background */
    .hero-illustration {
        display: none;
    }
    
    /* Center the content on mobile */
    .hero-section .row {
        justify-content: center;
    }
    
    .hero-section .col-lg-6 {
        text-align: center;
    }
    
    /* Buttons - Larger touch targets */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
        min-height: 48px;
    }
    
    .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    /* Button groups - Stack vertically on mobile */
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    /* Cards - Better mobile spacing */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 16px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
    }
    
    .card-footer {
        padding: 1rem 1.25rem;
    }
    
    /* Product Cards - Optimized layout */
    .product-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .product-card .card-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .product-card .card-img-top {
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    
    /* Product price and rating - Better mobile display */
    .product-card .fw-bold.text-dark-green {
        font-size: 1.5rem;
    }
    
    .product-card .d-flex.justify-content-between {
        margin-top: 1rem;
        align-items: flex-end;
    }
    
    .product-card .rating {
        font-size: 0.9rem;
    }
    
    /* Category Cards - Better mobile presentation */
    .category-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .category-card i {
        font-size: 2.5rem !important;
    }
    
    .category-card .card-title {
        font-size: 1rem;
        margin-top: 0.75rem;
    }
    
    /* Stats Section - Mobile spacing */
    .stats-section .stat-item {
        padding: 1.5rem 0.5rem;
        margin-bottom: 1rem;
    }
    
    .stats-section .stat-item i {
        font-size: 2.5rem !important;
    }
    
    .stats-section .stat-item h3 {
        font-size: 1.75rem !important;
        margin-top: 0.5rem;
    }
    
    /* Forms - Mobile friendly inputs */
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.875rem 1rem;
        min-height: 48px;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Form groups spacing */
    .mb-3 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Tables - Horizontal scroll on mobile */
    .table-responsive {
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    /* Navigation - Better mobile menu */
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-brand img {
        height: 32px;
        width: auto;
    }
    
    .navbar-toggler {
        padding: 0.5rem;
        font-size: 1.25rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Reorder navbar: search on top, then menu items */
    .navbar-collapse {
        display: flex;
        flex-direction: column;
    }
    
    /* Put search form first */
    .navbar-collapse > .mx-auto {
        order: -1;
        max-width: 100% !important;
        margin: 0 0 1rem 0 !important;
        width: 100%;
    }
    
    /* Make menu items appear side by side */
    .navbar-collapse > .navbar-nav:first-of-type {
        order: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }
    
    .navbar-collapse > .navbar-nav:first-of-type .nav-item {
        flex: 1 1 auto;
        min-width: 80px;
    }
    
    .navbar-collapse > .navbar-nav:first-of-type .nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
        text-align: center;
    }
    
    /* Categories dropdown stays in same row */
    .navbar-collapse > .navbar-nav:first-of-type .nav-item.dropdown {
        flex: 1 1 auto;
        text-align: center;
    }
    
    .navbar-collapse > .navbar-nav:first-of-type .nav-item.dropdown .nav-link {
        justify-content: center;
    }
    
    .navbar-collapse > .navbar-nav:last-of-type {
        order: 1;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.75rem;
    }
    
    .navbar-collapse > .navbar-nav:last-of-type .nav-item {
        flex: 0 0 auto;
    }
    
    /* Make search input full width on mobile */
    .navbar-collapse .d-flex {
        width: 100%;
        gap: 0.5rem;
    }
    
    .navbar-collapse .d-flex input {
        min-width: 0 !important;
        flex: 1;
    }
    
    .navbar-collapse .d-flex .btn {
        flex-shrink: 0;
        width: auto;
        min-width: 44px;
    }
    
    /* Search and filters - Mobile optimized */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 12px !important;
        margin-bottom: 0.5rem;
    }
    
    .input-group .btn {
        width: 100%;
        border-radius: 12px !important;
    }
    
    /* Alerts - Mobile friendly */
    .alert {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    /* Pagination - Better touch targets */
    .pagination .page-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Breadcrumbs - Mobile spacing */
    .breadcrumb {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Rating stars - Larger on mobile */
    .rating i {
        font-size: 1rem;
    }
    
    /* Product grid - Better mobile columns */
    .row > [class*='col-'] {
        margin-bottom: 1.5rem;
    }
    
    /* Vendor dashboard - Mobile layout */
    .vendor-stats .card {
        margin-bottom: 1rem;
    }
    
    /* Cart items - Mobile friendly */
    .cart-item {
        padding: 1.25rem 0;
    }
    
    .cart-item img {
        max-width: 80px;
        margin-bottom: 1rem;
    }
    
    /* Cart layout - Stack properly on mobile */
    .cart-item .row > div {
        margin-bottom: 0.75rem;
    }
    
    .cart-item .col-md-2:first-child {
        flex: 0 0 100px;
        max-width: 100px;
    }
    
    .cart-item .col-md-6 {
        flex: 1;
    }
    
    .cart-item .col-md-2.text-center,
    .cart-item .col-md-2.text-end {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 1rem;
        padding-left: 100px;
    }
    
    .cart-item .col-md-2.text-center {
        justify-content: flex-start;
    }
    
    .cart-item .col-md-2.text-center span {
        font-size: 1.25rem;
        margin-right: auto;
    }
    
    .cart-item .col-md-2.text-end {
        position: absolute;
        right: 15px;
        bottom: 15px;
        width: auto;
        flex: none;
        max-width: none;
        margin-top: 0;
        padding-left: 0;
    }
    
    /* Upload area - Mobile optimized */
    .upload-area {
        padding: 2rem 1rem;
        min-height: 200px;
    }
    
    /* CTA Section - Full screen on mobile */
    .cta-section {
        min-height: 100vh !important;
        padding: 4rem 0 !important;
    }
    
    .cta-section h2 {
        font-size: 3.5rem !important;
        line-height: 1.2;
        color: #ffffff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .cta-section .lead {
        font-size: 1.15rem !important;
        line-height: 1.6;
        color: #ffffff !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    }
}

/* Small Mobile Devices - Extra Optimizations */
@media (max-width: 576px) {
    /* Even better spacing for small phones */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Sections spacing */
    section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Typography adjustments */
    body {
        font-size: 14px;
    }
    
    p {
        font-size: 0.85rem;
    }
    
    h1, .h1, .display-4 {
        font-size: 2rem !important;
    }
    
    h2, .h2 {
        font-size: 1.75rem !important;
    }
    
    /* Banner - Compact for small screens */
    .banner-gallery {
        height: 450px;
    }
    
    .banner-title {
        font-size: 1.35rem !important;
    }
    
    .banner-subtitle {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    /* Cards - Full width on small screens (except product grid) */
    .stats-section .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Product cards - Two columns on small screens */
    .product-card {
        margin-bottom: 1.25rem;
    }
    
    /* Category grid - 2 columns max */
    .category-card {
        margin-bottom: 1rem;
    }
    
    /* Stats - Stack vertically */
    .stats-section .row {
        flex-direction: column;
    }
    
    /* Buttons - Full width */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 12px !important;
    }
    
    /* Modal - Full screen on small mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    /* Footer - Better mobile layout */
    footer .row > div {
        margin-bottom: 2rem;
    }
    
    /* Keep Account, Support, Legal side by side on mobile */
    footer .col-md-2 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    footer .social-links {
        justify-content: center;
    }
    
    /* First column (Archibite) and Browse section full width */
    footer .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Hide Browse section on small mobile to save space */
    footer .col-md-3:not(:first-child) {
        display: none;
    }
    
    /* Navbar brand - Smaller on tiny screens */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Hero buttons - Stack nicely */
    .hero-section .d-flex {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .hero-section .btn {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets */
    a, button, .btn, .nav-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .product-card:hover,
    .category-card:hover {
        transform: none;
    }
    
    /* Larger clickable areas */
    .dropdown-toggle {
        padding: 0.75rem 1.25rem;
    }
    
    /* Better form controls for touch */
    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }
    
    .form-check-label {
        padding-left: 0.5rem;
    }
}

/* Product Description Styling */
.product-description {
    line-height: 1.6;
}

.product-description p {
    margin: 0 0 0.75em;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-description ul,
.product-description ol {
    padding-left: 1.5em;
    margin: 0 0 0.75em;
}

.product-description a {
    color: var(--primary-green);
}
