/* =========================================================
   Iron Price Widget — Front-end Styles
   ========================================================= */

.ip-widget {
    direction: rtl;
    font-family: inherit;
    width: 100%;
}

/* Loading state */
.ip-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: #888;
    font-size: 14px;
}
.ip-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1a3a5c;
    border-radius: 50%;
    animation: ip-spin 0.8s linear infinite;
}
@keyframes ip-spin { to { transform: rotate(360deg); } }

/* Error state */
.ip-error {
    padding: 20px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #c0392b;
    font-size: 14px;
    text-align: center;
}

/* دسته‌بندی */
.ip-category {
    margin-bottom: 24px;
}

/* هدر دسته‌بندی */
.ip-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    gap: 8px;
}
.ip-category-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.ip-update-time {
    font-size: 12px;
    color: #7a7166;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* جدول */
.ip-table-wrap {
    overflow-x: auto;
    border: 1px solid #e8e2d9;
    border-radius: 0 0 10px 10px;
}
.ip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}
.ip-table thead th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    background-color: #1a3a5c;
    color: #fff;
}
.ip-table tbody td {
    padding: 11px 10px;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s;
}
.ip-table tbody tr:hover td {
    filter: brightness(0.97);
}

/* قیمت */
.ip-price-cell {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

/* دکمه استعلام */
.ip-inquiry-btn {
    display: inline-block;
    padding: 6px 14px;
    background-color: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
}
.ip-inquiry-btn:hover { opacity: 0.88; }
.ip-inquiry-btn:active { transform: scale(0.97); }

/* =========================================================
   مودال استعلام
   ========================================================= */
.ip-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ip-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}
.ip-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 24px;
    width: 90%;
    max-width: 380px;
    direction: rtl;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: ip-modal-in 0.25s ease;
}
@keyframes ip-modal-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.ip-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 4px;
}
.ip-modal-close:hover { color: #333; }
.ip-modal-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #1a3a5c;
}
.ip-modal-product-name {
    font-size: 13px;
    color: #7a7166;
    margin: 0 0 20px;
    min-height: 18px;
}
.ip-form-group {
    margin-bottom: 16px;
}
.ip-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3a3a3a;
    margin-bottom: 6px;
}
.ip-mobile-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    letter-spacing: 0.08em;
    direction: ltr;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}
.ip-mobile-input:focus {
    outline: none;
    border-color: #1a3a5c;
}
.ip-mobile-input.ip-error-input {
    border-color: #c0392b;
}
.ip-form-error {
    font-size: 12px;
    color: #c0392b;
    margin-top: 5px;
}
.ip-submit-inquiry {
    width: 100%;
    padding: 12px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}
.ip-submit-inquiry:hover { opacity: 0.88; }
.ip-submit-inquiry:disabled { opacity: 0.6; cursor: wait; }
.ip-inquiry-success {
    margin-top: 14px;
    padding: 12px;
    background: #f0faf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 14px;
    text-align: center;
}

/* =========================================================
   Admin styles (loaded separately)
   ========================================================= */
