/*
Theme Name: طلائیا - Talaia Gold Marketplace
Theme URI: https://talaia.ir
Description: قالب حرفه‌ای و لوکس برای فروشگاه آنلاین طلا، شمش، سکه و زیورآلات
Version: 1.0.0
Author: Talaia Development
Author URI: https://talaia.ir
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: talaia
Domain Path: /languages
Requires at least: 5.0
Requires PHP: 7.4
Tested up to: 6.4
WC tested up to: 8.0
*/

:root {
    --gold: #D4AF37;
    --gold-light: #E8CC6A;
    --gold-dark: #A8882A;
    --gold-pale: #FBF5DC;
    --white: #FFFFFF;
    --charcoal: #1A1A1A;
    --charcoal-soft: #2C2C2C;
    --gray-bg: #F7F7F7;
    --gray-mid: #E8E8E8;
    --gray-text: #6B6B6B;
    --green: #2E7D32;
    --red: #C62828;
    --font: 'Vazirmatn', Tahoma, Arial, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-gold: 0 4px 20px rgba(212,175,55,0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-bg);
    color: var(--charcoal);
    direction: rtl;
    text-align: right;
    font-size: 14px;
    line-height: 1.7;
}

/* ===== WORDPRESS BASICS ===== */
a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}

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

button, input[type="button"], input[type="submit"] {
    font-family: var(--font);
    cursor: pointer;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== WOOCOMMERCE OVERRIDES ===== */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.woocommerce-message {
    background: rgba(46, 125, 50, 0.1);
    border-left: 4px solid var(--green);
    color: var(--green);
}

.woocommerce-error {
    background: rgba(198, 40, 40, 0.1);
    border-left: 4px solid var(--red);
    color: var(--red);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1.5px solid transparent;
}

.product:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.product-image {
    position: relative;
    overflow: hidden;
    background: var(--gray-bg);
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
    padding: 12px 12px 0;
}

.product-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--charcoal);
    padding: 8px 12px;
}

.price {
    color: var(--charcoal);
    font-weight: 700;
}

.price del {
    opacity: 0.6;
    font-size: 0.9em;
}

.product-rating {
    padding: 0 12px;
    color: var(--gold);
}

.button {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--charcoal);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-gold);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

.button.alt {
    background: none;
    color: var(--gold-dark);
    border: 1.5px solid var(--gold);
}

.button.alt:hover {
    background: var(--gold-pale);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ===== CUSTOM PRODUCT CARD STYLING ===== */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

/* Badge (e.g. پرفروش, جدید) - Hidden as requested */
.product-badge {
    display: none !important;
}
/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--charcoal);
}

.wishlist-btn .heart-icon {
    width: 16px;
    height: 16px;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.wishlist-btn:hover {
    background: var(--white);
    transform: scale(1.1);
    color: var(--red);
}

.wishlist-btn.active {
    color: var(--red);
}

.wishlist-btn.active .heart-icon {
    fill: var(--red);
    stroke: var(--red);
}
/* Product Image Wrapper */
.product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Force perfect square */
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--gray-mid);
    padding: 12px; /* Add padding to keep image away from borders */
}

.product-img img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain; /* Do not crop the gold product image */
    transition: transform 0.5s ease;
}

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

/* Fallback emoji/icon inside image container */
.product-img:not(:has(img)) {
    font-size: 48px;
    background: radial-gradient(circle, #fff 0%, var(--gray-bg) 100%);
}

/* Product Body */
.product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center-align children */
    text-align: center; /* Center-align text */
    flex-grow: 1; /* Stretch to fill card height */
}

/* Product Name */
.product-name {
    font-size: 14px;
    font-weight: 750;
    color: var(--charcoal);
    line-height: 1.5;
    margin-bottom: 12px;
    height: 42px; /* Force exactly two lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    width: 100%;
    transition: color 0.2s ease;
}

.product-card:hover .product-name {
    color: var(--gold-dark);
}

/* Product Meta (Weight, Purity, Workmanship) */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center metadata badges */
    gap: 6px 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--gray-mid);
    min-height: 48px; /* Alignment helper */
    width: 100%;
}

.product-meta span {
    font-size: 11px;
    color: var(--gray-text);
    background: var(--gray-bg);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Product Price & Button Box */
.product-price {
    margin-top: auto; /* Push to bottom */
    display: flex;
    flex-direction: column; /* Stack price and button vertically */
    align-items: center;
    gap: 12px;
    width: 100%;
}

.price-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--charcoal);
    display: flex;
    align-items: baseline;
    gap: 3px;
    justify-content: center;
}

.price-unit {
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-text);
}

/* Add to Cart Button inside card (Styled as a premium full-width box) */
.product-card .btn-cart {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--charcoal);
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
}

.product-card .btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

