/* ============================================
   LW Shop - Frontend Styles (خاکستری کم‌رنگ)
   ============================================ */

:root {
    --lw-bg:           #f7f7f8;
    --lw-card-bg:      #fafafa;
    --lw-border:       #e5e5e7;
    --lw-text:         #3a3a3c;
    --lw-text-light:   #8a8a8e;
    --lw-accent:       #6b6b70;
    --lw-accent-hover: #4a4a4f;
    --lw-success:      #5a7d5a;
    --lw-error:        #a35a5a;
    --lw-warning:      #b8935a;
}

/* ---------- دکمه افزودن به سبد ---------- */
.lw-add-to-cart-wrap {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lw-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--lw-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
}

.lw-btn:hover {
    background: var(--lw-accent-hover);
    color: #fff;
}

.lw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lw-btn-secondary {
    background: #fff;
    color: var(--lw-text);
    border: 1px solid var(--lw-border);
}

.lw-btn-secondary:hover {
    background: var(--lw-bg);
    color: var(--lw-text);
}

.lw-btn-success {
    background: var(--lw-success);
}

.lw-btn-success:hover {
    background: #4a6a4a;
}

/* ---------- quantity selector ---------- */
.lw-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--lw-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.lw-qty-btn {
    width: 40px;
    height: 44px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--lw-text);
    transition: background 0.2s;
    font-family: inherit;
}

.lw-qty-btn:hover {
    background: var(--lw-bg);
}

.lw-qty-input {
    width: 60px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--lw-text);
    -moz-appearance: textfield;
}

.lw-qty-input::-webkit-outer-spin-button,
.lw-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- آیکون شناور سبد ---------- */
.lw-cart-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    background: var(--lw-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.lw-cart-float:hover {
    background: var(--lw-accent-hover);
    transform: scale(1.1);
}

.lw-cart-float-icon {
    font-size: 26px;
    line-height: 1;
}

.lw-cart-float-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--lw-error);
    color: #fff;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 0 6px;
    animation: lw-pulse 0.3s ease;
}

@keyframes lw-pulse {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---------- صفحه سبد خرید ---------- */
.lw-cart-page {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: inherit;
    color: var(--lw-text);
}

.lw-cart-page h1 {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--lw-text);
    border-bottom: 2px solid var(--lw-border);
    padding-bottom: 15px;
}

.lw-cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 8px;
    overflow: hidden;
}

.lw-cart-table thead {
    background: var(--lw-bg);
}

.lw-cart-table th {
    padding: 15px;
    text-align: right;
    color: var(--lw-text);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--lw-border);
}

.lw-cart-table td {
    padding: 15px;
    border-bottom: 1px solid var(--lw-border);
    color: var(--lw-text);
    font-size: 14px;
    vertical-align: middle;
}

.lw-cart-table tr:last-child td {
    border-bottom: none;
}

.lw-cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lw-cart-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--lw-border);
    background: var(--lw-bg);
}

.lw-cart-title {
    font-weight: 600;
    color: var(--lw-text);
    text-decoration: none;
}

.lw-cart-title:hover {
    color: var(--lw-accent);
}

.lw-cart-remove {
    background: none;
    border: none;
    color: var(--lw-error);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: opacity 0.2s;
}

.lw-cart-remove:hover {
    opacity: 0.7;
}

/* ---------- خلاصه سبد ---------- */
.lw-cart-summary {
    margin-top: 25px;
    background: var(--lw-card-bg);
    border: 1px solid var(--lw-border);
    border-radius: 8px;
    padding: 25px;
}

.lw-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--lw-border);
    color: var(--lw-text);
    font-size: 15px;
}

.lw-cart-summary-row:last-child {
    border-bottom: none;
}

.lw-cart-summary-row.lw-total {
    font-size: 18px;
    font-weight: bold;
    padding-top: 15px;
    margin-top: 5px;
    border-top: 2px solid var(--lw-border);
    border-bottom: none;
}

.lw-cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ---------- سبد خالی ---------- */
.lw-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--lw-card-bg);
    border: 1px dashed var(--lw-border);
    border-radius: 8px;
    color: var(--lw-text-light);
}

.lw-cart-empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.lw-cart-empty p {
    font-size: 16px;
    margin: 10px 0 20px;
}

/* ---------- نوتیفیکیشن ---------- */
.lw-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--lw-success);
    color: #fff;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.lw-notification.lw-show {
    transform: translateX(-50%) translateY(0);
}

.lw-notification.lw-error {
    background: var(--lw-error);
}

/* ---------- لودینگ دکمه ---------- */
.lw-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.lw-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lw-spin 0.6s linear infinite;
}

@keyframes lw-spin {
    to { transform: rotate(360deg); }
}

