/**
 * Basalam Shop Styles
 */

html {
    direction: rtl;
}

body.basalam-shop-page,
body.basalam-shops-page {
    margin: 0;
    padding: 0;
    background: #fafafa;
}

.basalam-shop-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.basalam-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.basalam-shop-header {
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    padding: 20px 0;
    margin-bottom: 24px;
}

.basalam-shop-header h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.basalam-product-count {
    margin: 0;
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 400;
}

.basalam-shop-main {
    flex: 1;
}

.basalam-error {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    color: #6b6b6b;
    margin: 40px 0;
}

.basalam-error-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.basalam-error h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.basalam-error p {
    font-size: 14px;
    color: #6b6b6b;
    margin: 0;
}

.basalam-empty {
    text-align: center;
    padding: 80px 20px;
    margin: 40px 0;
}

.basalam-empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #fff5f2 0%, #ffe8e0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    opacity: 0.8;
}

.basalam-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.basalam-empty p {
    font-size: 14px;
    color: #6b6b6b;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.basalam-empty-suggestions {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    border: 1px solid #ebebeb;
}

.basalam-empty-suggestions li {
    font-size: 13px;
    color: #6b6b6b;
    list-style: none;
    position: relative;
    padding-right: 20px;
}

.basalam-empty-suggestions li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: #ff6b35;
    font-weight: 700;
}

.basalam-shop-footer {
    background: #fff;
    border-top: 1px solid #ebebeb;
    padding: 16px 0;
    margin-top: 32px;
    text-align: center;
    color: #6b6b6b;
    font-size: 13px;
}

.basalam-shop-footer a {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
}

.basalam-shop-footer a:hover {
    text-decoration: underline;
}

.basalam-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .basalam-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .basalam-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

.basalam-product-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.basalam-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #ddd;
}

.basalam-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.basalam-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.basalam-product-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.basalam-product-badges .badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.2px;
}

.badge-gray {
    background: #6b6b6b;
}

.badge-primary {
    background: #ff6b35;
}

.badge-green {
    background: #00c853;
}

.basalam-product-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.basalam-product-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.basalam-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    color: #999;
}

.basalam-product-category {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #6b6b6b;
}

.basalam-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.basalam-product-price::after {
    content: ' تومان';
    margin-right: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b6b6b;
}

.basalam-product-stock {
    font-size: 11px;
    color: #6b6b6b;
    margin-bottom: 6px;
}

.basalam-product-actions {
    margin-top: auto;
    padding-top: 6px;
}

.basalam-btn-buy {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: #ff6b35;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.basalam-btn-buy:hover:not(:disabled) {
    background: #ff5722;
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.35);
}

.basalam-btn-buy:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.basalam-btn-disabled {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: #e8e8e8;
    color: #999;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

@media (max-width: 768px) {
    .basalam-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .basalam-product-title {
        font-size: 12px;
        min-height: 34px;
    }

    .basalam-product-price {
        font-size: 14px;
    }

    .basalam-product-info {
        padding: 8px 10px 10px;
    }

    .basalam-btn-buy {
        padding: 7px 10px;
        font-size: 11px;
    }

    .basalam-search-form {
        border-radius: 30px;
    }

    .basalam-search-input {
        padding: 10px 16px;
        font-size: 13px;
    }

    .basalam-search-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .basalam-shop-header h1 {
        font-size: 20px;
    }

    .basalam-container {
        padding: 0 12px;
    }
}

.basalam-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
}

.basalam-page-link {
    display: inline-block;
    padding: 10px 16px;
    background: #fff;
    color: #212121;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.basalam-page-link:hover {
    background: #f5f5f5;
    border-color: #4caf50;
    color: #4caf50;
}

.basalam-page-link.active {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
    cursor: default;
}

.basalam-skeleton {
    pointer-events: none;
}

.skeleton-box,
.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-box {
    width: 100%;
    padding-top: 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.basalam-loading {
    text-align: center;
    padding: 32px 20px;
}

.basalam-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.basalam-loading p {
    color: #6b6b6b;
    font-size: 14px;
    margin: 0;
}

.basalam-end-message {
    text-align: center;
    padding: 32px 20px;
    color: #6b6b6b;
    font-size: 14px;
}

.basalam-end-message p {
    margin: 0;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    border: 2px dashed #ebebeb;
}

.basalam-search-box {
    margin: 20px 0 16px;
}

.basalam-search-form {
    display: flex;
    gap: 0;
    max-width: 650px;
    margin: 0 auto;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #ebebeb;
    transition: all 0.2s ease;
}

.basalam-search-form:focus-within {
    border-color: #ff6b35;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.15);
}

.basalam-search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 14px;
    background: transparent;
    color: #1a1a1a;
}

.basalam-search-input:focus {
    outline: none;
}

.basalam-search-input::placeholder {
    color: #999;
}

.basalam-search-btn {
    padding: 12px 28px;
    background: #ff6b35;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.basalam-search-btn:hover {
    background: #ff5722;
}

.basalam-search-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.basalam-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.basalam-toast {
    background: #fff;
    border-radius: 8px;
    padding: 14px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 500px;
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease;
    border-right: 4px solid;
}

.basalam-toast.toast-error {
    border-right-color: #f44336;
}

.basalam-toast.toast-success {
    border-right-color: #4caf50;
}

.basalam-toast.toast-info {
    border-right-color: #2196f3;
}

.basalam-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.basalam-toast-message {
    flex: 1;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
}

.basalam-toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.basalam-toast-close:hover {
    background: #f5f5f5;
    color: #666;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.basalam-toast.toast-hiding {
    animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.basalam-btn-buy.loading,
.basalam-search-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.basalam-btn-buy.loading::after,
.basalam-search-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.basalam-btn-buy.loading span,
.basalam-search-btn.loading span {
    opacity: 0;
}

@media (max-width: 768px) {
    .basalam-toast {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        padding: 12px 16px;
    }

    .basalam-toast-message {
        font-size: 13px;
    }
}