/**
 * Template Styles - Mimics the Magento Template Design
 * For category and product pages
 *
 * @package Sheeel_Theme
 */

/* ============================================
   BREADCRUMB STYLES
   ============================================ */
.sheeel-breadcrumbs {
    padding: 15px 0;
    margin: 0 0 20px 0;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.sheeel-breadcrumbs .breadcrumb-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.sheeel-breadcrumbs .breadcrumb-items li {
    display: flex;
    align-items: center;
}

.sheeel-breadcrumbs .breadcrumb-items li a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sheeel-breadcrumbs .breadcrumb-items li a:hover {
    color: var(--sheeel-primary, #4D3F76);
}

.sheeel-breadcrumbs .breadcrumb-separator {
    color: #999;
    margin: 0 5px;
}

.sheeel-breadcrumbs .breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* RTL Support */
.rtl .sheeel-breadcrumbs .breadcrumb-separator {
    transform: rotate(180deg);
}

/* ============================================
   CATEGORY PAGE STYLES
   ============================================ */
.category-page-wrapper {
    background: #fff;
    padding: 20px 0;
    min-height: 500px;
}

.category-page-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--sheeel-primary, #4D3F76);
}

.category-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.category-page-header .category-description {
    font-size: 15px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Subcategories Slider */
.category-subcategories {
    margin-bottom: 40px;
}

.category-subcategories .subcategories-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding: 0 10px;
}

.category-subcategories-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 5px;
}

.category-subcategories-slider::-webkit-scrollbar {
    display: none;
}

.subcategory-card {
    flex-shrink: 0;
    width: 140px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.subcategory-card:hover {
    transform: translateY(-5px);
}

.subcategory-card .subcategory-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8f8f8;
    border: 2px solid #eee;
    transition: border-color 0.3s ease;
}

