/* Fix hero section overlap with fixed navbar on all devices */
.hero-section {
    scroll-margin-top: 90px;
}

@media (min-width: 992px) {
    .hero-section {
        padding-top: 100px;
    }
}

@media (max-width: 991.98px) {
    .hero-section {
        padding-top: 80px;
    }
}

/* Global Styles */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #333333;
    --success-color: #2a2a2a;
    --warning-color: #404040;
    --danger-color: #262626;
    --dark-color: #000000;
    --light-gray: #f5f5f5;
    --medium-gray: #888888;
    --dark-gray: #4a4a4a;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #1a1a1a, #333333);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--white);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--primary-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: loadingSpin 1s linear infinite;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

@keyframes loadingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced filter button states during loading */
.filter-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}


/* Navigation */
.glass-nav {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--white) !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--white) !important;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--light-gray) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--white);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Custom navbar toggler for mobile */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

/* Swiper Slider Styles */
.swiper {
    width: 100%;
    height: auto;
    margin: 20px 0;
    padding: 20px 0;
}

.swiper-slide {
    height: auto;
    display: flex;
    align-items: stretch;
}

.swiper-slide .product-card {
    height: 100%;
    width: 100%;
    margin: 0;
}

/* Custom Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: var(--white);
    background: var(--dark-color);
    opacity: 0.8;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--secondary-color);
    color: var(--white);
    opacity: 1;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

/* Custom Swiper Pagination */
.swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.swiper-pagination-bullet {
    background: var(--medium-gray);
}

.swiper-pagination-bullet-active {
    background: var(--dark-color);
}

/* Slider Container Styling */
.category-section {
    position: relative;
    padding: 2rem 0;
}

.category-section:hover .swiper-button-next,
.category-section:hover .swiper-button-prev {
    opacity: 1;
}

.swiper-button-next,
.swiper-button-prev {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Auto-play indicator */
.swiper-autoplay-progress {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
}

.swiper-autoplay-progress svg {
    --progress: 0;
    position: absolute;
    left: 0;
    top: 0px;
    z-index: 10;
    width: 100%;
    height: 100%;
    stroke-width: 4px;
    stroke: var(--primary-color);
    fill: none;
    stroke-dashoffset: calc(125.6px * (1 - var(--progress)));
    stroke-dasharray: 125.6;
    transform: rotate(-90deg);
}

/* Responsive Slider Settings */
@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 40px;
        height: 40px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 14px;
    }
}

/* Slider Animation Effects */
.swiper-slide-active .product-card {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.swiper-slide .product-card {
    transition: all 0.3s ease;
}

/* Loading State for Sliders */
.swiper-loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.swiper-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}



/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    color: var(--white);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, -30px) rotate(120deg); }
    66% { transform: translate(30px, -60px) rotate(240deg); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--white);
    background: none;
    -webkit-text-fill-color: var(--white);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--light-gray);
    margin-bottom: 2rem;
}

.hero-buttons .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    background: var(--dark-color);
    border: none;
    box-shadow: var(--shadow);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline-primary {
    color: var(--dark-color);
    border: 2px solid var(--dark-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--dark-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Exception for buttons in dark sections */
.hero-section .btn-outline-primary,
.featured-banner .btn-outline-primary,
.cta-section .btn-outline-primary {
    color: var(--white);
    border-color: var(--white);
}

.hero-section .btn-outline-primary:hover,
.featured-banner .btn-outline-primary:hover,
.cta-section .btn-outline-primary:hover {
    background: var(--white);
    color: var(--dark-color);
}

/* Stats Section */
.stats-section {
    margin-top: 3rem;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 0;
}

/* Featured Banner */
.featured-banner {
    background: var(--dark-color) !important;
    animation: none;
}

/* Categories Section */
.categories-section {
    padding: 5rem 0;
}

.category-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.category-card:hover {
    background: var(--dark-color);
    color: var(--white);
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    background: var(--dark-color);
    color: var(--white);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.category-icon i {
    font-size: 2rem;
    color: var(--white);
}

.category-card:hover .category-icon {
    background: var(--white);
    color: var(--dark-color);
    transform: scale(1.1);
}

.category-card:hover .category-icon i {
    color: var(--dark-color);
}

/* Page Header */
.page-header {
    background: var(--light-gray);
    padding: 100px 0 10px;
    text-align: center;
}

/* Sections */
.products-section {
    padding: 80px 0;
}

.bg-light-gray {
    background-color: var(--light-gray);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Product Cards */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: none;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover img {
    transform: scale(1.1);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.card-text {
    color: var(--dark-gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Star Rating Styles */
.rating-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.stars {
    color: #FFD700;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.4);
}

.rating-count {
    color: var(--dark-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Price and Badge Container */
.price-badge-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
}

/* Reviews Section */
.reviews-section {
    padding: 5rem 0;
}

.review-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.review-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.review-stars {
    margin-bottom: 1rem;
}

.review-text {
    font-style: italic;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.reviewer-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.reviewer-title {
    color: var(--dark-gray);
}

/* CTA Section */
.cta-section {
    background: var(--dark-color);
    color: var(--white);
}

.cta-section .btn-light {
    background: var(--white);
    color: var(--dark-color);
}

.cta-section .btn-light:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease forwards;
}

.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: var(--white);
}

.footer h5,
.footer h6 {
    color: white;
    margin-bottom: 1rem;
}

.footer a {
    color: var(--light-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--white);
    text-decoration: none;
}

.social-links a {
    color: var(--white) !important;
    transition: var(--transition);
}

.social-links a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        padding-top: 100px;
        min-height: 90vh;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .card-buttons {
        flex-direction: column;
    }

    .btn-sm {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .price-badge-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rating-section {
        flex-wrap: wrap;
        gap: 6px;
    }

    .stars {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .rating-count {
        font-size: 0.8rem;
    }

    .category-icon {
        width: 60px;
        height: 60px;
    }

    .category-icon i {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-section {
        padding-top: 100px;
        min-height: 90vh;
    }

    .product-card img {
        height: 150px;
    }

    .card-body {
        padding: 1rem;
    }

    .template-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .price {
        font-size: 1.3rem;
    }

    .stars {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .category-title {
        font-size: 1.5rem;
    }
}

/* Special Effects for Premium Cards */
.product-card:has(.badge-premium) {
    position: relative;
}

.product-card:has(.badge-premium):hover {
    box-shadow: 0 25px 50px rgba(255, 107, 107, 0.2);
}

.product-card:has(.badge-premium)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(255, 142, 83, 0.05));
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    border-radius: var(--border-radius);
}

.product-card:has(.badge-premium):hover::before {
    opacity: 1;
}

/* Search and Filter Enhancements */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--medium-gray);
    border-radius: 25px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

/* Featured Templates Section Styles */
.featured-templates-section {
    background-color: var(--background-light);
    padding: 80px 0;
}

.template-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.template-card:hover {
    transform: translateY(-5px);
}

.template-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-card:hover .template-image img {
    transform: scale(1.05);
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.template-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.template-info {
    padding: 1.5rem;
}

.template-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.price {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.rating i {
    color: #ffc107;
}

.template-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive styles for templates */
@media (max-width: 768px) {
    .template-card {
        margin-bottom: 2rem;
    }
    
    .template-info h3 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1rem;
    }
}

/* Fix for filter button active state */
.filter-btn {
    transition: var(--transition);
}

.filter-btn.active {
    background-color: var(--dark-color) !important;
    color: var(--white) !important;
    border-color: var(--dark-color) !important;
}
