/* ========================================================
   El Shaib - Shared UI Component System
   Reusable components composed with Bootstrap 5 RTL
   ======================================================== */

/* ========================================================
   1. Subnav / Breadcrumb Component
   ======================================================== */
.page-breadcrumb,
.cart-breadcrumb,
.pd-breadcrumb,
.products-subnav {
    background: var(--primary-darkest, #1B4332);
    padding: 0.75rem 0;
}

.page-breadcrumb .container,
.cart-breadcrumb .container,
.pd-breadcrumb .container,
.products-subnav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
}

.breadcrumb-list a,
.subnav-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm, 8px);
    transition: var(--transition, all 0.2s ease);
}

.breadcrumb-list a:hover,
.subnav-link:hover,
.subnav-link.active {
    color: var(--white, #fff);
    background: rgba(255, 255, 255, 0.15);
}

.breadcrumb-list .active span {
    color: var(--white, #fff);
    font-weight: 700;
}

.breadcrumb-sep {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
}

.subnav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.subnav-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
}

.subnav-badge i {
    color: var(--accent, #74C69D);
}

/* ========================================================
   2. Unified Product Card Component (.product-card / .pcard)
   ======================================================== */
.product-card,
.pcard {
    background: var(--white, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.04));
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover,
.pcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(27, 67, 50, 0.10);
    border-color: rgba(64, 145, 108, 0.35);
}

/* Shimmer Loading & Image Container */
.product-image-wrapper,
.pcard-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(90deg, #f1f5f9 25%, #e8edf2 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmerPlaceholder 1.5s ease-in-out infinite;
}

@keyframes shimmerPlaceholder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-image-wrapper img,
.pcard-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.product-card:hover .product-image-wrapper img,
.pcard:hover .pcard-image img {
    transform: scale(1.05);
}

.product-image-link,
.pcard-image-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Badges on Card Image */
.pcard-badges {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 2;
}

.product-badge-discount,
.pcard-badge,
.pd-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
}

.product-badge-discount,
.pcard-badge--discount,
.pd-badge--discount {
    background: #EF4444;
    color: #fff;
}

.pcard-badge--category {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark, #006C48);
}

.pcard-badge--featured,
.pd-badge--featured {
    background: #F59E0B;
    color: #fff;
}

/* Card Wishlist Button */
.product-wishlist,
.pcard-wishlist {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
    padding: 0;
}

.product-wishlist:hover,
.pcard-wishlist:hover {
    color: #E11D48;
    background: #fff;
    transform: scale(1.1);
}

.product-wishlist.active i,
.pcard-wishlist.active i {
    font-weight: 900;
    color: #E11D48;
}

