:root {
    --primary-font: 'Vazirmatn', sans-serif;
    --secondary-font: 'Playfair Display', serif;
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --accent-color: #C5BBAE;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--primary-font);
    line-height: 1.8;
    color: var(--primary-color);
    background-color: #fff;
}

/* ================== SEARCH OVERLAY STYLES ================== */
.search-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.search-overlay.open {
    opacity: 1;
    visibility: visible;
}

.search-overlay-close {
    position: absolute;
    top: 30px;
    left: 40px;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--primary-color);
    cursor: pointer;
}

.search-overlay-content {
    text-align: center;
}

.search-overlay-input {
    border: none;
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
    font-size: 2rem;
    padding: 1rem;
    width: 60vw;
    text-align: center;
    outline: none;
    font-family: var(--primary-font);
}

.search-overlay-button {
    margin-top: 2rem;
    padding: 0.75rem 3rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-family: var(--primary-font);
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.search-overlay-button:hover {
    background-color: var(--accent-color);
    color: #fff;
}
/* ======================================================== */
/* === Cart Count Items=== */
/* ======================================================== */

/* This new container helps position the counter relative to the icon */
.cart-icon-container {
    position: relative;
    display: inline-block; /* Allows the counter to be positioned on top */
}

/* This is the counter bubble itself */
.cart-item-count {
    position: absolute;
    top: -15px;      /* Position it slightly above the icon */
    left: 10px;
    background-color: var(--accent-color); /* Use your brand's accent color */
    color: white;

    border-radius: 50%; /* Makes it a perfect circle */
    width: 20%;
    height: 60%;

    /* Use flexbox to perfectly center the number inside the circle */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    font-size: 12px;
    font-weight: 700;
    line-height: 1; /* Remove any extra line height */
}

/* ======================================================== */
/* ======================================================== */

/* ================== HEADER & NAVIGATION ================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a {
    text-decoration: none;
    font-family: var(--secondary-font);
    font-size: 2rem;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin: 0 1.5rem;
    position: relative;
}

.main-nav ul li a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.main-nav ul li a:hover {
    color: var(--accent-color);
}

.submenu-toggle {
    display: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border: 1px solid #eaeaea;
    border-radius: 5px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1001;
}

.dropdown-menu li a {
    padding: 0.5rem 1.5rem;
    display: block;
    white-space: nowrap;
}

.header-icons {
    position: relative;
    display: flex;
    align-items: center;
}

.header-icons a {
    margin-right: 1rem;
    cursor: pointer;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 4px 0;
}


/* --- Profile Dropdown --- */
.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    min-width: 160px;
    z-index: 1002;
    overflow: hidden;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: background-color 0.2s;
    text-align: right;
}

.profile-dropdown a:hover {
    background-color: #f8f8f8;
}


/* ================== HERO CAROUSEL STYLES ================== */
.hero-carousel {
    height: 60vh;
    width: 100%;
    position: relative;
}

.hero-swiper {
    width: 100%;
    height: 100%;
}

.hero-swiper .swiper-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;

}

.hero-swiper .swiper-slide-active {
    z-index: 10;
}

.hero-content {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2.5rem 4rem;
    border-radius: 5px;
}

.hero-content h1 {
    font-family: var(--primary-font);
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-family: var(--primary-font);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.7);
    width: 10px;
    height: 10px;
    opacity: 1;
}

.hero-swiper .swiper-pagination-bullet-active {
    background: var(--accent-color);
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.3s;
    
}

.btn-primary:hover {
    background-color: #b3a99d;
}

/* ================== CATEGORY, PRODUCTS, FOOTER ================== */
.category-showcase {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 4rem 2rem;
}

.category-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    color: white;
}

.category-card img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
    height: 100%;
    object-fit: cover;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card .category-title {
    font-family: var(--primary-font);
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 2rem 1.5rem 1.5rem;
    text-align: right;
    font-size: 1.5rem;
    font-weight: 700;
}

.product-carousel-section {
    padding: 0 2rem 4rem;
    position: relative;
}

.product-carousel-section h2 {
    font-family: var(--primary-font);
    font-size: 2.5rem;
    margin-bottom: 2.5rem; /* Increased margin to make space for arrows */
    text-align: center;
}

