:root {
    --bg-dark: #13171a;
    --accent-green: #1d3b2a;
    --accent-green-hover: #142a1e;
    --text-main: #222222;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    --card-bg: #f8f8f8;
    --star-color: #f59e0b;
    --font-family: "ray", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}



body {
    background-color: #fcfcfc;
    color: var(--text-main);
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
}

p {
    letter-spacing: 1px;
}

/* ================= HEADER ================= */
header {
    background-color: var(--bg-dark);
    color: #ffffff;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-box {
    border: 1px solid #d4af37;
    padding: 4px 8px;
    font-size: 20px;
    font-weight: bold;
    font-family: serif;
}

.logo-text span {
    display: block;
    font-size: 11px;
    color: #aaa;
}

.search-bar {
    display: flex;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    width: 45%;
    max-width: 550px;
}

.search-bar select {
    border: none;
    padding: 8px 15px;
    background: #f0f0f0;
    font-size: 12px;
    outline: none;
    border-left: 1px solid #ddd;
}

.search-bar input {
    border: none;
    padding: 8px 15px;
    width: 100%;
    outline: none;
    font-size: 12px;
}

.search-bar button {
    border: none;
    background: transparent;
    padding: 0 15px;
    cursor: pointer;
    color: #555;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
}

.cart-icon {
    position: relative;
    font-size: 18px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #d97706;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav {
    padding: 12px 5%;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    font-size: 13px;
}

nav ul li a {
    color: #ccc;
    transition: 0.2s;
}

nav ul li a:hover,
nav ul li a.active {
    color: #ffffff;
    font-weight: bold;
}

/* ================= CONTAINER ================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
}

.breadcrumbs {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    margin-top: 1rem;
}

/* ================= PRODUCT HEADER ================= */
.product-header {
    text-align: center;
    margin-bottom: 30px;
}

.product-header h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-header .english-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.rating-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.stars {
    color: var(--star-color);
    font-size: 13px;
}

/* ================= MAIN PRODUCT DETAILS ================= */
.product-main {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

/* Left Side: Actions & Info */
.buy-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.price-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #eee;
}

.price-value {
    font-size: 13px;
    color: #777;
}

.price-note {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: bold;
    color: #1a1a1a;
}

.price-amount {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
}

