/* Titan Home — WooCommerce styling.
   Reuses --th-* tokens. Loaded only when WooCommerce is active and the
   current view is shop / product / cart / checkout / account. */

/* Shop wrapper */
.titanhome-shop-wrap {
    padding-block: 48px 64px;
}

.titanhome-shop-note {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--th-blue-light);
    border: 1px solid var(--th-blue-border);
    border-radius: var(--th-radius-md);
    font-size: 14px;
    line-height: 2;
}

/* Fix Titan logo size on WooCommerce pages */
.woocommerce .titanhome-logo-image,
.woocommerce-page .titanhome-logo-image {
	width: 28 !important;
	height: 150px !important;
	max-width: 150px !important;
	display: block;
}


/* Mobile */
@media (max-width: 768px) {
	.woocommerce .titanhome-logo-image,
	.woocommerce-page .titanhome-logo-image {
		width: 120px !important;
		height: auto !important;
		max-width: 120px !important;
	}
}

.titanhome-shop-note a {
    color: var(--th-blue);
    font-weight: 700;
}

/* Single-product hero is a back-link (the product prints its own h1). */
.titanhome-shop-back {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.titanhome-shop-back a {
    color: var(--th-blue);
}

/* Product loop cards */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    content: none;
}

.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    width: auto !important;
    margin: 0 !important;
    background: var(--th-surface);
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-lg);
    overflow: hidden;
    text-align: right;
}

.woocommerce ul.products li.product a img {
    margin: 0;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: 16px 20px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--th-text);
}

.woocommerce ul.products li.product .price {
    padding: 0 20px;
    color: var(--th-text);
    font-size: 15px;
    font-weight: 700;
}

.woocommerce ul.products li.product .price del {
    color: var(--th-text-muted);
    font-weight: 400;
}

.woocommerce ul.products li.product .button {
    margin: auto 20px 20px;
}

/* Woo buttons → Titan buttons */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    min-height: 50px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--th-blue);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--th-radius-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 50px;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: var(--th-blue-hover);
    color: #fff;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
    background: var(--th-blue);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
    background: var(--th-blue-hover);
}

/* Single product: gallery right (RTL first), summary left */
.woocommerce div.product {
    overflow: hidden;
}

.woocommerce div.product div.images,
.woocommerce div.product div.summary {
    margin-bottom: 32px;
}

.woocommerce div.product div.images img {
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-lg);
}

.woocommerce div.product .product_title {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.6;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: var(--th-text);
    font-size: 20px;
    font-weight: 800;
}

.woocommerce div.product .stock {
    font-size: 14px;
    font-weight: 600;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    color: var(--th-text-muted);
    line-height: 2;
}

.woocommerce div.product .sku_wrapper {
    display: block;
    margin-top: 12px;
    color: var(--th-text-muted);
    font-size: 13px;
}

/* Trust row under the summary (guarantee note, phone orders, support). */
.titanhome-trust-row {
    margin: 20px 0 0;
    padding: 16px 20px;
    list-style: none;

    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;

    background: var(--th-surface-low);
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-md);
}

.titanhome-trust-row li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.titanhome-trust-row .material-symbols-outlined {
    color: var(--th-blue);
    font-size: 20px;
}

/* Buy box: WhatsApp / phone / Digikala / installment (single product). */
.titanhome-buy-box {
    margin-top: 20px;
    padding: 22px;
    background: var(--th-surface);
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-lg);
}

.titanhome-buy-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
}

.titanhome-buy-note {
    margin: 0 0 12px;
    color: var(--th-text-muted);
    font-size: 13.5px;
    line-height: 2;
}

.titanhome-buy-installment {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--th-blue-light);
    border: 1px solid var(--th-blue-border);
    border-radius: var(--th-radius-md);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.9;
}

.titanhome-buy-installment .material-symbols-outlined {
    color: var(--th-blue);
    font-size: 22px;
    flex-shrink: 0;
}

.titanhome-buy-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.titanhome-buy-actions .titanhome-button {
    flex: 1;
    white-space: nowrap;
}

/* Dark button lives in main.css (also used by the homepage showcase). */

/* Tabs */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: var(--th-surface-low);
    border-color: var(--th-outline-light);
    border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: var(--th-surface);
}

/* Notices */
.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--th-blue);
}

.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--th-blue);
}

/* Tables (cart / checkout) */
.woocommerce table.shop_table {
    background: var(--th-surface);
    border-color: var(--th-outline-light);
    border-radius: var(--th-radius-md);
}

.woocommerce table.shop_table th {
    color: var(--th-text);
}

/* Quantity + inputs */
.woocommerce .quantity .qty {
    min-height: 50px;
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-sm);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-sm);
    font: inherit;
}

@media (max-width: 921.98px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Cart totals + checkout columns stack below the tablet breakpoint. */
    .woocommerce .cart-collaterals .cart_totals {
        width: 100%;
        float: none;
    }

    .woocommerce .col2-set .col-1,
    .woocommerce .col2-set .col-2 {
        width: 100%;
        float: none;
    }

    #order_review {
        float: none;
        width: 100%;
    }
}

/* Cart table becomes stacked cards; cells label themselves via data-title. */
@media (max-width: 768px) {
    .woocommerce table.shop_table_responsive thead {
        display: none;
    }

    .woocommerce table.shop_table_responsive tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--th-outline-light);
        border-radius: var(--th-radius-md);
        background: var(--th-surface);
        overflow: hidden;
    }

    .woocommerce table.shop_table_responsive tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        border-bottom: 1px solid var(--th-outline-light);
        text-align: end;
    }

    .woocommerce table.shop_table_responsive tbody td:last-child {
        border-bottom: 0;
    }

    .woocommerce table.shop_table_responsive tbody td::before {
        content: attr(data-title);
        font-weight: 700;
        font-size: 13px;
        flex-shrink: 0;
    }

    .woocommerce table.shop_table_responsive td.product-remove {
        justify-content: flex-end;
    }

    .woocommerce table.shop_table_responsive td.product-thumbnail {
        justify-content: center;
    }

    .woocommerce table.shop_table_responsive td.product-thumbnail::before,
    .woocommerce table.shop_table_responsive td.product-remove::before,
    .woocommerce table.shop_table_responsive td.actions::before {
        content: none;
    }

    .woocommerce table.shop_table_responsive td.actions {
        display: block;
    }

    .woocommerce table.shop_table_responsive td.actions .coupon {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .woocommerce table.shop_table_responsive td.actions .coupon input {
        width: 100%;
    }

    .woocommerce table.shop_table_responsive td.actions .button {
        width: 100%;
    }

    .woocommerce form .form-row-first,
    .woocommerce form .form-row-last {
        width: 100%;
        float: none;
    }
}

@media (max-width: 600px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }

    .woocommerce div.product p.price,
    .woocommerce div.product span.price {
        font-size: 18px;
    }
}
