/*
Theme Name:   Special Theme
Theme URI:    https://specialewear.com/
Author:       Nader Yari
Author URI:   https://naderyari.com/
Description:  A special WooCommerce theme for selling clothes, designed for Persian and RTL languages.
Version:      1.0.4
Tags:         e-commerce, woocommerce, rtl, responsive-layout, custom-logo, translation-ready
Text Domain:  special-theme
RTL:          true
*/

/*
 * 1.0 - CSS Reset
 * --------------------------------------------------------------------------------
 */

/*
  1. Use a more intuitive box-sizing model.
*/
*, *::before, *::after {
  box-sizing: border-box;
}

/*
  2. Remove default margin and padding.
*/
body,
h1, h2, h3, h4, h5, h6,
p,
ul, ol,
figure,
blockquote,
dl, dd {
  margin: 0;
  padding: 0;
}

/*
  3. Remove list styles on ul, ol elements.
*/
ul, ol {
    list-style: none;
}

/*
  4. Set core body defaults.
*/
body {
  min-height: 100vh;
  line-height: 1.5;
  text-rendering: optimizeSpeed;
  font-family: vazirmatn;
}

/*
  5. Make images easier to work with.
*/
img, picture {
  /*max-width: 100%;*/
  display: block;
}

/*
  6. Remove default styling on links
*/
a {
    text-decoration: none;
    color: inherit;
}

body {
    font-family: 'Vazirmatn', sans-serif;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Top Bar */
.top-bar {
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
}
.top-bar a {
    text-decoration: none;
    color: #333;
}

/* Main Header */
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Site Branding (Logo) */
.site-branding .custom-logo-link img {
    max-height: 50px;
    width: auto;
}

/* Main Navigation */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
.main-navigation ul li {
    position: relative;
    margin-left: 20px;
}
.main-navigation ul li a {
    text-decoration: none;
    color: #111;
    font-weight: bold;
    padding: 10px 0;
}
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    width: 200px;
    z-index: 1000;
}
.main-navigation ul li:hover > ul {
    display: block;
}
.main-navigation ul ul li {
    margin: 0;
    width: 100%;
}
.main-navigation ul ul li a {
    font-weight: normal;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
}
.header-actions .action-icon {
    margin-left: 15px;
    position: relative;
    font-size: 24px; 
    color: #111;
}
.header-actions .cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: red;
    color: white;
    font-size: 10px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
}
/*
 * 3.0 - Footer Styles
 * --------------------------------------------------------------------------------
 */

.site-footer {
    background-color: #f9f9f9;
    color: #555;
    font-size: 14px;
}

/* Footer Widgets */
.footer-widgets {
    padding: 60px 0;
    border-bottom: 1px solid #eaeaea;
}

.footer-widgets .container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.footer-column {
    flex: 1;
}

.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    color: #111;
    margin-bottom: 20px;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    margin-bottom: 10px;
}

.widget ul li a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}

.widget ul li a:hover {
    color: #111;
}

/* Footer Bottom Bar */
.footer-bottom {
    padding: 20px 0;
}

.site-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.designer-credit a {
    color: #337ab7;
    text-decoration: none;
}
.designer-credit a:hover {
    text-decoration: underline;
}

/* * 2.1 - Sticky Header Styles
 * --------------------------------------------------------------------------------
 */

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/*
 * 2.2 - Header Search Styles
 * --------------------------------------------------------------------------------
 */

.search-toggle-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex; /* Helps with alignment */
    color: #111;
}

.site-search-container {
    background-color: #f5f5f5;
    padding: 30px 0;
    display: none; /* Hidden by default */
}

.site-search-container.is-open {
    display: block; /* Shown when class is added */
}

/* Styling the WooCommerce search form */
.woocommerce-product-search {
    display: flex;
}
.woocommerce-product-search input[type="search"] {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 10px 15px;
    font-size: 16px;
    font-family: 'Vazirmatn', sans-serif;
}
.woocommerce-product-search button {
    border: 1px solid #111;
    background-color: #111;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
}

/*
 * 2.2 - Header Search Modal Styles
 * --------------------------------------------------------------------------------
 */

/* Prevents background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10vh 20px 20px;
    overflow-y: auto;
    
    /* Animation */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

.search-modal-content {
    width: 100%;
    max-width: 700px;
    text-align: center;
}

.close-search-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.search-form-wrapper .woocommerce-product-search {
    position: relative;
    border-bottom: 2px solid #333;
}

.search-form-wrapper .woocommerce-product-search input[type="search"] {
    width: 100%;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 24px;
    font-family: 'Vazirmatn', sans-serif;
    outline: none;
}
.search-form-wrapper .woocommerce-product-search button {
    display: none; /* We can hide the button and rely on Enter key */
}

/* Trending Searches */
.trending-searches {
    margin-top: 40px;
    text-align: right; /* RTL */
}
.trending-searches h2 {
    font-size: 16px;
    color: #777;
    margin-bottom: 15px;
}
.trending-searches ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* RTL */
    gap: 10px;
}
.trending-searches li a {
    display: block;
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    color: #555;
    transition: background-color 0.3s, color 0.3s;
}
.trending-searches li a:hover {
    background-color: #333;
    color: #fff;
}

