/* Reset to avoid conflicts with WordPress/WooCommerce */
.music-shop-widget *,
.merch-section * {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #fafafa;
}

.music-shop-widget,
.merch-section {
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
    color: #333;
}

.merch-section {
    background-color: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    padding: 60px 20px;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #222;
}

.section-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Filters */
.widget-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.widget-search,
.widget-filter {
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    color: #333;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.widget-search {
    flex: 1;
    min-width: 250px;
}

.widget-search:focus,
.widget-filter:focus {
    border-color: #6C63FF;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.widget-filter {
    min-width: 180px;
}

/* Products Grid - Music (multiple columns) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Merch Grid (centered, 2 items max) */
.merch-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.widget-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.widget-loading i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #6C63FF;
}

.widget-loading p {
    font-size: 16px;
    margin: 0;
}

/* Product Card - Common */
.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.2);
    border-color: #6C63FF;
}

/* Merch cards - fixed width */
.merch-grid .product-card {
    width: 350px;
    max-width: 100%;
}

.product-card.merch:hover {
    box-shadow: 0 8px 25px rgba(255, 101, 132, 0.2);
    border-color: #FF6584;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 280px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
}

.merch-grid .product-image {
    height: 320px;
}

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

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

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* Play Overlay (music only) */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.product-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    color: #6C63FF;
    font-size: 22px;
    margin-left: 3px;
}

/* Product Info */
.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #222;
    line-height: 1.3;
}

.product-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
    gap: 8px;
}

.product-tag {
    background: rgba(108, 99, 255, 0.1);
    color: #6C63FF;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 12px;
}

/* Merch Variants */
.product-variants {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.variant-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.variant-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.variant-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.variant-option {
    padding: 5px 12px;
    border-radius: 12px;
    background: #f5f5f5;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.product-description {
    font-size: 13px;
    color: #777;
    margin: 0 0 15px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #6C63FF;
}

.product-card.merch .product-price {
    color: #FF6584;
}

.woocommerce-btn {
    background: linear-gradient(135deg, #6C63FF 0%, #8B7FFF 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.woocommerce-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
    color: white;
}

.product-card.merch .woocommerce-btn {
    background: linear-gradient(135deg, #FF6584 0%, #FF8BA0 100%);
}

.product-card.merch .woocommerce-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 101, 132, 0.3);
}

.woocommerce-btn i {
    font-size: 14px;
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: -120px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #6C63FF;
    padding: 15px 20px;
    z-index: 9999;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.audio-player.active {
    bottom: 0;
}

.player-btn {
    background: linear-gradient(135deg, #6C63FF 0%, #8B7FFF 100%);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.player-btn:hover {
    transform: scale(1.1);
}

.player-btn i {
    font-size: 16px;
}

.player-close {
    background: #f5f5f5;
    color: #666;
}

.player-close:hover {
    background: #e0e0e0;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-track-name {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress-container {
    width: 100%;
    height: 5px;
    background: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 6px;
    overflow: hidden;
}

.player-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6C63FF 0%, #FF6584 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.player-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
}

/* Notification */
.widget-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6C63FF 0%, #8B7FFF 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.widget-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Empty Message */
.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-message i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-message p {
    font-size: 18px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .widget-filters {
        flex-direction: column;
    }

    .widget-search,
    .widget-filter {
        width: 100%;
        min-width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .merch-grid {
        flex-direction: column;
        align-items: center;
    }

    .merch-grid .product-card {
        width: 100%;
        max-width: 400px;
    }

    .product-image {
        height: 220px;
    }

    .merch-grid .product-image {
        height: 280px;
    }

    .audio-player {
        padding: 12px 15px;
        gap: 12px;
    }

    .player-btn {
        width: 40px;
        height: 40px;
    }

    .player-track-name {
        font-size: 13px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .product-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .woocommerce-btn {
        width: 100%;
        justify-content: center;
    }

    .widget-notification {
        left: 15px;
        right: 15px;
        top: 15px;
    }

    .music-shop-widget,
    .merch-section {
        padding: 30px 15px;
    }
}

/* WordPress/WooCommerce Compatibility */
.music-shop-widget a,
.merch-section a {
    text-decoration: none;
}

.music-shop-widget button,
.merch-section button {
    font-family: 'Poppins', sans-serif;
}

.music-shop-widget input[type="text"],
.music-shop-widget select {
    max-width: 100%;
    height: auto;
}
