/**
 * استایل‌های فرانت‌اند - ریسپانسیو و زیبا
 */

.pam-accessories-section {
    margin: 40px 0;
    clear: both;
    padding: 0 15px;
}

.pam-accessories-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    text-align: center;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pam-accessories-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 2px;
}

/* Grid ریسپانسیو با پشتیبانی کامل از مود موبایل */
.pam-accessories-section .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* اطمینان از نمایش در مود موبایل */
@media screen and (max-width: 768px) {
    .pam-accessories-section .products {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 20px !important;
        padding: 0 10px !important;
    }
}

@media screen and (max-width: 480px) {
    .pam-accessories-section .products {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 0 5px !important;
    }
}

/* پشتیبانی از دستگاه‌های touch */
@media (hover: none) and (pointer: coarse) {
    .pam-accessories-section .products {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 15px !important;
    }
}

/* استایل کارت محصول */
.pam-accessories-section .product {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pam-accessories-section .product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.pam-accessories-section .product:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.pam-accessories-section .product:hover::before {
    transform: scaleX(1);
}

/* لینک محصول */
.pam-accessories-section .woocommerce-LoopProduct-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* تصویر محصول */
.pam-accessories-section .woocommerce-LoopProduct-link img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.pam-accessories-section .product:hover .woocommerce-LoopProduct-link img {
    transform: scale(1.05);
}

/* عنوان محصول */
.pam-accessories-section .woocommerce-loop-product__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.4;
    color: #2c3e50;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* قیمت */
.pam-accessories-section .price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    margin: 15px 0 20px 0;
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pam-accessories-section .price del {
    color: #95a5a6;
    font-size: 16px;
    margin-right: 8px;
    font-weight: 400;
}

/* دکمه افزودن به سبد خرید */
.pam-accessories-section .add_to_cart_button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.pam-accessories-section .add_to_cart_button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.pam-accessories-section .add_to_cart_button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.pam-accessories-section .add_to_cart_button:hover::before {
    left: 100%;
}

.pam-accessories-section .add_to_cart_button:active {
    transform: translateY(0);
}

.pam-accessories-section .add_to_cart_button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .pam-accessories-section {
        margin: 30px 0 !important;
        padding: 0 10px !important;
    }
    
    .pam-accessories-title {
        font-size: 24px !important;
        margin-bottom: 25px !important;
    }
    
    .pam-accessories-section .products {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 20px !important;
    }
    
    .pam-accessories-section .product {
        padding: 15px !important;
    }
    
    .pam-accessories-section .woocommerce-LoopProduct-link img {
        height: 180px !important;
    }
    
    .pam-accessories-section .woocommerce-loop-product__title {
        font-size: 16px !important;
        min-height: 40px !important;
    }
    
    .pam-accessories-section .price {
        font-size: 18px !important;
    }
    
    .pam-accessories-section .add_to_cart_button {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .pam-accessories-section {
        margin: 20px 0 !important;
        padding: 0 5px !important;
    }
    
    .pam-accessories-section .products {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .pam-accessories-section .product {
        padding: 12px !important;
    }
    
    .pam-accessories-section .woocommerce-LoopProduct-link img {
        height: 160px !important;
    }
    
    .pam-accessories-title {
        font-size: 22px !important;
        margin-bottom: 20px !important;
    }
    
    .pam-accessories-section .woocommerce-loop-product__title {
        font-size: 14px !important;
        min-height: 35px !important;
    }
    
    .pam-accessories-section .price {
        font-size: 16px !important;
    }
    
    .pam-accessories-section .add_to_cart_button {
        padding: 8px 16px !important;
        font-size: 12px !important;
    }
}

/* انیمیشن بارگذاری */
.pam-accessories-section .product {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.pam-accessories-section .product:nth-child(1) { animation-delay: 0.1s; }
.pam-accessories-section .product:nth-child(2) { animation-delay: 0.2s; }
.pam-accessories-section .product:nth-child(3) { animation-delay: 0.3s; }
.pam-accessories-section .product:nth-child(4) { animation-delay: 0.4s; }
.pam-accessories-section .product:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* استایل برای تم‌های مختلف */
.rtl .pam-accessories-section .price del {
    margin-right: 0;
    margin-left: 8px;
}

/* نوتیفیکیشن پیشنهاد مکمل هوشمند */
.pam-smart-recommendation {
    position: fixed;
    bottom: 20px;
    right: -400px;
    width: 350px;
    z-index: 999999999;
    transition: right 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pam-smart-recommendation.show {
    right: 20px;
}

.pam-recommendation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.pam-recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.pam-recommendation-image {
    margin-right: 15px;
    flex-shrink: 0;
}

.pam-recommendation-image img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pam-recommendation-content {
    flex: 1;
    color: white;
}

.pam-recommendation-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pam-recommendation-name {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.3;
}

.pam-recommendation-price {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.pam-recommendation-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

.pam-recommendation-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pam-recommendation-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.pam-recommendation-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* ریسپانسیو برای موبایل با پشتیبانی کامل */
@media screen and (max-width: 768px) {
    .pam-smart-recommendation {
        width: 320px !important;
        right: -320px !important;
        max-width: 320px !important;
    }
    
    .pam-smart-recommendation.show {
        right: 10px !important;
    }
    
    .pam-recommendation-card {
        padding: 15px !important;
    }
    
    .pam-recommendation-image img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .pam-recommendation-title {
        font-size: 14px !important;
    }
    
    .pam-recommendation-name {
        font-size: 13px !important;
    }
    
    .pam-recommendation-price {
        font-size: 14px !important;
    }
    
    .pam-recommendation-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

@media screen and (max-width: 480px) {
    .pam-smart-recommendation {
        width: calc(100vw - 20px) !important;
        right: -100vw !important;
        bottom: 10px !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    .pam-smart-recommendation.show {
        right: 10px !important;
    }
    
    .pam-recommendation-card {
        padding: 12px !important;
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .pam-recommendation-image {
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    
    .pam-recommendation-image img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .pam-recommendation-content {
        width: 100% !important;
    }
    
    .pam-recommendation-title {
        font-size: 12px !important;
        margin-bottom: 5px !important;
    }
    
    .pam-recommendation-name {
        font-size: 11px !important;
        margin-bottom: 5px !important;
    }
    
    .pam-recommendation-price {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    
    .pam-recommendation-btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
}

/* پشتیبانی از دستگاه‌های touch */
@media (hover: none) and (pointer: coarse) {
    .pam-smart-recommendation {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    .pam-recommendation-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 15px !important;
    }
    
    .pam-recommendation-image {
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
}

/* انیمیشن‌های اضافی */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.pam-smart-recommendation.show .pam-recommendation-card {
    animation: slideInRight 0.6s ease-out;
}

.pam-smart-recommendation:not(.show) .pam-recommendation-card {
    animation: slideOutRight 0.3s ease-in;
}

/* بهبود برای تم‌های تاریک */
@media (prefers-color-scheme: dark) {
    .pam-recommendation-card {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

.pam-add-all-accessories {
    text-align: center;
    margin: 20px 0;
}

.pam-add-all-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.pam-add-all-btn:hover {
    background: #1e7e34;
}

.pam-add-all-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pam-accessories-loop {
    margin: 10px 0;
    text-align: center;
}

.pam-accessories-count {
    background: #0073aa;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
    .pam-accessories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .pam-accessory-item {
        padding: 10px;
    }
    
    .pam-accessory-image img {
        height: 120px;
    }
    
    .pam-accessory-name {
        font-size: 14px;
    }
    
    .pam-accessory-price {
        font-size: 16px;
    }
    
    .pam-add-to-cart {
        padding: 8px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pam-accessories-grid {
        grid-template-columns: 1fr;
    }
    
    .pam-accessories-sidebar,
    .pam-accessories-full {
        padding: 15px;
    }
    
    .pam-accessories-title {
        font-size: 20px;
    }
}

/* استایل‌های loading */
.pam-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.pam-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: pam-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes pam-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* استایل‌های notification */
.pam-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    animation: pam-slide-in 0.3s ease;
}

.pam-notification.success {
    border-left: 4px solid #28a745;
}

.pam-notification.error {
    border-left: 4px solid #dc3545;
}

.pam-notification.warning {
    border-left: 4px solid #ffc107;
}

.pam-notification.info {
    border-left: 4px solid #17a2b8;
}

@keyframes pam-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* استایل‌های badge */
.pam-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    color: white;
}

.pam-badge.primary {
    background: #0073aa;
}

.pam-badge.success {
    background: #28a745;
}

.pam-badge.warning {
    background: #ffc107;
    color: #333;
}

.pam-badge.danger {
    background: #dc3545;
}

/* استایل‌های tooltip */
.pam-tooltip {
    position: relative;
    cursor: help;
}

.pam-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 1000;
    margin-bottom: 5px;
}

.pam-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 1000;
}

.pam-tooltip:hover::after,
.pam-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* استایل‌های animation */
.pam-fade-in {
    animation: pam-fade-in 0.5s ease;
}

@keyframes pam-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pam-slide-up {
    animation: pam-slide-up 0.3s ease;
}

@keyframes pam-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* استایل‌های RTL */
.rtl .pam-accessories-title {
    text-align: center;
}

.rtl .pam-accessory-name {
    text-align: center;
}

.rtl .pam-accessory-price del {
    margin-left: 5px;
    margin-right: 0;
}

.rtl .pam-notification {
    right: auto;
    left: 20px;
}

.rtl .pam-tooltip::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

.rtl .pam-tooltip::before {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}