/* Card Content / Body */
.product-info,
.pcard-body {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category,
.pcard-category {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary-dark, #006C48);
    background: var(--light-green, #E8F5E9);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    width: fit-content;
    margin-bottom: 0.45rem;
}

.product-name,
.pcard-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark, #012D1D);
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.product-name-link,
.pcard-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-name-link:hover .product-name,
.pcard-title a:hover {
    color: var(--primary, #40916C);
}

.product-description {
    font-size: 0.82rem;
    color: var(--text-muted, #6C757D);
    margin-bottom: 0.85rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Price Row */
.product-price-row,
.pcard-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: auto;
    margin-bottom: 0.85rem;
}

.product-price,
.pcard-price,
.price-val {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary-darkest, #1B4332);
}

.product-price-currency,
.price-curr {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary, #40916C);
}

.product-old-price,
.pcard-old-price {
    font-size: 0.82rem;
    color: #94A3B8;
    text-decoration: line-through;
}

/* Card Action Area */
.product-actions,
.pcard-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-cart,
.pcard-btn-add {
    flex: 1;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-darkest, #1B4332) 0%, var(--primary-dark, #006C48) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.22);
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 0 0.85rem;
    text-decoration: none;
}

.btn-add-cart:hover,
.pcard-btn-add:hover {
    background: linear-gradient(135deg, var(--primary-dark, #006C48) 0%, var(--primary, #40916C) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.32);
    color: #fff;
}

.btn-add-cart:active,
.pcard-btn-add:active {
    transform: scale(0.98);
}

.btn-details,
.pcard-details-btn {
    height: 40px;
    padding: 0 0.9rem;
    background: rgba(64, 145, 108, 0.08);
    color: var(--primary-dark, #006C48);
    border: 1.5px solid rgba(64, 145, 108, 0.25);
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-details:hover,
.pcard-details-btn:hover {
    background: var(--primary-dark, #006C48);
    color: #fff;
    border-color: var(--primary-dark, #006C48);
}

/* Secondary Actions Container */
.pcard-secondary-actions {
    margin-top: 0.45rem;
}

.pcard-secondary-actions .pcard-details-btn {
    width: 100%;
    height: 32px;
}

/* ========================================================
   3. Unified Quantity Control (.quantity-control, .pcard-qty, .ci-qty, .pd-qty)
   ======================================================== */
.quantity-control,
.pcard-qty,
.ci-qty,
.pd-qty {
    display: inline-flex;
    align-items: center;
    height: 40px;
    border: 1.5px solid #D8F3DC;
    border-radius: 10px;
    background: #F8FAFC;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quantity-control:focus-within,
.pcard-qty:focus-within,
.ci-qty:focus-within,
.pd-qty:focus-within {
    border-color: var(--primary, #40916C);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.qty-btn,
.ci-qty-btn,
.pd-qty-btn {
    width: 30px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--primary-darkest, #1B4332);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.qty-btn:hover,
.ci-qty-btn:hover,
.pd-qty-btn:hover {
    background-color: var(--light-green, #D8F3DC);
    color: var(--primary-dark, #006C48);
}

.qty-input,
.ci-qty-input,
.pd-qty-input {
    width: 36px;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary-darkest, #1B4332);
    outline: none;
    -moz-appearance: textfield;
    padding: 0;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button,
.ci-qty-input::-webkit-outer-spin-button,
.ci-qty-input::-webkit-inner-spin-button,
.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Disabled quantity variant */
.pd-qty--disabled {
    opacity: 0.6;
    background: #F1F5F9;
    border-color: #E2E8F0;
}

.qty-btn:disabled,
.pd-qty-btn:disabled {
    cursor: not-allowed;
    color: #94A3B8;
}

.qty-btn:disabled:hover,
.pd-qty-btn:disabled:hover {
    background: transparent;
}

.qty-input:disabled,
.pd-qty-input:disabled {
    cursor: not-allowed;
    color: #94A3B8;
}

/* ========================================================
   4. Unified Empty State Component
   ======================================================== */
.empty-state,
.products-empty,
.cart-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--white, #fff);
    border-radius: var(--radius-xl, 20px);
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    max-width: 620px;
    margin: 0 auto;
}

.empty-state-icon,
.empty-icon,
.cart-empty-icon {
    width: 80px;
    height: 80px;
    background: var(--light-green, #D8F3DC);
    color: var(--primary-darkest, #1B4332);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 6px 20px rgba(27, 67, 50, 0.12);
}

.empty-state h3,
.products-empty h3,
.cart-empty h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark, #012D1D);
    margin-bottom: 0.5rem;
}

.empty-state p,
.products-empty p,
.cart-empty p {
    font-size: 0.92rem;
    color: var(--text-muted, #6C757D);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ========================================================
   5. Icon Avatars & Boxes (Reusable circle badges)
   ======================================================== */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--transition, all 0.2s ease);
}

.icon-circle-sm { width: 36px; height: 36px; font-size: 1rem; }
.icon-circle-md { width: 48px; height: 48px; font-size: 1.25rem; }
.icon-circle-lg { width: 64px; height: 64px; font-size: 1.75rem; }
.icon-circle-xl { width: 80px; height: 80px; font-size: 2.25rem; }

.icon-circle-primary { background: #E8F5E9; color: var(--primary-dark, #1B4332); }
.icon-circle-success { background: #ECFDF5; color: #10B981; }
.icon-circle-warning { background: #FEF3C7; color: #D97706; }
.icon-circle-danger  { background: #FEE2E2; color: #EF4444; }
.icon-circle-info    { background: #F0F9FF; color: #0284C7; }

.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 12px);
    flex-shrink: 0;
    transition: var(--transition, all 0.2s ease);
}

/* ========================================================
   6. Filter Tags & Tab Pills
   ======================================================== */
.filter-tag,
.tag-pill,
.tab-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.15rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-body, #495057);
    background: #fff;
    text-decoration: none;
    transition: var(--transition, all 0.2s ease);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.filter-tag:hover,
.tag-pill:hover,
.tab-link:hover {
    border-color: var(--primary, #40916C);
    color: var(--primary-dark, #006C48);
    background: var(--very-light-green, #F0FFF4);
    transform: translateY(-1px);
}

.filter-tag.active,
.tag-pill.active,
.tab-link.active {
    background: linear-gradient(135deg, var(--primary-darkest, #1B4332) 0%, var(--primary-dark, #006C48) 100%);
    border-color: var(--primary-dark, #006C48);
    color: #fff;
    box-shadow: 0 3px 8px rgba(27, 67, 50, 0.25);
}

.filter-tag-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--light-green, #D8F3DC);
    color: var(--primary-dark, #006C48);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
}

/* ========================================================
   7. Reusable Micro-Utilities & Section Headers
   ======================================================== */
.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.08)) !important;
}

.section-title {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--primary-darkest, #1B4332);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted, #6C757D);
    font-size: 0.95rem;
    max-width: 540px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

@media (max-width: 767.98px) {
    .section-title { font-size: 1.65rem; }
    .section-subtitle { font-size: 0.88rem; }
    .btn-add-cart,
    .pcard-btn-add {
        height: 44px;
        font-size: 0.9rem;
    }
    .btn-details,
    .pcard-details-btn {
        height: 44px;
    }
}
