/* ========== SHOP INDEX ========== */

.shop-container { padding: 1.5rem 0 2rem; width: 90%; max-width: 90%; margin: 0 auto; }

/* ========== SEARCH BAR ========== */
.shop-search-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.shop-search-bar .input-group-text {
    background: transparent;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: var(--text-dim);
}
[dir="rtl"] .shop-search-bar .input-group-text { border-radius: 0 10px 10px 0; border-right: 1px solid var(--border); border-left: none; }
.shop-search-bar .form-control {
    background: var(--hover-overlay);
    border: 1px solid var(--border);
    border-left: none;
    color: var(--text);
    font-size: 0.93rem;
    padding: 0.55rem 0.85rem;
}
[dir="rtl"] .shop-search-bar .form-control { border-left: 1px solid var(--border); border-right: none; }
.shop-search-bar .form-control::placeholder { color: var(--text-dim); }
.shop-search-bar .form-control:focus { box-shadow: none; border-color: var(--border); background: var(--focus-overlay); }
.shop-search-bar .btn-primary { background: var(--accent); border-color: var(--accent); border-radius: 0 10px 10px 0; font-weight: 500; }
[dir="rtl"] .shop-search-bar .btn-primary { border-radius: 10px 0 0 10px; }
.shop-search-bar .btn-primary:hover { background: var(--accent-dark); }
.shop-search-bar .btn-outline-secondary { color: var(--text-dim); border-color: var(--border); }
.shop-search-bar .btn-outline-secondary:hover { background: var(--hover-overlay); color: var(--text); }

/* ========== CATEGORIES + CAROUSEL ROW ========== */
.cat-carousel-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    max-height: 280px;
}

.cat-grid-section {
    flex: 0 0 38%;
    max-width: 38%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-dim) transparent;
}

.featured-carousel-section {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}

.cat-circles-title { font-weight: 700; color: var(--text); font-size: 0.9rem; margin-bottom: 0.7rem; }

/* Categories Grid - 5 per row */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem 0.4rem;
}

.cat-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
}
.cat-circle-item:hover { transform: translateY(-3px); }

.cat-circle-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--hover-overlay);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-bottom: 0.3rem;
}
.cat-circle-icon i { font-size: 1.05rem; color: var(--text-muted); transition: color 0.2s; }

.cat-circle-item:hover .cat-circle-icon,
.cat-circle-item.active .cat-circle-icon { background: var(--accent); border-color: var(--accent); }
.cat-circle-item:hover .cat-circle-icon i,
.cat-circle-item.active .cat-circle-icon i { color: #fff; }

.cat-circle-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-circle-item.active .cat-circle-label { color: var(--accent); font-weight: 600; }

/* ========== FEATURED CAROUSEL ========== */
#featuredCarousel {
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}
#featuredCarousel .carousel-inner { height: 100%; }
#featuredCarousel .carousel-item { height: 100%; }
#featuredCarousel .carousel-item img {
    height: calc(100% - 8px);
    width: calc(100% - 8px);
    margin: 4px;
    object-fit: cover;
    border-radius: 10px;
}
#featuredCarousel .carousel-indicators { margin-bottom: 0.5rem; }
#featuredCarousel .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--text-dim);
    opacity: 0.5;
}
#featuredCarousel .carousel-indicators button.active {
    background: var(--accent);
}
#featuredCarousel .carousel-control-prev,
#featuredCarousel .carousel-control-next {
    width: 32px;
    height: 32px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}
#featuredCarousel:hover .carousel-control-prev,
#featuredCarousel:hover .carousel-control-next { opacity: 1; }
#featuredCarousel .carousel-control-prev { left: 8px; }
#featuredCarousel .carousel-control-next { right: 8px; }
#featuredCarousel .carousel-control-prev-icon,
#featuredCarousel .carousel-control-next-icon { width: 14px; height: 14px; }

/* ========== SUBCATEGORY PILLS ========== */
.subcategory-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.subcat-pill {
    display: inline-block;
    padding: 0.38rem 0.95rem;
    border-radius: 50px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--hover-overlay);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s;
}
.subcat-pill:hover { border-color: var(--accent); color: var(--accent); }
.subcat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ========== SEARCH RESULTS INFO ========== */
.search-results-info {
    border-radius: 10px;
    border: 1px solid var(--accent-light);
    background: var(--accent-light);
    color: var(--text-muted);
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
}

/* ========== PRODUCT CARDS ========== */
.product-card-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.product-card-link:hover { color: inherit; }

.product-card {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--shadow);
    border-color: var(--accent);
}

.product-image-wrap {
    height: 210px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image { max-height: 100%; max-width: 100%; object-fit: contain; padding: 16px; }
.product-image-placeholder i { color: var(--text-dim); }

.product-body { padding: 0.85rem 1rem; display: flex; flex-direction: column; flex: 1; }

.product-cat-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--accent-light);
    color: var(--accent);
    margin-bottom: 0.4rem;
    align-self: flex-start;
}

.product-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
    line-height: 1.4;
    overflow-wrap: anywhere; /* full product name; the card grows with it */
}

.product-brand { font-size: 0.76rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.product-brand i { font-size: 0.7rem; }

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.product-price { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.product-view-btn {
    background: var(--accent);
    color: #fff;
    border-radius: 7px;
    padding: 0.32rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.2s;
}
.product-card:hover .product-view-btn { background: var(--accent-dark); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.empty-state i { font-size: 3.5rem; color: var(--text-dim); display: block; margin-bottom: 1rem; }
.empty-state h5 { font-weight: 600; color: var(--text-muted); }
.empty-state p { color: var(--text-dim); font-size: 0.88rem; margin: 0; }

/* ========== LOADING ========== */
#loadingSpinner { text-align: center; padding: 2rem; display: none; }
.spinner-border { width: 2.5rem; height: 2.5rem; border-width: 0.25rem; color: var(--accent); }

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .cat-carousel-row { flex-direction: column; max-height: none; }
    .cat-grid-section { flex: 1; max-width: 100%; overflow-y: visible; }
    .featured-carousel-section { max-width: 100%; }
    #featuredCarousel .carousel-item img { height: 220px; }
}
@media (max-width: 768px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
    .cat-circle-icon { width: 46px; height: 46px; }
    .cat-circle-icon i { font-size: 1rem; }
    .cat-circle-label { font-size: 0.68rem; max-width: 70px; }
    .product-image-wrap { height: 170px; }
    #featuredCarousel .carousel-item img { height: 180px; }
}
@media (max-width: 480px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
