/* ==========================================================================
   Craft Egypt — Contemporary Store & Search Catalogue
   ========================================================================== */

.store-toolbar-wrap {
    max-width: 1380px;
    margin: 22px auto 0;
    padding: 0 clamp(16px, 4vw, 48px);
    position: relative;
    z-index: 200;
}

.store-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-wrap: wrap;
}

.store-pill-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.store-pill-rail::-webkit-scrollbar {
    display: none;
}

.craft-quick-pill {
    flex-shrink: 0;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: rgba(245, 241, 232, .65);
    color: var(--clay);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, transform .2s ease;
}

.craft-quick-pill:hover {
    background: var(--sand);
    color: var(--charcoal);
}

.craft-quick-pill.active {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: var(--ivory);
}

.store-toolbar__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.store-sort-select {
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--charcoal);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.filter-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--sand);
    color: var(--charcoal);
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color .22s ease, color .22s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--ivory);
}

.arrow-icon {
    font-size: 10px;
    transition: transform .25s ease;
}

.filter-btn.active .arrow-icon {
    transform: rotate(180deg);
}

/* Slide-over Craft Drawer */
.dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    inset-inline-end: -340px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: min(310px, calc(100vw - 24px));
    background: rgba(245, 241, 232, .96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    padding: 20px;
    margin: 0;
    z-index: 10500;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: inset-inline-end .4s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
}

.dropdown-menu.show {
    inset-inline-end: 16px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-close {
    position: sticky;
    top: 0;
    z-index: 1;
    flex: 0 0 38px;
    align-self: flex-start;
    margin-bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--charcoal);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.dropdown-close:hover {
    background: var(--terracotta);
    color: #fff;
}

.dropdown-item {
    flex: 0 0 auto;
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--charcoal);
    font-size: 14px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: var(--charcoal);
    color: var(--ivory);
}

/* Store Hero Inline Search Bar */
.store-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.store-inline-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 16px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-sm);
    width: min(400px, 100%);
}

.store-inline-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--charcoal);
    padding: 6px 8px;
}

.store-inline-search button {
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    border: 0;
    background: var(--charcoal);
    color: var(--ivory);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.store-inline-search button:hover {
    background: var(--terracotta);
}

.store-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* Product Grid & Collector Cards */
.store-container {
    max-width: 1380px;
    margin: 26px auto 64px;
    padding: 0 clamp(16px, 4vw, 48px);
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(282px, 1fr));
    gap: 22px;
}

.product-card {
    background: var(--glass-bg-strong);
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 28px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: blur(20px);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease, border-color .35s ease;
    min-width: 0;
}

.product-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-md);
    border-color: rgba(184, 154, 98, .55);
}

.product-media-box {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--sand);
}

.product-image-link {
    display: block;
    overflow: hidden;
}

.product-card img.product-img {
    display: block;
    width: 100%;
    height: 296px;
    object-fit: cover;
    transition: transform .75s cubic-bezier(.22, 1, .36, 1);
    background: var(--sand);
}

.product-card:hover img.product-img {
    transform: scale(1.05);
}

.product-labels {
    position: absolute;
    top: 12px;
    inset-inline: 12px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.product-craft-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: rgba(245, 241, 232, .88);
    backdrop-filter: blur(8px);
    color: var(--clay);
    font-size: 11px;
    font-weight: 700;
}

.product-open-orb {
    position: absolute;
    bottom: 12px;
    inset-inline-end: 12px;
    z-index: 4;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--charcoal);
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: background-color .22s ease, color .22s ease, transform .22s ease;
}

.product-card:hover .product-open-orb {
    background: var(--charcoal);
    color: var(--ivory);
    transform: scale(1.06);
}

.badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    color: var(--ivory);
}

.badge-discount {
    background: var(--terracotta);
}

.badge-out {
    background: var(--clay);
}

.product-card.out-of-stock {
    opacity: .68;
}

.product-card .card-content {
    padding: 16px 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 18.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--charcoal);
    margin: 0;
    overflow-wrap: anywhere;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-card:hover .product-title a {
    color: var(--terracotta);
}

.product-card__footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-price {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 17px;
    color: var(--charcoal);
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.price-old {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: line-through;
}

.price-new {
    color: var(--terracotta);
}

.buy-btn {
    width: 100%;
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    border: 0;
    background: var(--charcoal);
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .24s ease, transform .2s ease;
}

.buy-btn:hover:not(:disabled) {
    background: var(--terracotta);
    transform: translateY(-2px);
}

.buy-btn:disabled {
    background: var(--sand);
    color: var(--muted);
    cursor: not-allowed;
}

.highlight-pulse {
    animation: studioPulse 1.8s ease 2;
}

@keyframes studioPulse {
    0%, 100% { box-shadow: var(--glass-shadow); }
    50% { box-shadow: 0 0 0 8px rgba(168, 93, 58, .22), var(--shadow-lg); border-color: var(--terracotta); }
}

/* Legacy in-page cart drawer fallback */
.cart-container {
    max-width: 920px;
    margin: 36px auto 80px;
    padding: 0 20px;
}

.cart-back-link {
    display: inline-flex;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--sand);
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 16px;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-item-img {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.cart-summary,
.checkout-box {
    margin-top: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 24px;
}

@media (max-width: 640px) {
    .products-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-card {
        padding: 8px;
        border-radius: 22px;
    }

    .product-media-box {
        border-radius: 16px;
    }

    .product-card img.product-img {
        height: clamp(160px, 46vw, 220px);
    }

    .product-title {
        font-size: 15px;
    }

    .product-price {
        font-size: 14.5px;
    }

    .buy-btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .product-open-orb {
        display: none;
    }
}
