/* /style.css */

/* --- Base & Variables --- */
:root {
    --primary-color: #6a5af9;
    --secondary-color: #f72585;
    --background-color: #f4f7fc;
    --text-color: #333;
    --white-color: #fff;
    --border-color: #e0e0e0;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    --font-family-headings: 'Montserrat', sans-serif;
    --font-family-body: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-family-headings);
    font-weight: 700;
}

/* --- Utility Classes --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25);
    color: var(--white-color);
}

.btn.added {
    background: var(--success-color);
}

.buy-now-btn {
    background: var(--success-color);
}
.buy-now-btn:hover {
    background: #0abde3;
}


/* --- Header & Navbar --- */
.header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease;
}

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

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    font-family: var(--font-family-headings);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-icon {
    font-size: 1.3rem;
    color: var(--text-color);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.nav-icon:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.cart-icon .cart-item-count,
.wishlist-icon .wishlist-item-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-menu {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* --- Search Bar --- */
.search-bar-container {
    max-height: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
}
.search-bar-container.active {
    max-height: 100px;
    padding: 1rem 0;
}
#search-input {
    width: 50%;
    border: 2px solid var(--border-color);
    border-right: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 50px 0 0 50px;
    outline: none;
    transition: border-color 0.3s ease;
}
#search-input:focus {
    border-color: var(--primary-color);
}
#search-button {
    background: var(--primary-color);
    border: none;
    color: var(--white-color);
    padding: 0 1.5rem;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    font-size: 1.2rem;
}

/* --- Hero Section --- */
.hero {
    background: url('images/wu-yi-zY3zIOdKXL4-unsplash.jpg') no-repeat center center/cover;
    height: 85vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: var(--white-color);
    text-align: left;
    position: relative;
    padding: 0 5%;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    animation: slideInFromLeft 1s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- General Content Page Styling (About, Contact) --- */
.content-page {
    padding: 4rem 5%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--white-color);
    border-radius: 15px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.content-page h1 {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}
.content-page p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* --- Featured Products Section --- */
.featured-products {
    padding: 5rem 5%;
    text-align: center;
}
.featured-products h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}
.featured-products h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* --- Product Grid & Cards (Modern & SMOOTH) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white-color);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    will-change: transform, box-shadow;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn-up 0.5s ease-out forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-card .product-image-container {
    position: relative;
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

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

.product-card .product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay .btn, .product-overlay .add-to-wishlist-btn {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.product-card:hover .product-overlay .btn {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

.product-card:hover .product-overlay .add-to-wishlist-btn {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.2s;
}

.product-overlay .add-to-wishlist-btn {
    font-size: 1.5rem;
    color: var(--white-color);
    background-color: rgba(0,0,0,0.4);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.product-overlay .add-to-wishlist-btn.active {
    color: var(--secondary-color);
}

.product-info {
    padding: 1.25rem 1.5rem 1.5rem;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- NEW Styles for Brand, Price, Rating --- */
.product-brand {
    font-size: 0.85rem;
    font-weight: 500;
    color: #888; /* Grey color for brand */
    margin-bottom: 0.25rem;
    font-family: var(--font-family-body);
}

.product-info h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem; /* Increased margin */
    flex-grow: 1;
    line-height: 1.3;
}

.product-info h3 a {
    color: var(--text-color);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Pushes to the bottom */
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-rating {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f39c12; /* Gold color for rating star */
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- Banner Sections --- */
.promo-banner-large {
    padding: 6rem 5%;
    margin: 3rem 0;
    background-size: cover;
    background-position: center center;
    border-radius: 15px;
    color: var(--white-color);
    position: relative;
    overflow: hidden;
    text-align: left;
}
.promo-banner-large::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}
.promo-banner-large .promo-content {
    position: relative;
    z-index: 2;
    max-width: 50%;
}
.promo-banner-large h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.promo-banner-large p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.promo-banner-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0 5%;
    margin-bottom: 5rem;
}
.promo-banner-dual .promo-card {
    padding: 4rem 2rem;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    color: var(--white-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.promo-banner-dual .promo-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%);
    z-index: 1;
}
.promo-banner-dual .promo-content {
    position: relative;
    z-index: 2;
}
.promo-banner-dual h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.promo-banner-dual p {
    margin-bottom: 1rem;
}

/* --- Footer --- */
.footer {
    background-color: #111;
    color: #f1f1f1;
    padding: 4rem 5% 0;
    margin-top: 5rem;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #444;
}
.footer-section h3 {
    margin-bottom: 1.5rem;
    color: var(--white-color);
}
.footer-section ul li {
    margin-bottom: 0.75rem;
}
.footer-section ul li a {
    color: #ccc;
    transition: all 0.3s ease;
}
.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}
.social-links a {
    color: #ccc;
    margin-right: 1rem;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--secondary-color);
}
.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
    color: #aaa;
}

/* --- Scroll to Top Button --- */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#scrollToTopBtn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

/* --- Products Page --- */
.products-page-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 5%;
}

.filter-sidebar {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    align-self: flex-start;
    position: sticky;
    top: 120px;
}

.filter-group {
    margin-bottom: 2rem;
}
.filter-group h4 {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.filter-group select, .filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
#price-value {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* --- Cart & Wishlist Page Common Styles --- */
.cart-page, .wishlist-page {
    padding: 2rem 5%;
}
.cart-page h1, .wishlist-page h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* --- Cart Page --- */
.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.cart-item, .wishlist-item {
    display: flex;
    align-items: center;
    background: var(--white-color);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.cart-item img, .wishlist-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1.5rem;
}

.cart-item-info, .wishlist-item-info {
    flex-grow: 1;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.cart-item-quantity input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.cart-item-remove, .wishlist-item-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.4rem;
    margin-left: 1rem;
    transition: transform 0.2s;
}
.cart-item-remove:hover, .wishlist-item-remove:hover {
    transform: scale(1.1);
}

.cart-summary {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    align-self: flex-start;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.total {
    font-weight: bold;
    font-size: 1.2rem;
}

.checkout-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Wishlist Page Specific --- */
.wishlist-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.wishlist-item-actions .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* --- Checkout Page --- */
.checkout-page {
    padding: 2rem 5%;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.checkout-form, .order-summary {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.place-order-btn {
    width: 100%;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .nav-menu { display: none; }
    .menu-toggle { display: block; }
    .mobile-nav-menu.active { display: flex; }
    .hero h1 { font-size: 3rem; }
    .cart-container, .checkout-container, .products-page-main {
        grid-template-columns: 1fr;
    }
    .promo-banner-large .promo-content { max-width: 80%; }
    .promo-banner-dual { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    #search-input { width: 70%; }
    .promo-banner-large h2 { font-size: 2.2rem; }
}

@media (max-width: 576px) {
    .hero {
        justify-content: center;
        text-align: center;
    }
    .hero::before {
        background: rgba(0,0,0,0.6);
    }
    .promo-banner-large .promo-content { max-width: 100%; }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination button {
    background-color: var(--white-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

.pagination span {
    font-weight: 500;
    color: var(--text-color);
}