/* ---------- رسپانسیو ---------- */
@media (max-width: 600px) {
    .lw-cart-float {
        bottom: 20px;
        left: 20px;
        width: 55px;
        height: 55px;
    }
    .lw-cart-float-icon { font-size: 22px; }

    .lw-cart-table thead { display: none; }
    .lw-cart-table, .lw-cart-table tbody,
    .lw-cart-table tr, .lw-cart-table td {
        display: block;
        width: 100%;
    }
    .lw-cart-table tr {
        padding: 15px;
        border-bottom: 1px solid var(--lw-border);
    }
    .lw-cart-table td {
        padding: 5px 0;
        border-bottom: none;
    }
    .lw-cart-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        color: var(--lw-text-light);
        margin-bottom: 3px;
    }
}

/* ---------- دکمه دانلود رایگان ---------- */
.lw-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: var(--lw-success);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.lw-download-btn:hover {
    background: #4a6a4a;
    color: #fff;
}

/* ---------- پیام برای مهمان ---------- */
.lw-guest-message {
    background: var(--lw-bg);
    border: 1px solid var(--lw-border);
    border-right: 4px solid var(--lw-accent);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: var(--lw-text);
    margin: 20px 0;
}

.lw-guest-message p {
    margin: 0 0 15px;
    font-size: 15px;
}

.lw-guest-message .lw-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Checkout Page Styles
   ============================================ */

.lw-checkout-page {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 15px;
    color: var(--lw-text);
    font-family: inherit;
}

.lw-checkout-page h1 {
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--lw-border);
    padding-bottom: 15px;
}

.lw-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    align-items: start;
}

@media (max-width: 900px) {
    .lw-checkout-grid {
        grid-template-columns: 1fr;
    }
}

.lw-checkout-form .lw-card {
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.lw-checkout-form .lw-card h2 {
    margin: 0 0 18px;
    font-size: 16px;
    color: var(--lw-text);
    border-bottom: 1px solid var(--lw-border);
    padding-bottom: 12px;
}

.lw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .lw-form-row {
        grid-template-columns: 1fr;
    }
}

.lw-form-field {
    margin-bottom: 15px;
}

.lw-form-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--lw-text);
    margin-bottom: 7px;
}

.lw-required {
    color: #d32f2f;
}

.lw-form-field input[type="text"],
.lw-form-field input[type="email"],
.lw-form-field input[type="tel"],
.lw-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d5d7;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    color: var(--lw-text);
}

.lw-form-field input:focus,
.lw-form-field textarea:focus {
    border-color: var(--lw-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 107, 112, 0.15);
}

.lw-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.lw-shipping-note {
    background: #f0f4f8;
    border-right: 3px solid var(--lw-accent);
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--lw-text);
    margin-top: 15px;
    line-height: 1.7;
}

/* خلاصه سفارش */
.lw-checkout-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.lw-order-summary-card h2 {
    margin-bottom: 12px !important;
}

.lw-order-items {
    margin-bottom: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.lw-order-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #ececee;
    font-size: 13px;
    color: var(--lw-text);
}

.lw-order-item:last-child {
    border-bottom: none;
}

.lw-order-item-qty {
    color: var(--lw-text-light);
    font-size: 12px;
    margin-right: 5px;
}

.lw-order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--lw-border);
}

.lw-order-summary-row:last-child {
    border-bottom: none;
}

.lw-order-total {
    font-size: 17px !important;
    font-weight: 700;
    padding-top: 15px !important;
    margin-top: 5px;
    border-top: 2px solid var(--lw-border);
    color: var(--lw-text);
}

/* چک‌باکس هزینه پستی */
.lw-shipping-confirm-card {
    background: #f0f8f0 !important;
    border-color: #c5dcc5 !important;
}

.lw-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--lw-text);
    line-height: 1.6;
}

.lw-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--lw-success);
    flex-shrink: 0;
}

.lw-checkbox-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--lw-text-light);
    font-style: italic;
}

/* دکمه بزرگ */
.lw-btn-large {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 10px;
}

.lw-btn-large:disabled {
    background: #b5b5b7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* پیام */
.lw-checkout-message {
    display: none;
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.lw-message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-right: 3px solid #4caf50;
}

.lw-message-error {
    background: #ffebee;
    color: #c62828;
    border-right: 3px solid #f44336;
}

/* صفحه موفقیت سفارش */
.lw-checkout-success {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px 30px;
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 12px;
    text-align: center;
    color: var(--lw-text);
}

.lw-success-icon {
    font-size: 60px;
    margin-bottom: 15px;
    line-height: 1;
}

.lw-checkout-success h2 {
    font-size: 22px;
    margin: 0 0 25px;
    color: var(--lw-text);
}

.lw-success-box {
    background: #f7f7f8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
}

.lw-success-box p {
    margin: 10px 0;
    font-size: 15px;
    color: var(--lw-text);
}

.lw-success-note {
    background: #fff3cd;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #8a6d3b;
    margin: 20px 0;
    line-height: 1.7;
    border-right: 3px solid #ffc107;
}

.lw-success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* سبد خالی در تسویه */
.lw-checkout-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f7f7f8;
    border: 1px dashed var(--lw-border);
    border-radius: 8px;
    max-width: 500px;
    margin: 40px auto;
    color: var(--lw-text-light);
}

