/* ============================================================
   Shop — Product Listing Page (shop/index)
   Depends on: main.css (--primary-color #0c9dbf, --secondary-color,
   --primary-shadow, --transition, --text-dark, --bg-*, --border-color)
   ============================================================ */

/* ── Page Wrapper ────────────────────────────────────────── */
.shop-page-wrapper {
    background-color: var(--bg-light);
    min-height: 100vh;
    padding-bottom: 5rem;
}

/* ── Header Section ──────────────────────────────────────── */
.shop-header {
    background: rgba(12, 157, 191, 0.04);
    padding: 0.9rem 0 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.shop-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(12, 157, 191, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}
.shop-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}
.shop-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 20px;
    z-index: 900;
    backdrop-filter: blur(10px);
}
.form-select-modern,
.form-control-modern {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    background-color: var(--bg-light);
    color: var(--text-dark);
}
.form-select-modern:focus,
.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(12, 157, 191, 0.12);
    background-color: var(--bg-card);
    outline: none;
}
.btn-filter-apply {
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 700;
    border: none;
    transition: var(--transition);
    box-shadow: var(--primary-shadow);
}
.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: var(--primary-shadow-lg);
    color: white;
    background: var(--primary-hover);
}
.btn-filter-clear {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    width: 48px;
    transition: var(--transition);
}
.btn-filter-clear:hover {
    border-color: #dee2e6;
    color: #dc3545;
    background: var(--bg-card);
}

/* ── Product Grid ────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* ── Product Card ────────────────────────────────────────── */
.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(12, 157, 191, 0.25);
}

/* ── Card Thumbnail ──────────────────────────────────────── */
.card-thumb {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.card-thumb-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.product-card:hover .card-thumb img { transform: scale(1.05); }

/* ── Placeholder (no cover image) ───────────────────────── */
.placeholder-wrapper {
    width: 100%;
    height: 100%;
    background: rgba(12, 157, 191, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}
.placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.25;
}
.placeholder-text {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.4;
}
.product-card:hover .placeholder-wrapper { background: rgba(12, 157, 191, 0.12); }
.product-card:hover .placeholder-icon { transform: scale(1.1) rotate(-5deg); opacity: 0.4; }

/* ── Card Content ────────────────────────────────────────── */
.card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Capsules ────────────────────────────────────────────── */
.card-capsules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.capsule-item {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.capsule-course {
    background: rgba(12, 157, 191, 0.1);
    color: var(--primary-color);
}
.capsule-pdf {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}
.capsule-physical {
    background: rgba(52, 168, 83, 0.1);
    color: #1e7e34;
}

/* ── Title & Price ───────────────────────────────────────── */
.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.product-title:hover { color: var(--primary-color); }

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    display: block;
    letter-spacing: -0.5px;
}

.product-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* ── Card Actions ────────────────────────────────────────── */
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: auto;
}
.btn-action {
    padding: 0.6rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    width: 100%;
}
.btn-action i { font-size: 0.9rem; }

.btn-outline-primary-soft {
    background: rgba(12, 157, 191, 0.06);
    color: var(--primary-color);
    border: 1px solid rgba(12, 157, 191, 0.15);
}
.btn-outline-primary-soft:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.btn-primary-soft {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--primary-shadow);
    grid-column: span 2;
}
.btn-primary-soft:hover {
    transform: translateY(-2px);
    box-shadow: var(--primary-shadow-lg);
    color: white;
    background: var(--primary-hover);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .shop-header { padding: 0.75rem 0 0.6rem; margin-bottom: 1rem; }
    .shop-title { font-size: 1.3rem; margin-bottom: 0; }
    .shop-subtitle { display: none; }
    .filter-bar { padding: 1rem; margin-bottom: 2rem; position: relative; top: 0; z-index: 1; }
    .product-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ── Dark Mode ───────────────────────────────────────────── */
[data-theme='dark'] .shop-page-wrapper        { background-color: var(--bg-body); }
[data-theme='dark'] .shop-header              { background: rgba(12, 157, 191, 0.05); border-bottom-color: var(--border-color); }
[data-theme='dark'] .shop-title               { color: var(--primary-color); }
[data-theme='dark'] .shop-subtitle            { color: var(--text-muted); }
[data-theme='dark'] .filter-bar               { background: var(--bg-card); border-color: var(--border-color); }
[data-theme='dark'] .form-select-modern,
[data-theme='dark'] .form-control-modern      { background-color: var(--bg-body); border-color: var(--border-color); color: var(--text-main); }
[data-theme='dark'] .form-select-modern:focus,
[data-theme='dark'] .form-control-modern:focus { background-color: var(--bg-card); border-color: var(--primary-color); }
[data-theme='dark'] .btn-filter-clear         { background: var(--bg-body); border-color: var(--border-color); }
[data-theme='dark'] .btn-filter-clear:hover   { background: var(--bg-card); }
[data-theme='dark'] .product-card             { background: var(--bg-card); border-color: var(--border-color); }
[data-theme='dark'] .card-thumb               { background-color: var(--bg-body); border-bottom-color: var(--border-color); }
[data-theme='dark'] .placeholder-wrapper      { background: rgba(12, 157, 191, 0.07); }
[data-theme='dark'] .product-card:hover .placeholder-wrapper { background: rgba(12, 157, 191, 0.12); }
[data-theme='dark'] .product-title            { color: var(--text-dark); }
[data-theme='dark'] .product-desc             { color: var(--text-muted); }
[data-theme='dark'] .btn-outline-primary-soft { background: var(--bg-body); border-color: var(--border-color); color: var(--primary-color); }
[data-theme='dark'] .btn-outline-primary-soft:hover { background: var(--primary-color); color: white; }
[data-theme='dark'] .text-dark                { color: var(--text-dark) !important; }
[data-theme='dark'] .bg-light-gray            { background-color: var(--bg-card) !important; }

/* ── Mobile filter-bar tweaks (moved here from inline <style> in shop/index.blade.php) ── */
@media (max-width: 767px) {
    .filter-bar { padding: .75rem .875rem; margin-bottom: 1.5rem; position: relative; top: auto; border-radius: 14px; }
    .filter-label { display: none; }
    .form-select-modern, .form-control-modern { padding: .5rem .75rem; font-size: .875rem; border-radius: 10px; }
    .btn-filter-apply { padding: .5rem 1rem; font-size: .875rem; border-radius: 10px; }
    .btn-filter-clear { width: 40px; height: 40px; border-radius: 10px; }
    .filter-row { row-gap: .5rem !important; }
}