.subcategory-card:hover .subcategory-image {
    border-color: var(--sheeel-primary, #4D3F76);
}

.subcategory-card .subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcategory-card .subcategory-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* ============================================
   PRODUCT GRID STYLES - TEMPLATE MATCH
   ============================================ */
.products-grid-wrapper {
    padding: 20px 0;
    margin-top: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 10px 0;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Card Structure - Template Match */
.product-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: var(--sheeel-primary, #4D3F76);
}

/* Top Row: Small Circular Icons */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    z-index: 15;
}

.express-badge {
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.discount-badge-top {
    background: #dc3545;
    color: white;
    /* Bigger circle so "Save xx%" doesn't get clipped */
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px; /* small vertical distance between word and value */
    padding: 4px;
    font-weight: 600;
    text-transform: none;
    text-align: center;
    line-height: 1.05;
}

.discount-badge-save,
.discount-badge-value {
    display: block;
    width: 100%;
    white-space: nowrap;
    line-height: 1;
}

.discount-badge-save {
    font-size: 10px;
    font-weight: 600;
}

.discount-badge-value {
    font-size: 12px;
    font-weight: 700;
}

/* Middle: Product Image - Larger */
.product-image-container {
    position: relative;
    display: block;
    padding: 20px;
    text-align: center;
    background: #fafafa;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.02);
}

.low-stock-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #ffc107;
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Below Image: Horizontal Badges Row */
.product-features {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.feature-badges-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.feature-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

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

.feature-badge.discount {
    background: #f8d7da;
    color: #721c24;
}

.feature-badge.express {
    background: #d1ecf1;
    color: #0c5460;
}

.feature-badge.sold {
    background: #fff3cd;
    color: #856404;
}

/* Product Title */
.product-title-section {
    padding: 12px 15px 8px;
}

.product-brand {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: var(--sheeel-primary, #4D3F76);
}

/* Descriptive Text */
.product-description {
    padding: 0 15px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    flex-grow: 1;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price at Bottom */
.product-price-section {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.special-price {
    font-size: 18px;
    color: var(--sheeel-primary, #4D3F76);
    font-weight: 700;
}

.price-currency {
    font-size: 12px;
    color: #666;
    margin-left: 2px;
}

.buy-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--sheeel-primary, #4D3F76);
    color: white;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.buy-button:hover {
    background: #b91c3c;
    transform: translateY(-1px);
}

.buy-button.out-of-stock {
    background: #6c757d;
    cursor: not-allowed;
}

.buy-button.out-of-stock:hover {
    background: #5a6268;
    transform: none;
}

/* Timer */
.product-card .deal-timer-mini {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.product-card .deal-timer-mini .timer-unit {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
}

/* ============================================
   PRODUCT DETAIL PAGE STYLES
   ============================================ */
.product-detail-wrapper {
    background: #fff;
    padding: 30px 0;
}

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
}

/* Product Gallery */
.product-gallery {
    position: relative;
}

.product-gallery .gallery-main-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
}

.product-gallery .gallery-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery .discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
}

.product-gallery .out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.product-gallery .out-of-stock-text {
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
}

/* Gallery Thumbnails */
.product-gallery .gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    scrollbar-width: none;
}

.product-gallery .gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.product-gallery .thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.product-gallery .thumbnail-item:hover,
.product-gallery .thumbnail-item.active {
    border-color: var(--sheeel-primary, #4D3F76);
}

.product-gallery .thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery navigation arrows (left / right) */
.product-gallery .gallery-nav {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--sheeel-primary, #4D3F76);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.product-gallery .gallery-nav:hover {
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
}
.product-gallery .gallery-nav.prev { left: 10px; }
.product-gallery .gallery-nav.next { right: 10px; }
[dir="rtl"] .product-gallery .gallery-nav.prev { left: auto; right: 10px; }
[dir="rtl"] .product-gallery .gallery-nav.next { right: auto; left: 10px; }

/* Product Info Main */
.product-info-main {
    display: flex;
    flex-direction: column;
}

.product-info-main .product-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.product-info-main .product-brand-link {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    display: block;
}

.product-info-main .product-brand-link:hover {
    color: var(--sheeel-primary, #4D3F76);
}

/* Product Meta Info */
.product-meta-info {
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.product-meta-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.product-meta-info .sku {
    direction: ltr;
    display: inline-block;
}

[dir="rtl"] .product-meta-info .sku {
    direction: rtl;
}

.product-meta-info .in-stock {
    color: #2ecc71;
}

.product-info-main > p.stock.in-stock,
.product-info-main p.stock.in-stock {
    color: #1a1a1a !important;
}

.product-meta-info .bought-count {
    color: #888;
}

/* Price Box */
.product-price-box {
    margin-bottom: 25px;
}

.product-price-box .price-container {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

[dir="rtl"] .product-price-box .price-container .special-price { order: 1; }
[dir="rtl"] .product-price-box .price-container .price-currency { order: 2; }
[dir="rtl"] .product-price-box .price-container .old-price { order: 3; }

.product-price-box .old-price {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

.product-price-box .special-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--sheeel-primary, #4D3F76);
}

.product-price-box .price-currency {
    font-size: 16px;
    color: #666;
}

/* Deal Timer */
.product-deal-timer {
    margin-bottom: 25px;
}

.product-deal-timer .timer-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.product-deal-timer .timer-display {
    display: flex;
    gap: 10px;
}

.product-deal-timer .timer-unit {
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    min-width: 50px;
}

.product-deal-timer .timer-unit .number {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.product-deal-timer .timer-unit .label {
    font-size: 11px;
    opacity: 0.9;
}

/* Quantity Selector */
.product-quantity {
    margin-bottom: 20px;
}

.product-quantity .qty-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.product-quantity .qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
}

.product-quantity .qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
}

.product-quantity .qty-btn:hover {
    background: #eee;
}

.product-quantity .qty-input {
    width: 60px;
    height: 40px;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 16px;
}

/* Add to Cart Button */
.product-add-to-cart {
    margin-bottom: 20px;
}

.product-add-to-cart .add-to-cart-btn {
    width: 100%;
    padding: 15px 30px;
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.product-add-to-cart .add-to-cart-btn:hover {
    background: #3a2f59;
}

.product-add-to-cart .add-to-cart-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Social Share */
.product-social-share {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.product-social-share .share-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.product-social-share .social-icons {
    display: flex;
    gap: 10px;
}

.product-social-share .social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.product-social-share .social-icon:hover {
    background: var(--sheeel-primary, #4D3F76);
    transform: translateY(-3px);
}

.product-social-share .social-icon:hover img {
    filter: brightness(0) invert(1);
}

/* ============================================
   PRODUCT DESCRIPTION TABS
   ============================================ */
.product-details-tabs {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.product-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.product-tabs-nav .tab-item {
    padding: 12px 25px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.product-tabs-nav .tab-item:hover,
.product-tabs-nav .tab-item.active {
    color: var(--sheeel-primary, #4D3F76);
    border-bottom-color: var(--sheeel-primary, #4D3F76);
}

.product-tabs-content .tab-panel {
    display: none;
}

.product-tabs-content .tab-panel.active {
    display: block;
}

.product-tabs-content .description-content,
.product-tabs-content .specifications-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

.product-tabs-content .description-content p,
.product-tabs-content .specifications-content p {
    margin-bottom: 15px;
}

.product-tabs-content ul,
.product-tabs-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.rtl .product-tabs-content ul,
.rtl .product-tabs-content ol {
    padding-left: 0;
    padding-right: 25px;
}

/* ============================================
   RELATED PRODUCTS
   ============================================ */
.related-products-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.related-products-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.related-products-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 10px 0;
}

.related-products-slider::-webkit-scrollbar {
    display: none;
}

.related-product-item {
    flex-shrink: 0;
    width: 200px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.related-product-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.related-product-item .item-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f8f8f8;
}

.related-product-item .item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.related-product-item .item-info {
    padding: 15px;
}

.related-product-item .item-name {
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.related-product-item .item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--sheeel-primary, #4D3F76);
}

/* ============================================
   PAGINATION
   ============================================ */
.sheeel-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    gap: 5px;
}

.sheeel-pagination .page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sheeel-pagination .page-item:hover {
    border-color: var(--sheeel-primary, #4D3F76);
    color: var(--sheeel-primary, #4D3F76);
}

.sheeel-pagination .page-item.current {
    background: var(--sheeel-primary, #4D3F76);
    border-color: var(--sheeel-primary, #4D3F76);
    color: #fff;
}

.sheeel-pagination .page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   NO PRODUCTS FOUND
   ============================================ */
.no-products-found {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-products-found h2 {
    font-size: 24px;
    color: #666;
    margin-bottom: 15px;
}

.no-products-found p {
    font-size: 15px;
    color: #888;
    margin-bottom: 25px;
}

.no-products-found .back-home-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--sheeel-primary, #4D3F76);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.no-products-found .back-home-btn:hover {
    background: #3a2f59;
    color: #fff;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .category-page-header h1 {
        font-size: 22px;
    }
    
    .product-detail-container {
        gap: 20px;
    }
    
    .product-info-main .product-page-title {
        font-size: 20px;
    }
    
    .product-price-box .special-price {
        font-size: 26px;
    }
    
    .product-deal-timer .timer-unit {
        padding: 8px 12px;
        min-width: 45px;
    }
    
    .product-deal-timer .timer-unit .number {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .category-page-header {
        padding: 20px 10px;
    }
    
    .product-tabs-nav {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .product-tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    .product-tabs-nav .tab-item {
        padding: 10px 15px;
        font-size: 13px;
        white-space: nowrap;
    }
}