.lw-checkout-empty .lw-cart-empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}
/* ============================================
   Notification with Cart Button
   ============================================ */

.lw-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: #fff;
    color: var(--lw-text);
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 999999;
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 90vw;
    border-right: 4px solid var(--lw-success);
    direction: rtl;
}

.lw-notification.lw-show {
    transform: translateX(-50%) translateY(0);
}

.lw-notification.lw-error {
    border-right-color: var(--lw-error);
}

.lw-notification-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.lw-notification-text {
    flex: 1;
    line-height: 1.5;
    min-width: 120px;
}

.lw-notification-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: var(--lw-success);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.lw-notification-cart-btn:hover {
    background: #4a6a4a;
    color: #fff !important;
    transform: translateY(-1px);
}

.lw-notification-close {
    background: transparent;
    border: none;
    color: var(--lw-text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.lw-notification-close:hover {
    color: var(--lw-error);
}

/* رسپانسیو */
@media (max-width: 600px) {
    .lw-notification {
        top: 10px;
        padding: 12px 15px;
        font-size: 13px;
        max-width: 95vw;
        left: 50%;
    }
    .lw-notification-cart-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .lw-notification-icon {
        font-size: 18px;
    }
}
/* ============================================
   Payment Pages Styles
   ============================================ */

/* صفحه انتقال به زرین‌پال */
.lw-payment-redirect {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 30px 15px;
    direction: rtl;
}

.lw-payment-box {
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 12px;
    padding: 40px 35px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.lw-payment-icon {
    font-size: 60px;
    margin-bottom: 20px;
    line-height: 1;
    animation: lw-payment-pulse 1.5s ease-in-out infinite;
}

@keyframes lw-payment-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.lw-payment-box h1 {
    font-size: 20px;
    color: var(--lw-text);
    margin: 0 0 15px;
    font-weight: 700;
}

.lw-payment-box p {
    color: var(--lw-text-light);
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 20px;
}

.lw-payment-spinner {
    width: 50px;
    height: 50px;
    margin: 25px auto;
    border: 4px solid #ececee;
    border-top-color: var(--lw-success);
    border-radius: 50%;
    animation: lw-spin 1s linear infinite;
}

.lw-payment-note {
    font-size: 13px;
    color: var(--lw-text-light);
    margin-top: 20px;
}

.lw-payment-note a {
    color: var(--lw-accent);
    font-weight: 700;
    text-decoration: none;
}

.lw-payment-note a:hover {
    text-decoration: underline;
}

/* ============================================
   Payment Result Pages
   ============================================ */

.lw-payment-result {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 30px 15px;
    direction: rtl;
}

.lw-payment-result-box {
    background: #fff;
    border: 1px solid var(--lw-border);
    border-radius: 12px;
    padding: 40px 35px;
    text-align: center;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.lw-result-icon {
    font-size: 70px;
    margin-bottom: 20px;
    line-height: 1;
    display: inline-block;
}

.lw-payment-result-box h1 {
    font-size: 22px;
    margin: 0 0 15px;
    font-weight: 700;
}

.lw-payment-success .lw-payment-result-box h1 {
    color: #2e7d32;
}

.lw-payment-failed .lw-payment-result-box h1 {
    color: var(--lw-error);
}

.lw-payment-result-box > p {
    color: var(--lw-text-light);
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 25px;
}

.lw-result-info {
    background: #f7f7f8;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: right;
}

.lw-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    color: var(--lw-text);
    border-bottom: 1px solid #ececee;
}

.lw-info-row:last-child {
    border-bottom: none;
}

.lw-info-row strong {
    color: var(--lw-text);
    font-weight: 700;
}

.lw-status-paid {
    color: #2e7d32 !important;
}

.lw-info-note {
    font-size: 13px;
    color: var(--lw-text-light);
    line-height: 1.7;
    margin: 15px 0 0;
    padding-top: 15px;
    border-top: 1px dashed var(--lw-border);
    text-align: right;
}

.lw-result-note {
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #8a6d3b;
    margin: 20px 0;
    line-height: 1.7;
    text-align: right;
}

.lw-result-error {
    background: #f8d7da;
    border-right: 4px solid #dc3545;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
    color: #721c24;
    margin: 20px 0;
    line-height: 1.7;
    text-align: right;
}

.lw-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.lw-result-actions .lw-btn {
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- دکمه پرداخت مجدد ---------- */
.lw-order-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lw-btn-small {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

@media (max-width: 600px) {
    .lw-payment-box,
    .lw-payment-result-box {
        padding: 25px 20px;
    }

    .lw-payment-box h1,
    .lw-payment-result-box h1 {
        font-size: 18px;
    }

    .lw-result-icon {
        font-size: 50px;
    }

    .lw-result-actions {
        flex-direction: column;
    }

    .lw-result-actions .lw-btn {
        width: 100%;
    }
}