/**
 * WooCommerce Styles
 * Shop Archive + Single Product
 * 
 * @package PSY_Theme
 */

/* ==========================================================================
   SHOP PAGE (ARCHIVE)
   ========================================================================== */

.shop-page {
    padding: 2rem 0 4rem;
    background: var(--bg-light, #f8f9fa);
    min-height: 80vh;
}

.shop-header {
    margin-bottom: 2rem;
}

.shop-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark, #1a1a2e);
    margin: 0 0 0.5rem;
}

.shop-description {
    color: var(--text-muted, #6b7280);
    font-size: 1rem;
    max-width: 600px;
}

/* Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SIDEBAR FILTERS
   ========================================================================== */

.shop-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 100px;
}

@media (max-width: 1023px) {
    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 90vw;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        border-radius: 0;
        padding-top: 2rem;
    }
    
    .shop-sidebar.active {
        transform: translateX(0);
    }
}

/* Active Filters */
.active-filters {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.active-filters__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.clear-all {
    color: var(--primary, #1e40af);
    text-decoration: none;
    font-weight: 500;
}

.clear-all:hover {
    text-decoration: underline;
}

.active-filters__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary-light, #dbeafe);
    color: var(--primary, #1e40af);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.filter-tag__remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
}

.filter-tag__remove:hover {
    opacity: 1;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 1rem;
}

.filter-group__toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
}

.filter-group__icon {
    transition: transform 0.2s;
}

.filter-group__toggle[aria-expanded="true"] .filter-group__icon {
    transform: rotate(180deg);
}

.filter-group__content {
    padding: 0.75rem 0;
}

.filter-group__content[hidden] {
    display: none;
}

/* Checkboxes */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-checkbox__mark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.filter-checkbox input:checked + .filter-checkbox__mark {
    background: var(--primary, #1e40af);
    border-color: var(--primary, #1e40af);
}

.filter-checkbox input:checked + .filter-checkbox__mark::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.filter-checkbox__label {
    flex: 1;
}

.filter-checkbox__count {
    color: var(--text-muted, #9ca3af);
    font-size: 0.8125rem;
}

/* Filter Submit */
.filters-submit {
    width: 100%;
    margin-top: 1rem;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--primary, #1e40af);
    color: #fff;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 100px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 1023px) {
    .mobile-filter-btn {
        display: flex;
    }
}

/* Filter Overlay */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.filter-overlay.active {
    display: block;
}

/* ==========================================================================
   SHOP TOOLBAR
   ========================================================================== */

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.products-count {
    font-size: 0.9375rem;
    color: var(--text-muted);
    font-weight: 500;
}

.shop-toolbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border-radius: 8px;
}

.view-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.view-btn:hover {
    color: var(--text-dark);
}

.view-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Sorting */
.shop-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shop-sort__label {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.shop-sort__select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    cursor: pointer;
    appearance: none;
}

@media (max-width: 640px) {
    .shop-sort__label {
        display: none;
    }
}

/* ==========================================================================
   PRODUCTS GRID
   ========================================================================== */

.products {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
}

.products--grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.products--list {
    grid-template-columns: 1fr;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 12px;
}

.no-products__icon {
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.no-products h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.no-products p {
    color: var(--text-muted);
    margin: 0;
}

.no-products a {
    color: var(--primary);
}

/* ==========================================================================
   PRODUCT CARD
   ========================================================================== */

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* List view */
.products--list .product-card__link {
    flex-direction: row;
}

.products--list .product-card__header {
    width: 200px;
    flex-shrink: 0;
}

.products--list .product-card__body {
    flex: 1;
}

/* Card Header */
.product-card__header {
    position: relative;
    min-height: 120px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card__badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.cert-badge {
    background: rgba(255,215,0,0.3);
    color: #ffd700;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
}

.product-card__format {
    align-self: flex-end;
}

.format-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.format-badge--online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.format-badge--offline {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.format-badge--hybrid {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.product-card__thumb {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.3;
}

.product-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Body */
.product-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.product-card__date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--primary, #1e40af);
    font-weight: 600;
}

.product-card__date svg {
    flex-shrink: 0;
}

.product-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__speaker,
.product-card__cities {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.product-card__speaker svg,
.product-card__cities svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Card Footer */
.product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.product-card__price .price-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
}

.product-card__price .price-free {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #22c55e;
}

.product-card__btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    transition: gap 0.2s;
}

.product-card:hover .product-card__btn {
    gap: 0.625rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.woocommerce-pagination {
    margin-top: 2rem;
}

.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination li {
    margin: 0;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.15s;
}

.woocommerce-pagination a:hover {
    background: var(--primary-light, #dbeafe);
    color: var(--primary);
}

.woocommerce-pagination .current {
    background: var(--primary);
    color: #fff;
}

/* ==========================================================================
   SINGLE PRODUCT PAGE
   ========================================================================== */

.single-product-page {
    background: var(--bg-light, #f8f9fa);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #fff;
}

.breadcrumbs__sep {
    color: rgba(255,255,255,0.4);
}

.breadcrumbs__current {
    color: rgba(255,255,255,0.9);
}

/* Product Hero */
.product-hero {
    padding: 2rem 0 3rem;
    color: #fff;
}

.product-hero__content {
    max-width: 720px;
}

.product-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.badge--category {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.badge--cert {
    background: rgba(255,215,0,0.25);
    color: #ffd700;
}

.badge--online {
    background: rgba(34,197,94,0.25);
    color: #86efac;
}

.badge--offline {
    background: rgba(249,115,22,0.25);
    color: #fdba74;
}

.badge--hybrid {
    background: rgba(168,85,247,0.25);
    color: #d8b4fe;
}

.product-hero__date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.9);
}

.product-hero__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1rem;
}

.product-hero__speakers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.product-hero__recording {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.8);
}

/* Product Main */
.product-main {
    padding: 2rem 0 4rem;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
}

/* Product Content */
.product-content {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Tabs */
.product-tabs__nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.5rem;
    overflow-x: auto;
}

.product-tabs__btn {
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.product-tabs__btn:hover {
    color: var(--text-dark);
}

.product-tabs__btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.product-tabs__content {
    padding: 1.5rem;
}

.product-tabs__pane[hidden] {
    display: none;
}

.product-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.product-description h2,
.product-description h3,
.product-description h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.product-description p {
    margin-bottom: 1rem;
}

.product-description ul,
.product-description ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.product-description li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   PURCHASE CARD (SIDEBAR)
   ========================================================================== */

.product-sidebar {
    position: relative;
}

.purchase-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.purchase-card.sticky {
    position: fixed;
    top: 100px;
    width: 360px;
    z-index: 100;
}

@media (max-width: 1023px) {
    .purchase-card {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        padding: 1.25rem;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }
    
    .purchase-card.sticky {
        position: fixed;
        top: auto;
        bottom: 0;
        width: auto;
    }
}

.purchase-card__price {
    margin-bottom: 1.25rem;
    text-align: center;
}

.purchase-card__price .price-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.purchase-card__price .price-free {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

/* Format Selection */
.purchase-card__format {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.format-option {
    cursor: pointer;
}

.format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-option__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    transition: all 0.15s;
}

.format-option input:checked + .format-option__box {
    border-color: var(--primary);
    background: var(--primary-light, #dbeafe);
}

.format-option__icon {
    font-size: 1.5rem;
}

.format-option__label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-dark);
}

.format-option__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Purchase Sections */
.purchase-card__section {
    margin-bottom: 1rem;
}

.purchase-card__section[hidden] {
    display: none;
}

.purchase-card__info {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.purchase-card__info svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}

/* City Selector */
.city-selector {
    margin-bottom: 1rem;
}

.city-selector__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.city-selector__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.city-option {
    cursor: pointer;
}

.city-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.city-option__box {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.15s;
}

.city-option input:checked + .city-option__box {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.city-option__box svg {
    opacity: 0.7;
}

/* City Details */
.city-details {
    margin-bottom: 1rem;
}

.city-details__note {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.city-details__note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Offline Form */
.offline-form .form-group {
    margin-bottom: 0.75rem;
}

.offline-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.offline-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Form Success */
.form-success {
    text-align: center;
    padding: 1rem 0;
}

.form-success h4 {
    margin: 1rem 0 0.5rem;
    color: var(--text-dark);
}

.form-success p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Purchase Meta */
.purchase-card__meta {
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.meta-item svg {
    flex-shrink: 0;
    color: #22c55e;
}

/* Add to Cart Button */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ==========================================================================
   RELATED PRODUCTS
   ========================================================================== */

.related-products {
    padding: 3rem 0;
    background: #fff;
}

.related-products .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn--primary {
    background: var(--primary, #1e40af);
    color: #fff;
}

.btn--primary:hover {
    background: #1e3a8a;
}

.btn--secondary {
    background: #f97316;
    color: #fff;
}

.btn--secondary:hover {
    background: #ea580c;
}

.btn--full {
    width: 100%;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