.price-currency {
    font-size: 13px;
    color: #555;
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.category-tag {
    font-size: 11px;
    background: #fff;
    border: 1px solid #ddd;
    color: #444;
    padding: 3px 10px;
    border-radius: 999px;
}

.price-category-row {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.price-box,
.category-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

/* ================= DISCOUNT ================= */
.product-price {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

.product-price.price-discounted {
    color: #16a34a;
}

.product-price.price-placeholder {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.price-old-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-price-old {
    font-size: 12px;
    color: #e11d48;
    text-decoration: line-through;
}

.discount-badge {
    background-color: #e11d48;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 9px;
    border-radius: 20px;
}

.stock-status {
    color: #16a34a;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-status-out {
    color: #dc2626;
}

.stock-status-pending {
    color: var(--text-muted);
}

.pd-description {
    font-size: 14px;
    line-height: 1.9;
    color: #444;
}

.features-list {
    list-style: none;
    font-size: 12px;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.features-list li {
    position: relative;
    padding-right: 15px;
}

.features-list li::before {
    content: "•";
    color: #d97706;
    font-weight: bold;
    position: absolute;
    right: 0;
    top: 0;
}

/* Color & Size Selector */
.color-selector {
    margin-top: 5px;
}

.color-selector label {
    display: block;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
}

.color-dots {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    outline-offset: 2px;
}

.dot.active {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* --- سواچ رنگی: دایره‌ی رنگ + کد ویستا زیرش --- */
.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 5px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.color-swatch .dot {
    cursor: pointer;
    transition: transform 0.15s ease;
}


.color-swatch .swatch-code {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1;
    direction: ltr;
}

.color-swatch.active {
    background-color: #f0f0f0;
}

.color-swatch.active .dot {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.color-swatch.active .swatch-code {
    color: var(--text-main);
    font-weight: 800;
}

.size-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #17171f);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.size-dot.active {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.color-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    max-width: 226px;
}

/* Quantity & Buttons */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.qty-picker {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: #fafafa;
}

.qty-picker button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}

.qty-picker input {
    width: 35px;
    border: none;
    text-align: center;
    background: transparent;
    font-size: 13px;
    outline: none;
}

.btn-add-to-cart {
    background-color: var(--accent-green);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: 0.2s;
}

.btn-add-to-cart:hover {
    background-color: var(--accent-green-hover);
}

.btn-wishlist {
    background: #f8f8f8;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* Trust Badges Grid */
.trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    margin-top: 10px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-item i {
    font-size: 24px;
    color: #333;
    flex-shrink: 0;
}

.badge-text {
    display: flex;
    flex-direction: column;
}

.badge-text strong {
    font-size: 13px;
    color: #222;
}

.badge-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Right Side: Product Gallery */
.gallery-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-container {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    overflow: hidden;
}

.pd-image-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-image {
    position: absolute;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.pd-image.active {
    opacity: 1;
    visibility: visible;
}

/* نوار کنترل اسلایدر: زیر عکس اصلی و بیرون از کادر عکس، طوری که هیچ‌وقت روی عکس نیفتد */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.gallery-controls-sep {
    width: 1px;
    height: 18px;
    background: var(--border-color, #e5e5e5);
}

.nav-arrow {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    color: #555;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.nav-arrow:hover {
    background: var(--accent-green, #1d3b2a);
    border-color: var(--accent-green, #1d3b2a);
    color: #fff;
}

.nav-arrow:active {
    transform: scale(0.94);
}

button.nav-arrow {
    padding: 0;
}

.zoom-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: white;
    border: 1px solid var(--border-color, #e5e5e5);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #666;
    cursor: pointer;
    z-index: 2;
}

.thumbnail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.thumb-item.active {
    border-color: var(--accent-green, #1d3b2a);
}

/* .thumb-item is now a <button>, so reset the browser's default button styling
   while keeping the border/background/radius already defined above */
button.thumb-item {
    padding: 0;
    font: inherit;
    outline-offset: 2px;
}

.thumb-item img {
    max-height: 80%;
    max-width: 80%;
    object-fit: contain;
}

/* ================= TABS SECTION ================= */
.tabs-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 30px;
    margin-bottom: 25px;
}

.tab-btn {
    padding-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--text-main);
    font-weight: bold;
    border-bottom-color: #333;
}

.tabs-content {
    display: block;
}

table.tab-pane.active {
    display: table;
    width: 100%;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-desc {
    font-size: 13px;
    line-height: 2;
    color: #444;
}

.tab-desc p {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 1px;
}

.tab-desc p:last-child {
    margin-bottom: 0;
}

.tab-desc ul {
    list-style: none;
    font-size: 12px;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-desc ul li {
    position: relative;
    padding-right: 15px;
}

.tab-desc ul li::before {
    content: "•";
    color: #d97706;
    font-weight: bold;
    position: absolute;
    right: 0;
    top: 0;
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.specs-table tr:nth-child(even) {
    background-color: #fafafa;
}

.specs-table td {
    padding: 10px 12px;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

.specs-table td:first-child {
    color: var(--text-muted);
    width: 35%;
}

/* ================= RELATED PRODUCTS ================= */
.related-section {
    margin-bottom: 50px;
    position: relative;
}

.related-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.related-section-header .section-title {
    margin-bottom: 0;
}

.section-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.related-viewall {
    font-size: 12px;
    color: var(--accent-green, #1d3b2a);
    font-weight: bold;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.related-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.wishlist-icon-btn {
    background: transparent;
    border: none;
    padding: 0;
}

.related-card .wishlist-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}

.related-img {
    height: 130px;
    background: var(--card-bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.related-img img {
    max-height: 80%;
    max-width: 80%;
    object-fit: contain;
}

.related-cat {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 4px;
}

.related-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-price {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.btn-card-add {
    background: var(--bg-dark);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Section Nav Arrows */
.section-arrow {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: #555;
    z-index: 2;
}

.section-arrow.left {
    left: -15px;
}

.section-arrow.right {
    right: -15px;
}

/* ================= FOOTER ================= */
footer {
    background-color: var(--bg-dark);
    color: #a0a0a0;
    padding-top: 40px;
    font-size: 12px;
}

.footer-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col h4 {
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 15px;
}

.footer-col p {
    line-height: 1.8;
    font-size: 11px;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.social-icons a {
    color: white;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-form {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.newsletter-form input {
    border: none;
    background: transparent;
    padding: 8px 10px;
    width: 100%;
    font-size: 11px;
    color: white;
    outline: none;
}

.newsletter-form button {
    background: #e5e5e5;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    color: #333;
}

.footer-features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-item i {
    font-size: 20px;
    color: #ffffff;
}

.feature-text div:first-child {
    color: #ffffff;
    font-weight: bold;
    font-size: 11px;
}

.feature-text div:last-child {
    font-size: 10px;
    color: #777;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #666;
}

/* ================= MEDIA QUERIES (RESPONSIVE MAIN CONTENT) ================= */

/* Tablet & Medium Screens (<= 992px) */
@media (max-width: 992px) {
    .product-main {
        grid-template-columns: 1fr; /* تغییر حالت ۲ ستونه به ۱ ستون */
        gap: 25px;
        padding: 20px;
    }

    /* ابتدا گالری تصاویر دیده می‌شود، سپس اطلاعات محصول */
    .gallery-box {
        order: 1;
    }

    .buy-box {
        order: 2;
    }

    .main-image-container {
        height: 320px;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .section-arrow {
        display: none; /* مخفی کردن فلش‌های شناور متداخل در تبلت و موبایل */
    }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .container {
        padding: 15px 15px;
    }

    .product-header h1 {
        font-size: 20px;
    }

    .product-main {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 25px;
    }

    .main-image-container {
        height: 280px;
    }

    .nav-arrow {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .gallery-controls {
        gap: 10px;
    }

    .thumb-item {
        width: 65px;
        height: 65px;
    }

    .tabs-container {
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 25px;
    }

    .tabs-header {
        gap: 15px;
        margin-bottom: 18px;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .tab-btn {
        font-size: 12px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .related-card {
        padding: 10px;
    }

    .related-img {
        height: 110px;
    }
}

/* Extra Small Mobile Screens (<= 360px) */
@media (max-width: 360px) {
    .container {
        padding: 10px 10px;
    }

    .product-header h1 {
        font-size: 17px;
    }

    .product-main {
        padding: 12px;
    }

    .main-image-container {
        height: 230px;
    }

    .thumb-item {
        width: 50px;
        height: 50px;
    }

    .thumbnail-list {
        gap: 6px;
    }

    .price-category-row {
        gap: 12px;
        justify-content: space-between;
    }

    .price-value {
        font-size: 11px;
    }

    .price-note {
        font-size: 13px;
    }

    .btn-add-to-cart,
    .btn-wishlist {
        padding: 10px;
        font-size: 12px;
    }

    .trust-badges {
        grid-template-columns: 1fr; /* تک ستونه شدن بنرهای اعتماد در سایز کوچک */
        gap: 12px;
    }

    .badge-item i {
        font-size: 20px;
    }

    .tabs-container {
        padding: 12px;
    }

    .specs-table td {
        padding: 8px;
        font-size: 11px;
    }

    .specs-table td:first-child {
        width: 40%;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .related-title {
        font-size: 10px;
    }

    .related-price {
        font-size: 11px;
    }

    .btn-card-add {
        font-size: 10px;
        padding: 6px;
    }
}