/* Rohini Threads - Shop Page Styles */

/* ============================================
   Shop Layout
   ============================================ */
.shop-page {
    padding-top: 170px;
    min-height: 100vh;
    transition: padding-top 0.3s ease;
}

body.scrolled .shop-page {
    padding-top: 130px;
}

@media (max-width: 768px) {
    .shop-page {
        padding-top: 150px;
    }

    body.scrolled .shop-page {
        padding-top: 110px;
    }
}

.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.shop-header {
    text-align: center;
    margin-bottom: 40px;
}

.shop-header h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.shop-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Shop Grid Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

.shop-main {
    min-width: 0;
}

/* ============================================
   Filter Sidebar
   ============================================ */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    transition: top 0.3s ease;
}

body.scrolled .filter-sidebar {
    top: 70px;
    max-height: calc(100vh - 90px);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #666;
    line-height: 1;
}

.filter-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.filter-header h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
}

.clear-filters-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.clear-filters-btn:hover {
    color: #d93636;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 15px;
    cursor: pointer;
}

.filter-toggle {
    transition: transform 0.3s;
}

.filter-group.collapsed .filter-toggle {
    transform: rotate(-90deg);
}

.filter-group.collapsed .filter-options {
    display: none;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
}

.filter-option:hover {
    color: var(--primary-color);
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.filter-count {
    margin-left: auto;
    color: #999;
    font-size: 0.85rem;
}

/* ============================================
   Shop Toolbar
   ============================================ */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.product-count {
    color: #666;
    font-size: 0.95rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #666;
    transition: all 0.2s;
}

.view-btn:hover,
.view-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Sort Dropdown */
.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-dropdown label {
    color: #666;
    font-size: 0.95rem;
    white-space: nowrap;
}

.sort-dropdown select {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    min-width: 160px;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.mobile-filter-btn:hover {
    border-color: var(--primary-color);
}

/* ============================================
   Active Filters
   ============================================ */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--light-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
}

.active-filter-tag button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.active-filter-tag button:hover {
    color: var(--accent-color);
}

/* ============================================
   Category Video Card (in-grid)
   ============================================ */
.video-product-card .video-card-wrapper {
    position: relative;
    background: #000;
    cursor: pointer;
    flex: 1;
    aspect-ratio: auto;
}

.video-card-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.video-card-youtube {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: none;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.3s;
    z-index: 1;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.video-play-overlay.playing {
    background: transparent;
    pointer-events: none;
}

.video-play-overlay.playing .video-play-btn {
    opacity: 0;
}

/* Custom video controls bar */
.video-controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.video-product-card:hover .video-controls-bar.visible,
.video-controls-bar.visible.always-show {
    opacity: 1;
    pointer-events: auto;
}

.video-control-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-controls-bar .video-fullscreen-btn {
    display: none;
}

@media (max-width: 768px) {
    .video-controls-bar .video-fullscreen-btn {
        display: flex;
        margin-left: auto;
    }

    .video-controls-bar.visible {
        opacity: 1;
        pointer-events: auto;
    }
}

.video-play-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--dark-color);
    transition: transform 0.3s, opacity 0.3s;
    padding-left: 4px;
}

.video-play-overlay:hover .video-play-btn {
    transform: scale(1.1);
}

.video-product-card .product-info {
    text-align: center;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px 13px;
}

.video-product-card .product-info .product-name {
    margin: 0;
    font-size: 0.95rem;
}

.video-product-card .product-info .product-description {
    display: none;
}

/* ============================================
   Products Grid
   ============================================ */
.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

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

.shop-products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.shop-products-grid.list-view .product-image-wrapper {
    aspect-ratio: 1 / 1;
}

.shop-products-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Product Card Enhancements */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Scroll-reveal entrance animation */
.product-card.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s;
}

.product-card.scroll-reveal.scroll-visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card.scroll-reveal.scroll-visible:hover {
    transform: translateY(-5px);
}