/*
 * 4.0 - Homepage: Hero Section
 * --------------------------------------------------------------------------------
 */

.hero-section {
    position: relative;
    /* height: 85vh; --- This line is being replaced */
    min-height: 560px; /* New height for desktop */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}


@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh; /* A shorter height for mobile screens */
    }
    .hero-content h1 {
        font-size: 36px;
    }
    .hero-content p {
        font-size: 18px;
    }
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures the video covers the area without distortion */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content .btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-content .btn-primary {
    background-color: #fff;
    color: #111;
    border: 2px solid #fff;
}

.hero-content .btn-primary:hover {
    background-color: transparent;
    color: #fff;
}
/*
 * 6.0 - Homepage: Featured Products Carousel
 * --------------------------------------------------------------------------------
 */

.product-carousel-section {
    padding: 60px 0;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    padding: 0 30px; /* Corresponds to site-main padding */
}

.carousel-subtitle {
    font-size: 14px;
    color: #777;
    margin: 0 0 5px;
}

.carousel-heading {
    font-size: 24px;
    margin: 0;
    color: #111;
}

.view-all-link {
    text-decoration: underline;
    color: #111;
    font-weight: bold;
}

/* Swiper Styles */
.product-swiper {
    padding: 0 30px !important; /* Override default swiper padding to align with section */
}
.swiper-button-next, .swiper-button-prev {
    color: #111;
}

/* Product Card Styles */
.product-card {
    text-align: right; /* RTL */
}

.product-card-image-wrap {
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.product-card-image-wrap a {
    display: block;
    position: relative;
    padding-top: 125%; /* Aspect Ratio 4:5 */
}

.product-card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.product-card-image-wrap .product-image-hover {
    opacity: 0;
}

.product-card:hover .product-image-hover {
    opacity: 1;
}

.product-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-overlay {
    transform: translateY(0);
}

.available-sizes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.quick-add-to-cart-btn {
    width: 62px;
    height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border: none; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); 
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}


.quick-add-to-cart-btn:hover {
    background-color: #111; 
    color: #fff; 
}

.quick-add-to-cart-btn.loading {
    background-color: #ccc;
    cursor: wait;
}
/* Style for the full-text "Add to Cart" button on simple products */
.quick-add-to-cart-btn.add-to-cart-full-text {
    font-family: vazirmatn;
    width: auto; /* Override the fixed width */
    padding-left: 20px;
    padding-right: 20px;
}

/* Simple CSS loader */
.quick-add-to-cart-btn .loader {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quick-add-to-cart-btn.added {
    background-color: #111;
    color: #fff;
    border-color: #111;
    cursor: default;
}

/* Style for simple product button in overlay */
.product-card-overlay .button.single_add_to_cart_button {
    padding: 10px 20px;
    font-size: 14px;
}

.available-sizes span {
    background-color: #f0f0f0;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
}

.product-title a {
    font-size: 16px;
    color: #111;
    font-weight: normal;
}

.product-price {
    font-size: 15px;
    color: #555;
    margin-top: 5px;
}

/* Hide the default WooCommerce "View Cart" link on our custom cards */
.product-card .added_to_cart {
    display: none !important;
}

/*
 * 7.0 - Homepage: Filterable Products Section
 * --------------------------------------------------------------------------------
 */
.filterable-product-section {
    padding: 60px 0;
    position: relative;
}

.filterable-header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 30px;
    flex-wrap: wrap; /* For mobile */
}

.filterable-heading {
    font-size: 24px;
    margin: 0 0 15px; /* Margin for mobile */
}

.product-filters {
    display: flex;
    gap: 10px;
}

.product-filters .filter-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.product-filters .filter-btn.is-active {
    background-color: #111;
    color: #fff;
}

.swiper-navigation-wrapper {
    position: relative;
}

.filterable-product-swiper {
    padding: 0 30px !important;
}

.filterable-next, .filterable-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}
.filterable-prev { left: 0; }
.filterable-next { right: 0; }

.carousel-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 20;
}
.carousel-loader.is-loading { display: block; }
@keyframes spin { 0% { transform: translate(-50%,-50%) rotate(0deg); } 100% { transform: translate(-50%,-50%) rotate(360deg); } }

.no-products-found { padding: 40px; text-align: center; }
/*
 * 8.0 - Homepage: Category Banners Section (3-column)
 * --------------------------------------------------------------------------------
 */
.category-banners-section {
    padding: 60px 0;
}

.category-banners-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* Default: 1 column for mobile */
    gap: 20px;
    padding: 0 30px; /* To align with other sections */
}

@media (min-width: 768px) {
    .category-banners-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablet */
    }
}

@media (min-width: 1024px) {
    .category-banners-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for desktop */
    }
}

.category-banner-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.category-banner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.category-banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-banner-card:hover img {
    transform: scale(1.05);
}

.category-banner-card .banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%); /* Gradient overlay */
    color: #fff;
    text-align: right; /* RTL */
}

.category-banner-card .banner-title {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
}

.category-banner-card .banner-text {
    font-size: 14px;
    margin-top: 5px;
    color: rgba(255,255,255,0.8);
}

/*
 * 9.0 - Homepage: Filterable Blog Posts Section
 * --------------------------------------------------------------------------------
 */