/* ================== DEFINITIVE PRODUCT CARD STYLES ================== */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s;
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-details {
    padding: 1rem;
    text-align: right;
    flex-grow: 1;
}

.product-card-details h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.product-card-details .price {
    font-weight: 700;
    color: var(--accent-color);
}

.product-card-actions {
    padding: 0 1rem 1rem 1rem;
    position: relative;
    z-index: 2;
}

.product-card-actions form {
    display: block;
}

.btn-add-to-cart {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    font-family: var(--primary-font);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-add-to-cart:hover {
    background-color: #000;
}


/* ================== SWIPER ARROW POSITIONING ================== */
/* --- Positioning for Product Carousel Arrows --- */
.product-swiper{
    padding-top: 55px;
}
.product-swiper .swiper-button-prev,
.product-swiper .swiper-button-next {
    position: absolute;
    transform: none;
    top:0;
    margin: 0;
    width: 50px;
    height: 50px;
    background-color: #f5f5f5;
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    --swiper-navigation-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.product-swiper .swiper-button-prev:hover,
.product-swiper .swiper-button-next:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* RTL positioning for PC (top left of the section) */
.product-swiper .swiper-button-next {
    left: 2rem;
    right: auto;
}
.product-swiper .swiper-button-prev {
    left: auto;
    right: 2rem;
}

/* --- Positioning for Hero Carousel Arrows (keep them inside) --- */
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    color: white;
    --swiper-navigation-size: 20px;
    width: 40px;
    height: 40px;
}
.hero-swiper .swiper-button-prev {
    right: 10px;
    left: auto;
}
.hero-swiper .swiper-button-next {
    left: 10px;
    right: auto;
}


/* ================== FOOTER AND RESPONSIVE STYLES ================== */
.view-all-container {
    text-align: center;
    margin-top: 2.5rem;
}
.main-footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 3rem 2rem 0;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    padding-bottom: 3rem;
    text-align: right;
}
.footer-section {
    flex: 1;
    margin: 0 1rem;
}
.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}
.footer-section ul {
    list-style: none;
}
.footer-section ul li a {
    text-decoration: none;
    color: #fff;
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.3s;
}
.footer-section ul li a:hover {
    color: var(--accent-color);
}
.social-icons a {
    margin-left: 1rem;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid #555;
    padding: 1rem 0;
}

@media (max-width: 992px) {
    .category-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #eaeaea;
    }
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        padding: 0;
    }
    .main-nav ul li {
        margin: 0;
        text-align: right;
        width: 100%;
    }
    .nav-link-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-nav ul li a {
        padding: 0.75rem 1rem;
        flex-grow: 1;
    }
    .submenu-toggle {
        display: block;
        padding: 0.75rem 1.5rem;
        font-size: 1.5rem;
        font-weight: bold;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
    }
    .dropdown-menu {
        position: static;
        width: 100%;
        border: none;
        box-shadow: none;
        background-color: #f8f8f8;
        min-width: auto;
        padding-right: 1.5rem;
        flex-direction: column;
    }
    .dropdown-menu li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    .dropdown-menu li:last-child {
        border-bottom: none;
    }
    .dropdown-menu li a {
        font-size: 0.85rem;
        text-transform: none;
        font-weight: 400;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .hero-carousel {
        height: 50vh;
    }
    .hero-content {
        padding: 1.5rem 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .search-overlay-input {
        font-size: 1.5rem;
        width: 80vw;
    }
    .footer-content {
        flex-direction: column;
    }
    .footer-section {
        margin-bottom: 2rem;
    }
    .category-showcase {
        padding: 2rem 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    .product-carousel-section {
        padding: 0 1rem 3rem;
    }

    .product-swiper .swiper-button-prev,
    .product-swiper .swiper-button-next {
        position: absolute;
        top: 10px;
        width: 30px;
        height: 30px;
        background-color: rgba(0,0,0,0.3);
        color: #fff;
        border-radius: 50%;
    }

    .product-swiper .swiper-button-next {
        left: 0;
        right: auto;
    }
    .product-swiper .swiper-button-prev {
        left: 40px;
        right: auto;
    }
    .btn-primary{
        font-size:12px; !important
    }

}

/* --- Dropdown visibility rules --- */
.dropdown-menu {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transform-origin: top;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

@media (min-width: 769px) {
    .dropdown:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

}

.dropdown.open > .dropdown-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: none;
}