/**
 * WooCommerce Helpers CSS
 * 
 * Reusable WooCommerce styling utilities.
 * Extracted from Monitor Market + Elessi Theme patterns.
 */

/* ===========================================
   Persian Checkout Fields
   =========================================== */

.sc-checkout-form .form-row {
    margin-bottom: 1rem;
}

.sc-checkout-form .form-row label {
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-sm);
    font-weight: 500;
    color: var(--sc-text-color, #333333);
    margin-bottom: 0.5rem;
    display: block;
    text-align: start;
}

.sc-checkout-form .form-row input,
.sc-checkout-form .form-row select,
.sc-checkout-form .form-row textarea {
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-base);
    padding: 0.75rem 1rem;
    border: 1px solid var(--sc-border-color, #cccccc);
    border-radius: 4px;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sc-checkout-form .form-row input:focus,
.sc-checkout-form .form-row select:focus,
.sc-checkout-form .form-row textarea:focus {
    outline: none;
    border-color: var(--sc-primary-color, #1a73e8);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

[dir="rtl"] .sc-checkout-form .form-row input,
[dir="rtl"] .sc-checkout-form .form-row select,
[dir="rtl"] .sc-checkout-form .form-row textarea {
    direction: rtl;
    text-align: right;
}

/* ===========================================
   Product Card
   =========================================== */

.sc-product-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sc-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.sc-product-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.sc-product-card__content {
    padding: 1rem;
}

.sc-product-card__title {
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-lg);
    font-weight: 600;
    color: var(--sc-text-color, #333333);
    margin-bottom: 0.5rem;
    line-height: var(--sc-line-height-tight);
}

.sc-product-card__price {
    font-family: var(--sc-font-persian-bold);
    font-size: var(--sc-text-xl);
    font-weight: 700;
    color: var(--sc-price-color, #1a73e8);
    margin-bottom: 0.5rem;
}

.sc-product-card__vehicle {
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted, #666666);
}

.sc-product-card__button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--sc-primary-color, #1a73e8);
    color: #ffffff;
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-base);
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sc-product-card__button:hover {
    background: var(--sc-primary-dark, #1557b0);
}

/* ===========================================
   Product Grid
   =========================================== */

.sc-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .sc-product-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   Cart Styles
   =========================================== */

.sc-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.sc-cart-table th,
.sc-cart-table td {
    padding: 1rem;
    text-align: start;
    border-bottom: 1px solid var(--sc-border-color, #eeeeee);
}

[dir="rtl"] .sc-cart-table th,
[dir="rtl"] .sc-cart-table td {
    text-align: right;
}

.sc-cart-table th {
    font-family: var(--sc-font-persian);
    font-weight: 600;
    color: var(--sc-text-color, #333333);
}

.sc-cart-table td {
    font-family: var(--sc-font-persian);
    color: var(--sc-text-color, #333333);
}

.sc-cart-total {
    font-family: var(--sc-font-persian-bold);
    font-size: var(--sc-text-xl);
    font-weight: 700;
    color: var(--sc-price-color, #1a73e8);
}

/* ===========================================
   Order Status
   =========================================== */

.sc-order-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-sm);
    font-weight: 500;
}

.sc-order-status--pending {
    background: #fef3cd;
    color: #856404;
}

.sc-order-status--processing {
    background: #cce5ff;
    color: #004085;
}

.sc-order-status--completed {
    background: #d4edda;
    color: #155724;
}

.sc-order-status--on-hold {
    background: #fff3cd;
    color: #856404;
}

.sc-order-status--cancelled {
    background: #f8d7da;
    color: #721c24;
}

.sc-order-status--refunded {
    background: #d1ecf1;
    color: #0c5460;
}

.sc-order-status--failed {
    background: #f8d7da;
    color: #721c24;
}

/* ===========================================
   Invoice
   =========================================== */

.sc-invoice {
    background: #ffffff;
    border: 1px solid var(--sc-border-color, #eeeeee);
    border-radius: 8px;
    padding: 2rem;
    font-family: var(--sc-font-persian);
}

.sc-invoice__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sc-border-color, #eeeeee);
}

.sc-invoice__title {
    font-size: var(--sc-text-2xl);
    font-weight: 700;
    color: var(--sc-heading-color, #1a1a1a);
}

.sc-invoice__number {
    font-size: var(--sc-text-lg);
    color: var(--sc-text-muted, #666666);
}

.sc-invoice__customer {
    margin-bottom: 2rem;
}

.sc-invoice__customer-name {
    font-size: var(--sc-text-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sc-invoice__customer-details {
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted, #666666);
}

.sc-invoice__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.sc-invoice__table th,
.sc-invoice__table td {
    padding: 0.75rem;
    text-align: start;
    border-bottom: 1px solid var(--sc-border-color, #eeeeee);
}

[dir="rtl"] .sc-invoice__table th,
[dir="rtl"] .sc-invoice__table td {
    text-align: right;
}

.sc-invoice__table th {
    background: var(--sc-gray-100, #f5f5f5);
    font-weight: 600;
}

.sc-invoice__totals {
    display: flex;
    justify-content: flex-end;
}

.sc-invoice__totals-table {
    width: 300px;
}

.sc-invoice__totals-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.sc-invoice__totals-row--total {
    border-top: 2px solid var(--sc-border-color, #eeeeee);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: var(--sc-text-lg);
    color: var(--sc-price-color, #1a73e8);
}

/* ===========================================
   Vehicle Selector
   =========================================== */

.sc-vehicle-selector {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sc-vehicle-selector__step {
    margin-bottom: 1.5rem;
}

.sc-vehicle-selector__step-title {
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-lg);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.sc-vehicle-selector__select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-base);
    border: 1px solid var(--sc-border-color, #cccccc);
    border-radius: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
}

[dir="rtl"] .sc-vehicle-selector__select {
    background-position: right 1rem center;
}

.sc-vehicle-selector__select:focus {
    outline: none;
    border-color: var(--sc-primary-color, #1a73e8);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.sc-vehicle-selector__results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--sc-border-color, #eeeeee);
}

/* ===========================================
   Button Styles
   =========================================== */

.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-base);
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.sc-btn:active {
    transform: scale(0.98);
}

.sc-btn--primary {
    background: var(--sc-primary-color, #1a73e8);
    color: #ffffff;
}

.sc-btn--primary:hover {
    background: var(--sc-primary-dark, #1557b0);
}

.sc-btn--secondary {
    background: var(--sc-secondary-color, #34a853);
    color: #ffffff;
}

.sc-btn--secondary:hover {
    background: var(--sc-secondary-dark, #2e7d32);
}

.sc-btn--outline {
    background: transparent;
    color: var(--sc-primary-color, #1a73e8);
    border: 2px solid var(--sc-primary-color, #1a73e8);
}

.sc-btn--outline:hover {
    background: var(--sc-primary-color, #1a73e8);
    color: #ffffff;
}

.sc-btn--full {
    width: 100%;
}

.sc-btn--sm {
    padding: 0.5rem 1rem;
    font-size: var(--sc-text-sm);
}

.sc-btn--lg {
    padding: 1rem 2rem;
    font-size: var(--sc-text-lg);
}

/* ===========================================
   Badge Styles
   =========================================== */

.sc-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-family: var(--sc-font-persian);
    font-size: var(--sc-text-xs);
    font-weight: 500;
    border-radius: 4px;
}

.sc-badge--primary {
    background: var(--sc-primary-color, #1a73e8);
    color: #ffffff;
}

.sc-badge--secondary {
    background: var(--sc-secondary-color, #34a853);
    color: #ffffff;
}

.sc-badge--warning {
    background: var(--sc-warning-color, #fbbc04);
    color: #000000;
}

.sc-badge--danger {
    background: var(--sc-danger-color, #ea4335);
    color: #ffffff;
}

.sc-badge--stock {
    background: #d4edda;
    color: #155724;
}

.sc-badge--out-of-stock {
    background: #f8d7da;
    color: #721c24;
}