.filterable-blog-section {
    padding: 60px 0;
    position: relative;
}

.filterable-blog-section .filterable-header {
    margin-bottom: 30px;
    padding: 0 30px;
}

.filterable-blog-section .filterable-heading {
    margin: 0 0 20px;
}

.blog-filters {
    display: flex;
    justify-content: right;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-filters .filter-blog-btn {
    background-color: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.blog-filters .filter-blog-btn.is-active {
    background-color: #111;
    color: #fff;
}

.filterable-blog-swiper {
    padding: 0 30px !important;
}

.filterable-blog-prev, .filterable-blog-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    /* Style from default swiper arrows will apply */
}
.filterable-blog-prev { left: 0; }
.filterable-blog-next { right: 0; }

.carousel-loader.blog-loader {
    /* Uses same loader style as product carousel, ensure it's positioned correctly */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Blog Post Card Styles */
.post-card {
    text-align: right;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    height: 100%; /* Ensure cards are same height */
    display: flex;
    flex-direction: column;
}

.post-card-image-wrap {
    position: relative;
    overflow: hidden;
}

.post-card-image-wrap a {
    display: block;
    padding-top: 60%; /* Aspect Ratio 5:3 */
    position: relative;
}

.post-card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-card-details {
    padding: 20px;
    flex-grow: 1; /* Allow content to grow */
    display: flex;
    flex-direction: column;
}

.post-card .post-title {
    font-size: 18px;
    margin: 0 0 10px;
    font-weight: bold;
}

.post-card .post-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
}

.post-card .post-title a:hover {
    color: #007bff; /* Example hover color */
}

.post-card .post-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.post-card .post-meta span {
    display: inline-block;
    margin-left: 15px;
    position: relative;
}

.post-card .post-meta span:last-child {
    margin-left: 0;
}

.post-card .post-meta span:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -10px;
    top: 0;
}

.post-card .post-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-top: auto; /* Push to bottom if content varies */
}
/*
 * 10.0 - Single Post & Comments
 * --------------------------------------------------------------------------------
 */

/* Layout */
.single-post-container {
    display: flex;
    gap: 40px;
    padding: 40px 30px;
}
.site-main {
    flex: 1; /* Main content takes up available space */
    min-width: 0;
}
.widget-area {
    flex: 0 0 300px; /* Sidebar with a fixed width of 300px */
}

/* Responsive Layout for mobile */
@media (max-width: 992px) {
    .single-post-container {
        flex-direction: column; /* Stack content and sidebar */
    }
    .widget-area {
        flex-basis: auto; /* Reset flex basis */
    }
}