@media (prefers-reduced-motion: reduce) {
    .product-card.scroll-reveal {
        opacity: 1;
        transform: none;
        transition: box-shadow 0.3s;
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

/* Product Actions Overlay */
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.wishlist-btn.active {
    color: var(--accent-color);
}

.wishlist-btn.active:hover {
    background: var(--accent-color);
    color: white;
}

/* Product Info */
.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name-link {
    text-decoration: none;
    color: inherit;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 600;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.product-name-link:hover .product-name {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    margin-top: auto;
}

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

.product-original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    background: #e09520;
}

/* Card Quantity Controls */
.card-cart-action {
    width: 100%;
}

.card-qty-control {
    display: flex;
    width: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.card-qty-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.card-qty-btn:hover:not(:disabled) {
    background: #e09520;
}

.card-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-qty-count {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    background: white;
}

/* Detail page qty controls */
.detail-cart-action {
    flex: 1;
}

.detail-qty-control {
    height: 48px;
}

.detail-qty-control .card-qty-btn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    font-size: 1.4rem;
}

.detail-qty-control .card-qty-count {
    font-size: 1.15rem;
}

.proceed-to-buy-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}

.proceed-to-buy-btn:hover {
    background: var(--primary-color);
    color: white;
}

.card-proceed-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.no-products p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Filter Pills (Mobile Inline Filters)
   ============================================ */
.filter-pills-container {
    display: none;
}

@media (max-width: 992px) {
    .filter-pills-container {
        display: block;
        margin-bottom: 15px;
    }

    .filter-pills-scroll {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 4px 0;
        scrollbar-width: none;
    }

    .filter-pills-scroll::-webkit-scrollbar {
        display: none;
    }

    .filter-pill-wrapper {
        position: relative;
        flex-shrink: 0;
    }

    .filter-pill {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        background: white;
        border: 1.5px solid #ddd;
        border-radius: 20px;
        font-size: 0.85rem;
        font-family: 'Open Sans', sans-serif;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
        color: #555;
    }

    .filter-pill:hover {
        border-color: var(--primary-color);
    }

    .filter-pill.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .filter-pill.active .pill-chevron {
        color: white;
    }

    .filter-pill.dropdown-open {
        border-color: var(--primary-color);
    }

    .pill-chevron {
        font-size: 0.7rem;
        transition: transform 0.2s;
        color: #999;
    }

    .filter-pill.dropdown-open .pill-chevron {
        transform: rotate(180deg);
    }

    .filter-pill.clear-pill {
        background: none;
        border-color: var(--accent-color);
        color: var(--accent-color);
        font-size: 0.8rem;
    }

    .filter-pill.clear-pill:hover {
        background: var(--accent-color);
        color: white;
    }

    /* Pill Dropdown */
    .pill-dropdown {
        display: none;
        position: fixed;
        min-width: 200px;
        max-height: 250px;
        overflow-y: auto;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        z-index: 1001;
        padding: 8px 0;
    }

    .pill-dropdown.open {
        display: block;
    }

    .pill-dropdown-option {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        cursor: pointer;
        font-size: 0.9rem;
        color: #555;
        transition: background 0.15s;
    }

    .pill-dropdown-option:hover {
        background: #f5f5f5;
    }

    .pill-dropdown-option input[type="radio"] {
        accent-color: var(--primary-color);
        width: 16px;
        height: 16px;
    }

    .pill-dropdown-count {
        margin-left: auto;
        color: #999;
        font-size: 0.8rem;
    }
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 992px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        border-radius: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .filter-sidebar.active {
        left: 0;
    }

    .filter-sidebar .filter-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
        margin: -25px -25px 25px -25px;
        padding: 25px 25px 15px 25px;
    }
}

/* Filter Overlay - hidden by default, shown on mobile */
.filter-overlay {
    display: none;
}

@media (max-width: 992px) {
    .filter-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .filter-close-btn {
        display: flex;
    }

    body.filters-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .shop-header h1 {
        font-size: 2rem;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right {
        justify-content: space-between;
    }

    .shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    .product-image-wrapper {
        aspect-ratio: 1 / 1;
    }

    .product-info {
        padding: 8px 10px;
    }

    .product-info .product-name {
        font-size: 0.75rem;
        margin-bottom: 2px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-info .product-description {
        font-size: 0.65rem;
        line-height: 1.35;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }

    .product-price-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .product-info .product-price {
        font-size: 0.9rem;
    }

    .product-info .product-original-price {
        font-size: 0.75rem;
    }

    .add-to-cart-btn {
        padding: 7px;
        font-size: 0.78rem;
        border-radius: 6px;
    }

    .card-qty-control {
        border-radius: 6px;
    }

    .card-qty-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .card-qty-count {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-image-wrapper {
        aspect-ratio: 1 / 1;
    }

    .product-info {
        padding: 6px 8px;
    }

    .product-info .product-name {
        font-size: 0.7rem;
        margin-bottom: 2px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-info .product-description {
        font-size: 0.6rem;
        line-height: 1.35;
        margin-bottom: 3px;
        -webkit-line-clamp: 2;
    }

    .product-info .product-price {
        font-size: 0.85rem;
    }

    .product-info .product-original-price {
        font-size: 0.7rem;
    }

    .product-price-row {
        margin-bottom: 5px;
    }

    .add-to-cart-btn {
        padding: 6px;
        font-size: 0.75rem;
    }

    .card-qty-btn {
        width: 28px;
        min-width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .card-qty-count {
        font-size: 0.78rem;
    }
}
