/* Boxland - Main Styles */

/* Header - Dribbble-like Animation */
header {
    position: fixed;
    width: 100%;
    padding: 0;
    background-color: var(--white);
    box-shadow: none;
    top: 0;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    height: 70px;
    /* Initial header height */
}

header.scrolled {
    background-color: white;
    height: 90px;
    /* Increased header height on scroll for Dribbble-like effect */
    /* box-shadow: var(--shadow-sm); */
}

.header-inner {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    height: 100%;
}

/* Logo with animation */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: var(--transition);
}

.logo img {
    height: 6.2rem;
    transition: var(--transition);
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    transition: var(--transition);
}

header.scrolled .logo img {
    height: 6.8rem;
    /* Larger logo on scroll */
}

header.scrolled .logo h1 {
    font-size: 2.6rem;
    /* Larger title on scroll */
}

/* Navigation */
nav {
    transition: var(--transition);
}

nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
    transition: var(--transition);
}

nav a {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--gray-800);
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    transition: var(--transition);
}

header.scrolled nav a {
    font-size: 1.6rem;
    /* Slightly larger text on scroll */
}

nav a:hover {
    color: var(--primary);
    background-color: var(--gray-100);
}

nav a.highlight {
    background-color: var(--primary);
    color: white;
}

nav a.highlight:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.profile-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
}

/* Spacer to compensate for fixed header */
main {
    padding-top: 70px;
    /* Match header height */
    transition: padding-top 0.3s ease;
}

/* Header Search Bar */
.header-inner .search-bar.header-search {
    position: absolute;
    left: 240px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    max-width: 300px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--gray-200);
    padding: 0.6rem 0.8rem 0.6rem 1.5rem;
    border-radius: 100px;
    border: none;
    box-shadow: none;
}

.header-inner .search-bar.header-search.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.header-inner .search-bar.header-search input {
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    line-height: 1.2;
}

.header-inner .search-bar.header-search button {
    padding: 1rem 1rem;
    border-radius: 100px;
}

/* Hero Search Section */
.hero-search {
    padding: var(--spacing-xl) 0;
    text-align: center;
    margin-bottom: var(--spacing-md);
    transition: opacity 0.3s ease;
}

.hero-search h2 {
    font-size: 3.6rem;
    margin-bottom: var(--spacing-sm);
    color: var(--dark);
}

.hero-search p {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    color: var(--gray-500);
}

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 100px;
    display: flex;
    align-items: center;
    padding: 0.6rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.search-bar:focus-within {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.search-bar input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 1.5rem 2rem;
    font-size: 1.6rem;
    outline: none;
    color: var(--gray-800);
}

.search-bar input::placeholder {
    color: var(--gray-500);
}

.search-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 1.2rem 1.2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Filters Section */
.filters {
    margin: var(--spacing-lg) auto;
    text-align: center;
}

.filters h2 {
    font-size: 2.8rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
}

.filter-btn {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-800);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1.4rem;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Products Section */
.product-list {
    margin-bottom: var(--spacing-xl);
}

.product-list h2 {
    font-size: 2.6rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: var(--spacing-lg);
}

/* Product Card */
.product {
    /* background: white; */
    border-radius: var(--border-radius);
    overflow: hidden;
    /* box-shadow: var(--shadow-sm); */
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.product-images {
    position: relative;
    background-color: var(--gray-200);
    height: 240px;
    overflow: hidden;
}

.product-images>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product:hover .product-images>img {
    transform: scale(1.05);
}

.product-images::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
    opacity: 0;
    transform: translateY(40%);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    /* So it doesn't interfere with clicks */
    z-index: 5;
}

.product:hover .product-images::after {
    opacity: 1;
    transform: translateY(0);
}

/* Category Tag */
.category-tag {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    z-index: 10;
}

/* Thumbnail Gallery */
/* Update the thumbnail gallery to have higher z-index */
.thumbnail-gallery {
    position: absolute;
    bottom: var(--spacing-sm);
    right: 20px;
    width: 100%;
    display: flex;
    justify-content: right;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 6;
    /* Ensure thumbnails appear above the overlay */
}

/* Enhance thumbnail visibility against the dark background */
.thumbnail-gallery img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    /* Slightly thicker border */
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    /* Add slight shadow to stand out */
}

.product:hover .thumbnail-gallery {
    opacity: 1;
    transform: translateY(0);
}


.thumbnail-gallery img:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-sm);
}

/* Product Info */
.product-info {
    padding: var(--spacing-md) 0;
}

.product h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.product-description {
    font-size: 1.4rem;
    color: var(--gray-500);
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Product Modal */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    backdrop-filter: blur(8px);
    padding: 60px 0 0;
}

.product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear;
}

.product-modal {
    background-color: var(--white);
    width: 100%;
    height: calc(100vh - 60px);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.product-modal-overlay.active .product-modal {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: -45px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-800);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: var(--white);
    transform: scale(1.1);
    color: var(--primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 2.4rem;
    margin: 0;
    color: var(--dark);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
}

.modal-add-to-cart {
    background: var(--primary);
    color: white;
    padding: 1.2rem 2rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1.6rem;
    transition: var(--transition);
}

.modal-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.modal-main-image {
    flex: 1;
    position: relative;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.modal-category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    z-index: 2;
}

.modal-gallery {
    display: flex;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    overflow-x: auto;
    gap: var(--spacing-sm);
}

.modal-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    flex-shrink: 0;
}

.modal-thumbnail:hover,
.modal-thumbnail.active {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--white);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
}

.footer-content {
    text-align: center;
}

.copyright {
    font-size: 1.4rem;
    color: var(--gray-500);
}