/* Post Content Styling */
.entry-content .entry-header { margin-bottom: 20px; }
.entry-content .entry-title { font-size: 36px; margin-bottom: 10px; }
.entry-content .entry-meta { font-size: 14px; color: #777; }
.entry-content .entry-meta span { margin-left: 15px; }
.post-thumbnail { margin-bottom: 30px; }
.entry-body p { line-height: 1.8; margin-bottom: 20px; }
.entry-footer { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }

/* Sidebar Widget Styling */
.widget-area .widget {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}
.widget-area .widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Comments Section Styling */
.comments-area {
    margin-top: 50px;
}
.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
}
.comment-list {
    list-style: none;
    padding: 0;
}
.comment-list .comment {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.comment-list .children { /* This styles nested comments */
    list-style: none;
    margin-right: 40px; /* Indent for RTL */
    padding-right: 20px;
    border-right: 2px solid #f0f0f0;
}
.comment-author .avatar {
    float: right;
    margin-left: 15px;
    border-radius: 50%;
}
.comment-author .fn {
    font-weight: bold;
    font-style: normal;
}
.comment-metadata a {
    font-size: 13px;
    color: #888;
}
.comment-content {
    margin-top: 10px;
}
.reply .comment-reply-link {
    font-size: 13px;
    font-weight: bold;
}

/* Comment Form */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.comment-form .submit {
    background-color: #111;
    color: #fff;
    border: none;
    padding: 12px 30px;
    cursor: pointer;
    border-radius: 4px;
}
/*
 * 11.0 - WooCommerce Single Product Page
 * --------------------------------------------------------------------------------
 */

/* Main Layout */
.single-product .product-layout-wrapper {
    display: flex;
    flex-direction: row-reverse; /* RTL: Gallery on the right, summary on the left */
    gap: 40px;
    margin-bottom: 50px;
}

.product-gallery-wrapper {
    flex: 1 1 55%;
}

.product-summary-wrapper {
    flex: 1 1 45%;
}

/* Responsive Layout */
@media (max-width: 992px) {
    .single-product .product-layout-wrapper {
        flex-direction: column; /* Stack gallery and summary */
    }
}

/* Product Summary Details */
.product_title {
    display: grid;
    font-size: 28px;
    margin-bottom: 10px;
    justify-content: center;
}
.woocommerce-product-rating {
    margin-bottom: 15px;
}
.price {
    display: grid;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #111!important;
    margin-bottom: 20px;
}
.woocommerce-product-details__short-description {
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Variations Form */
.variations_form .variations {
    margin-bottom: 20px;
}
.variations_form .label {
    font-weight: bold;
}
.variations_form .value select {
    width: 100%;
    padding: 8px;
}
.single_variation_wrap {
    margin-bottom: 20px;
}

/* Add to Cart Button */
.single_add_to_cart_button {
  width: 100%;
    padding: 15px;
    background-color: #111;
    color: #fff;
    border: none;
    border-radius: 25px; /* Updated border radius */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
.single_add_to_cart_button:hover {
    background-color: #333;
}

/* Size Guide */
.size-guide-wrapper {
    text-align: right; /* RTL */
    margin-bottom: 20px;
}
.size-guide-button {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

/* Size Guide Panel */
.size-guide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.size-guide-panel-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.size-guide-panel {
    position: fixed;
    top: 0;
    left: 0; /* RTL: Appears from the left */
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    padding: 30px;
    transform: translateX(-100%); /* RTL: Hide to the left */
    transition: transform 0.4s ease-in-out;
    overflow-y: auto;
}
.size-guide-panel.is-open {
    transform: translateX(0);
}
.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
}
.size-guide-panel table {
    width: 100%;
    border-collapse: collapse;
}
.size-guide-panel table,
.size-guide-panel th,
.size-guide-panel td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

/* Variation Swatches (Size buttons) */
.size-swatches-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.swatch-item label {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    text-align: center;
}
.swatch-item input[type="radio"]:checked + label {
    background-color: #111;
    color: #fff;
    border-color: #111;
}
.swatch-item input[type="radio"]:disabled + label {
    color: #ccc;
    background-color: #f9f9f9;
    cursor: not-allowed;
    text-decoration: line-through;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Custom Quantity Input */
.quantity-wrapper {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    margin-left: 10px; /* RTL */
}
.quantity-wrapper .quantity-btn {
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    font-size: 18px;
    font-weight: bold;
}
.quantity-wrapper .quantity {
    display: inline-block;
}
.quantity-wrapper input.qty {
    width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    -moz-appearance: textfield; /* Remove number input spinners in Firefox */
}
/* Remove number input spinners in Webkit browsers */
.quantity-wrapper input.qty::-webkit-outer-spin-button,
.quantity-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/*
 * 11.1 - Custom Product Gallery (Responsive)
 * --------------------------------------------------------------------------------
 */
.custom-product-gallery-wrapper {
    position: relative;
}

/* --- MOBILE STYLES (Swiper) --- */
.custom-product-gallery-wrapper.swiper {
    overflow: hidden; /* Needed for swiper */
    border-radius: 8px;
}

.gallery-pagination {
    position: absolute;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: auto !important;
    background-color: rgba(0, 0,
 0, 0.3);
    padding: 5px 10px;
    border-radius: 20px;
}

.gallery-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    opacity: 1;
}

.gallery-pagination .swiper-pagination-bullet-active {
    background-color: #fff;
}

.scroll-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
}

/* --- DESKTOP STYLES (Grid & Scroll) --- */
@media (min-width: 768px) {
    /* Hide mobile pagination on desktop */
    .gallery-pagination {
        display: none;
    }

    /* Show desktop scroll buttons if needed */
    .scroll-nav-buttons {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        flex-direction: column;
        gap: 10px;
    }

    .gallery-images-container {
        display: grid;
        gap: 0.4rem;
        grid-template-columns: 1fr 1fr;
        max-height: 90vh;
        overflow-y: auto;
        scroll-behavior: smooth;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .gallery-images-container::-webkit-scrollbar {
        display: none;
    }

    .gallery-images-container .gallery-item:nth-child(n+3) {
        grid-column: 1 / -1;
    }
}

/* Common styles for gallery items */
.gallery-item {
    display: block;
    cursor: zoom-in;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Styles for scroll buttons (from previous step, unchanged) */
.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, opacity 0.2s;
}
.scroll-btn svg { width: 24px; height: 24px; fill: #333; }
.scroll-btn:hover { background-color: #fff; }
.scroll-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/*
 * 12.0 - WooCommerce Single Product Form (High Specificity)
 * --------------------------------------------------------------------------------
 */

/* Variation Swatches (Size buttons) */
.woocommerce div.product form.cart .variations .size-swatches-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.woocommerce div.product form.cart .variations .swatch-item label {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    text-align: center;
    background-color: #fff; /* Ensure default is white */
    color: #333; /* Ensure default text color */
}
.woocommerce div.product form.cart .variations .swatch-item label:hover {
    color: #fff !important;
    background-color: #111;
}
.woocommerce div.product form.cart .variations .swatch-item input[type="radio"]:checked + label {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

.woocommerce div.product form.cart .variations .swatch-item input[type="radio"]:disabled + label {
    color: #ccc;
    background-color: #f9f9f9;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Visually hide the actual radio button */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}


/* Custom Quantity Input */
.woocommerce div.product form.cart .quantity-wrapper {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    margin-left: 10px; /* RTL */
}

.woocommerce div.product form.cart .quantity-wrapper .quantity-btn {
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    font-size: 18px;
    font-weight: bold;
}

.woocommerce div.product form.cart .quantity-wrapper .quantity {
    display: inline-block;
}

.woocommerce div.product form.cart .quantity-wrapper input.qty {
    height: 42px; /* Match button height */
    width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    -moz-appearance: textfield; /* Remove number input spinners in Firefox */
}

.woocommerce div.product form.cart .quantity-wrapper input.qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart .quantity-wrapper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Button */
.woocommerce div.product form.cart .single_add_to_cart_button {
    padding: 0 30px; /* Use padding instead of width */
    height: 44px; /* Set a fixed height */
    background-color: #111 !important; /* Use !important to be sure */
    color: #fff !important;
    border: none;
    border-radius: 25px !important; /* Updated border radius */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background-color: #333 !important;
}
/*
 * 12.1 - Advanced Variation Swatches & Add to Cart Button (FINAL STYLE V2)
 * --------------------------------------------------------------------------------
 */

/* Hides the original dropdown but keeps it functional */
.woocommerce div.product form.cart .variations select {
    display: none !important;
}

/* New layout for variation rows */
.woocommerce div.product form.cart .variations .variation-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}
.woocommerce div.product form.cart .variations .label {
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.woocommerce div.product form.cart .variations .size-swatches-fieldset {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin: 0;
    width: 100%;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.woocommerce div.product form.cart .variations .swatch-item label {
    display: inline-block;
    padding: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 42px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    line-height: 1.5;
    background-color: transparent;
    color: #555;
    border-radius: 4px;
}
.woocommerce div.product form.cart .variations .swatch-item label:hover {
    color: #000;
}

/* Style for the SELECTED swatch */
.woocommerce div.product form.cart .variations .swatch-item label.selected {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

/* Style for OUT OF STOCK swatches */
.woocommerce div.product form.cart .variations .swatch-item label.disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}
.woocommerce div.product form.cart .variations .swatch-item input[type="radio"]:disabled + label:hover {
    color: #ccc;
}

/*
 * 11.0 - WooCommerce Single Product Page (V2 - Centered Layout)
 * --------------------------------------------------------------------------------
 */

/* 1. Center Align ALL Summary Content */
.woocommerce div.product .summary.entry-summary {
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers everything horizontally */
    text-align: center;
}

/* 2. Style the Category (Moved Above Price) */
.woocommerce div.product .product_meta {
    margin-bottom: 15px;
    border-bottom: none;
}
.woocommerce div.product .product_meta .posted_in {
    display: flex;
    align-items: center; 
    text-align: center;
    justify-content: center;
    font-size: 14px;
    color: #777;
    text-transform: uppercase;
}
.woocommerce div.product .product_meta .posted_in a {
    color: #777;
    text-decoration: none;
}
.woocommerce div.product .product_meta .sku_wrapper,
.woocommerce div.product .product_meta .tagged_as {
    display: none; /* Hide SKU and Tags for a cleaner look */
}

/* 3. Align "Select a size" and "Size Guide" */
.variation-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}
.variation-label-wrapper .label {
    margin: 0;
    font-weight: bold;
}
.size-guide-wrapper {
    margin: 0;
}
.size-guide-button {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 4. Style Variation Swatches */
.woocommerce div.product form.cart .variations {
    margin-bottom: 20px;
    width: 100%;
}
.woocommerce div.product form.cart .variations .size-swatches-fieldset {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin: 0;
    width: 100%;
    border-radius: 8px;
    justify-content: center; /* Center the swatches inside the box */
}
/* ... (تمام استایل‌های دیگر سواچ‌ها از مرحله قبل بدون تغییر باقی می‌ماند) ... */


/* 5. Center and Style Add to Cart Section */
.woocommerce div.product form.cart .single_variation_wrap {
    width: 100%;
    text-align: center;
}
.woocommerce div.product form.cart .variations_button {
    display: flex;
    flex-direction: column; /* Stack quantity and button */
    align-items: center;
    gap: 15px;
}
/*
 * 11.0 & 12.0 - WooCommerce Single Product Page (FINAL LAYOUT & STYLES)
 * --------------------------------------------------------------------------------
 */

/* 1. Center Align ALL Summary Content */
.woocommerce div.product .summary.entry-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 2. Style the Category (Moved Above Price) */
.woocommerce div.product .product_meta {
    margin-bottom: 15px;
    border-bottom: none;
    order: -3; /* Move to the top of other elements */
}
.woocommerce div.product .product_meta .posted_in {
    font-size: 14px;
    color: #777;
}
.woocommerce div.product .product_meta .sku_wrapper,
.woocommerce div.product .product_meta .tagged_as {
    display: none;
}

/* Re-order elements to match design */
.woocommerce div.product .product_title { 
    order: -5;
    margin-top: 5rem;
 }
.woocommerce div.product .price { order: -2; }
.woocommerce div.product form.cart { order: -1; width: 100%; }

/* 3. Align "Select a size" and "Size Guide" */
.variation-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}
.variation-label-wrapper .label {
    margin: 0;
    font-weight: bold;
}
.size-guide-wrapper { margin: 0; }
.size-guide-button {
    background: none; border: none; text-decoration: underline; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; gap: 5px;
}

/* 4. Variation Swatches Styling */
.woocommerce div.product form.cart .variations {
    margin-bottom: 20px;
    width: 100%;
}
.woocommerce div.product form.cart .variations .value {
    width: 100%;
}
.woocommerce div.product form.cart .variations select {
    display: none !important;
}
.woocommerce div.product form.cart .variations .size-swatches-fieldset {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin: 0;
    width: 100%;
    border-radius: 8px;
    justify-content: center;
}


/* 5. FIX Add to Cart Button Size and Center it */
.woocommerce div.product form.cart .single_variation_wrap {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}
.woocommerce div.product form.cart .variations_button {
    width: 100%;
    display: flex;
    justify-content: center; /* Center the content inside */
    align-items: center;
    gap: 15px;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
    width: auto !important; /* CRITICAL FIX: Override 100% width */
    flex-grow: 1; /* Allow it to grow but not full width */
    max-width: 350px; /* Set a max-width to keep it reasonable */
    display: inline-block !important;
    padding: 0 40px !important;
    height: 48px;
    border-radius: 25px !important;
    background-color: #111 !important;
    color: #fff !important;
}

/*
 * 14.0 - Mini Cart Panel (FINAL VERSION with Corrected Layout)
 * --------------------------------------------------------------------------------
 */

/* Overlay for when the panel is open */
.mini-cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); z-index: 9998;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.mini-cart-overlay.is-visible { opacity: 1; visibility: visible; }

/* The panel itself - a flex container */
.mini-cart-panel {
    position: fixed; top: 0; right: -100%;
    width: 100%; max-width: 420px; height: 100%;
    background-color: #fff; z-index: 9999;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: transform 0.4s ease-in-out;
    display: flex; flex-direction: column;
}
.mini-cart-panel.is-open { transform: translateX(-100%); }

/* Header of the panel - fixed layout */
.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.mini-cart-title { 
    margin: 0;
    font-size: 18px;
    flex-grow: 1;
    padding-right: 24px; }
.close-mini-cart-btn { font-size: 28px; background: none; border: none; cursor: pointer; line-height: 1; padding: 0 5px; }

/* This is the main container for WooCommerce output */
.widget_shopping_cart_content {
    flex-grow: 1; /* Allows this section to fill space */
    overflow-y: auto; /* Makes only this section scrollable */
    display: flex;
    flex-direction: column;
}

/* Product list inside the content */
.woocommerce-mini-cart {
    list-style: none; padding: 0; margin: 0;
    flex-grow: 1; /* Push footer content down */
}
.woocommerce-mini-cart-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start; /* Aligns items to the top, prevents stretching */
}
.mini-cart-item-thumbnail { flex-shrink: 0; }
.mini-cart-item-thumbnail img { width: 70px; height: auto; border-radius: 4px; }
.mini-cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mini-cart-item-details a.item-name { color: #333; font-weight: bold; text-decoration: none; font-size: 15px; }
.item-quantity-pricing { display: flex; justify-content: space-between; align-items: center; }
.remove.remove_from_cart_button { font-size: 24px; color: #ccc; text-decoration: none; line-height: 1; }

/* Mini cart footer: Subtotal and Buttons */
p.woocommerce-mini-cart__total {
    padding: 20px;
    border-top: 1px solid #eee;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    display: flex;
    justify-content: space-between;
    background: #fff;
    flex-shrink: 0; /* Prevents this part from shrinking */
}
p.woocommerce-mini-cart__buttons {
    padding: 0 20px 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0; /* Prevents this part from shrinking */
}
.woocommerce-mini-cart__buttons .button {
    display: block; width: 100%; padding: 12px;
    text-align: center; text-decoration: none; border-radius: 5px;
    font-weight: bold; border: 1px solid transparent; transition: background-color 0.2s, color 0.2s;
}
.woocommerce-mini-cart__buttons .button.wc-forward:not(.checkout) {
    background-color: #f0f0f0; color: #111; border-color: #e0e0e0;
}
.woocommerce-mini-cart__buttons .button.checkout {
    background-color: #111; color: #fff;
}
.mini-cart-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/*
 * 15.0 - Responsive Styles (Mobile First Approach)
 * --------------------------------------------------------------------------------
 */

/* --- Default Mobile Styles --- */
.main-navigation {
    display: none; /* Hide desktop nav by default */
}
.mobile-menu-toggle {
    display: block; /* Show hamburger by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

/* Header layout for mobile */
.main-header .container {
    position: relative;
    justify-content: space-between;
}
.site-branding {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.header-actions {
    z-index: 10001;
}

/* Mobile Menu Panel */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen (RTL) */
    width: 80%;
    max-width: 320px;
    height: 100%;
    background-color: #fff;
    z-index: 10000;
    transition: transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}
body.mobile-menu-open .mobile-menu-panel {
    transform: translateX(-100%);
}

.mobile-menu-header {
    text-align: left;
    margin-bottom: 20px;
}
.mobile-menu-close {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-navigation ul li a {
    display: block;
    padding: 12px 0;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
}
.mobile-navigation ul ul {
    padding-right: 20px;
}


/* --- Tablet and Desktop Overrides (min-width: 992px) --- */
@media (min-width: 992px) {
    /* Show desktop navigation and hide mobile toggle */
    .main-navigation {
        display: block;
    }
    .mobile-menu-toggle {
        display: none;
    }
    /* Reset header layout */
    .site-branding {
        position: static;
        transform: none;
    }
    
    /* Footer widgets in columns */
    .footer-widgets .container {
        flex-direction: row;
    }
    
}

/* --- General Mobile Adjustments --- */
@media (max-width: 991px) {
    /* Footer widgets stack vertically */
    .footer-widgets .container {
        flex-direction: column;
    }
    /* Center align footer bottom items */
    .site-info {
        flex-direction: column;
        gap: 10px;
    }
    /* Adjust product page layout */
    .single-product .product-layout-wrapper {
        flex-direction: column;
    }
}

/*
 * REVISED CSS - Includes Z-index fixes and correct animations
 * --------------------------------------------------------------------------------
 */

/* Header Actions - Added z-index */
.header-actions {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1001; /* Set z-index to ensure it's above general content */
}
.header-actions .action-icon {
    margin-left: 15px;
    position: relative;
    color: #111;
}
.header-actions .action-icon svg {
    width: 24px;
    height: 24px;
}
.header-actions .cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: red;
    color: white;
    font-size: 10px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
}

/* --- Mobile Menu Panel (Corrected Animation & Z-index) --- */
.mobile-menu-overlay,
.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9998; /* High z-index to cover everything */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.mobile-menu-panel,
.mini-cart-panel {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999; /* Highest z-index */
    transition: transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Mobile Menu Specifics */
.mobile-menu-panel {
    right: 0;
    max-width: 320px;
    padding: 20px;
    transform: translateX(100%); /* Start off-screen to the right */
}
body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}
body.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0); /* Slide in to view */
}

/* Mini Cart Specifics (LTR Default) */
.mini-cart-panel {
    right: 0;
    max-width: 420px;
    transform: translateX(100%); /* Start off-screen to the right */
}
.mini-cart-panel.is-open {
    transform: translateX(0); /* Slide in to view */
}


/* --- Responsive Styles (Consolidated) --- */
/* Default Mobile Styles */
.main-navigation {
    display: none;
}
.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.main-header .container {
    position: relative;
    justify-content: space-between;
}
.site-branding {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Tablet and Desktop Overrides (min-width: 992px) */
@media (min-width: 992px) {
    .main-navigation {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .site-branding {
        position: static;
        transform: none;
    }
}
/*
 * 17.0 - General Page Content Layout
 * --------------------------------------------------------------------------------
 */

/*
 * Adds horizontal padding to the main content area of pages, posts,
 * and WooCommerce pages to prevent content from touching the screen edges
 * in our full-width layout.
 */
.site-main {
    padding-left: 30px;
    padding-right: 30px;
}

/* On smaller screens, reduce the padding to maximize space */
@media (max-width: 768px) {
    .site-main {
        padding-left: 15px;
        padding-right: 15px;
    }
}
/*
 * 18.0 - Final UI Polish & WooCommerce Overrides
 * --------------------------------------------------------------------------------
 */

/* --- 1. Fix for Checkout Page Overflow on Mobile --- */
@media (max-width: 768px) {
    /* This makes the entire row of product summary in checkout flexible */
    .wc-block-components-order-summary-item {
        flex-wrap: wrap; /* Allows items to wrap to the next line if needed */
        align-items: center;
    }
    /* This allows the product name to shrink and wrap */
    .wc-block-components-order-summary-item__product {
        flex-grow: 1;
        flex-shrink: 1;
        min-width: 0; /* Critical for allowing flex items to shrink */
        word-break: break-word; /* Force long names to break */
        text-align: right;
    }
    /* This ensures the price also behaves correctly */
    .wc-block-components-order-summary-item__total-price {
        white-space: normal;
        text-align: left;
        flex-basis: 100%; /* Allow price to take a new line if needed */
        margin-top: 5px;
    }
}

/* --- 2. Global Font Correction for All Buttons --- */
/*
 * This rule forcefully applies the Vazirmatn font to all WooCommerce buttons,
 * overriding the default font.
*/
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.wc-block-components-button {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* --- 3. Unify Style for Primary WooCommerce Buttons --- */
/*
 * This rule targets all important action buttons (Place Order, Proceed to Checkout, etc.)
 * and applies our theme's signature black, pill-shaped style.
*/
#place_order,
.wc-block-checkout__actions .wc-block-components-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-mini-cart__buttons .button.checkout {
    background-color: #111 !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 12px 30px !important;
    border: none !important;
    font-weight: bold;
    width: 100%; /* Make buttons full-width in their containers */
    max-width: 350px; /* But prevent them from becoming too wide */
    display: inline-block;
    text-align: center;
}
/*
 * 19.0 - Final Layout Fixes for Cart Page & Page Titles
 * --------------------------------------------------------------------------------
 */

/* --- 1. Fix for Horizontal Scroll on Cart Page Table (Mobile) --- */
@media (max-width: 768px) {
    /* * This targets the main form on the cart page, which contains the table.
     * It forces any overflow (the wide table) to be scrollable horizontally
     * within the form itself, preventing the entire page from scrolling.
    */
    .woocommerce-cart .woocommerce-cart-form {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    }
}

/* --- 2. Center Align and Enlarge Page Titles --- */
/*
 * This rule targets the main title on all static pages and WooCommerce pages
 * (like Cart, Checkout, My Account) to ensure they are consistently styled.
*/
.page .entry-title,
.woocommerce-page .entry-title {
    text-align: center !important;
    margin-bottom: 50px !important;
    font-size: 38px !important; /* Increased font size */
    font-weight: bold;
}
/*
 * 19.1 - Responsive Fix for WooCommerce Cart Block Price Overflow
 * --------------------------------------------------------------------------------
 */

/*
 * This targets the specific price value element within the block-based cart
 * on mobile screens to prevent it from causing horizontal scroll.
 */
@media (max-width: 768px) {
    .woocommerce-cart .wc-block-components-product-price__value {
        white-space: normal !important; /* Force the price text to wrap */
        word-break: break-word;     /* Break long numbers if needed */
        text-align: left;           /* Align price to the left (in RTL context) */
        min-width: 80px;            /* Give it a reasonable minimum width */
    }
}
/*
 * 20.0 - Final WooCommerce UI Fixes
 * --------------------------------------------------------------------------------
 */

/*
 * Force Vazirmatn font on the WooCommerce ordering dropdown.
*/
.woocommerce-ordering select {
    font-family: 'Vazirmatn', sans-serif !important;
    padding: 8px 12px; /* Add some padding for better appearance */
    border-radius: 5px;
}
/*
 * FINAL - Universal Product Image Hover Effect (Corrected Positioning)
 * --------------------------------------------------------------------------------
 */

/* The link that wraps the images. This is the foundation. */
.product a.product-image-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
}

/* The primary image (the one that's normally visible) */
.product a.product-image-wrapper .attachment-woocommerce_thumbnail {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* The hover image (initially hidden and positioned on top of the primary one) */
.product a.product-image-wrapper .product-image-hover {
    position: absolute !important; /* Force absolute positioning */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0; /* Hide it by default */
    transition: opacity 0.3s ease-in-out;
}

/* When the user hovers over the link wrapper... */
.product a.product-image-wrapper:hover .attachment-woocommerce_thumbnail {
    opacity: 0; /* ...fade out the primary image. */
}

.product a.product-image-wrapper:hover .product-image-hover {
    opacity: 1; /* ...and fade in the hover image. */
}

/*
 * =================================================================
 * FINAL STABLE HEADER STYLES (LOGO-CENTER ONLY)
 * This block replaces all previous header & responsive CSS.
 * =================================================================
 */

/* --- 1. Base Header Structure --- */
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative; /* This is critical for centering the logo */
}
.header-group {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-group--left {
    flex: 1; /* Take up space */
    justify-content: flex-start;
}
.header-group--center {
    /* This group is now centered using the absolute positioning method */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.header-group--right {
    flex: 1; /* Take up space */
    justify-content: flex-end;
}

.site-branding img.custom-logo {
    max-height: 50px;
    width: auto;
}
.action-icon {
    background: none; border: none; cursor: pointer; padding: 0;
    color: #111; position: relative; display: flex;
}
.action-icon svg {
    width: 24px; height: 24px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- 2. Desktop Specific Styles (min-width: 992px) --- */
@media (min-width: 992px) {
    .mobile-menu-toggle, .mobile-search {
        display: none;
    }
    .main-navigation {
        display: flex;
    }
    .main-navigation ul { display: flex; gap: 1px; }
    .main-navigation a { font-weight: bold; }
}

/* --- 3. Mobile Specific Styles (max-width: 991px) --- */
@media (max-width: 991px) {
    .main-navigation, .desktop-search {
        display: none;
    }
    .mobile-menu-toggle {
        display: flex;
    }
}

/*
 * 11.3 - Product Gallery Video Thumbnail Style
 * --------------------------------------------------------------------------------
 */

.gallery-item--video {
    position: relative;
}

.gallery-item--video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white"><path d="M8 5v14l11-7z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    pointer-events: none; 
}

.gallery-item--video:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(0, 0, 0, 0.7);
}


.f-thumbs__slide.for-video {
    position: relative;
}

.f-thumbs__slide.for-video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; 
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white"><path d="M8 5v14l11-7z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px; 
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
}

.f-thumbs__slide.for-video:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(0, 0, 0, 0.7);
}

video.gallery-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


#mobile-navigation .sub-menu {
  display: none;
}
#mobile-navigation .menu-item-has-children > a {
  position: relative;
  padding-left: 35px; 
}

#mobile-navigation .menu-item-has-children.submenu-open > .sub-menu {
  display: block;
}


#mobile-navigation .menu-item-has-children > a::before {
  content: '▼';
  font-size: 12px;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #333; 
  transition: transform 0.2s ease-in-out; 
}

#mobile-navigation .menu-item-has-children.submenu-open > a::before {
  content: '▲';
}





.woocommerce ul.products:not(.related .products) li.product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.woocommerce ul.products:not(.related .products) li.product .product-image-wrapper {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background-color: #f5f5f5;
}

.woocommerce ul.products:not(.related .products) li.product .product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.woocommerce ul.products:not(.related .products) li.product .woocommerce-loop-product__title {
    line-height: 1.1em;
    height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}




.related.products ul.products li.product .product-image-wrapper {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background-color: #f5f5f5;
}

.related.products ul.products li.product .product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.related.products ul.products li.product .woocommerce-loop-product__title {
 
    min-height: 2.8em; 
    
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
}