/**
 * WooCommerce PIP Video Pro - Frontend Styles
 * Version: 2.10
 * Optimized for performance, accessibility, and mobile experience
 */

/* ================================
   CSS RESET & BASE STYLES
   ================================ */

/* Ensure currency symbols display correctly */
.woocommerce-Price-currencySymbol {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Screen reader only content */
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Live region for screen reader announcements */
.pip-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ================================
   PIP VIDEO CONTAINER
   ================================ */

#pip-video-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    will-change: transform, opacity;
}

#pip-video-container.pip-video-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

#pip-video-container.pip-video-hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
}

/* ================================
   PIP VIDEO WRAPPER
   ================================ */

.pip-video-wrapper {
    position: relative;
    width: 280px;
    height: 200px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    /* MOBILE FIX - Ensure proper touch handling */
    touch-action: manipulation;
    cursor: pointer;
}

#pip-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    /* MOBILE FIX - Ensure touch events work but don't interfere with close button */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    /* DISABLE NATIVE VIDEO CONTROLS */
    -webkit-media-controls: none;
    -webkit-media-controls-panel: none;
    -webkit-media-controls-play-button: none;
    -webkit-media-controls-start-playback-button: none;
}

#pip-video::-webkit-media-controls {
    display: none !important;
}

#pip-video::-webkit-media-controls-panel {
    display: none !important;
}

#pip-video::-webkit-media-controls-play-button {
    display: none !important;
}

#pip-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

#pip-video:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

#pip-video:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ================================
   CLOSE BUTTON - FIXED FOR MOBILE
   ================================ */

.pip-close-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1001 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 0 !important;
    /* MOBILE TOUCH FIX */
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3) !important;
    tap-highlight-color: rgba(255, 255, 255, 0.3) !important;
    -webkit-touch-callout: none !important;
    user-select: none !important;
    pointer-events: auto !important;
}

.pip-close-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}

/* MOBILE ACTIVE STATE */
.pip-close-btn:active,
.pip-close-btn.mobile-active {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(0.95) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

.pip-close-btn:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

.pip-close-btn span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    display: block !important;
    margin-top: -2px !important;
    font-size: 20px !important;
    font-weight: 300 !important;
}

/* ================================
   LOADING INDICATOR
   ================================ */

.pip-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.pip-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: pip-spin 1s linear infinite;
}

@keyframes pip-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   LIGHTBOX OVERLAY
   ================================ */

.pip-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pip-lightbox-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ================================
   LIGHTBOX CONTENT
   ================================ */

.pip-lightbox-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
}

.pip-video-view {
    position: relative;
    width: auto;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.pip-lightbox-overlay.show .pip-video-view {
    transform: scale(1) translateY(0);
}

.pip-lightbox-video {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 95vh;
    border-radius: 12px;
    display: block;
    background: transparent;
    /* DISABLE NATIVE VIDEO CONTROLS */
    -webkit-media-controls: none;
    -webkit-media-controls-panel: none;
    -webkit-media-controls-play-button: none;
    -webkit-media-controls-start-playback-button: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.pip-lightbox-video::-webkit-media-controls {
    display: none !important;
}

.pip-lightbox-video::-webkit-media-controls-panel {
    display: none !important;
}

.pip-lightbox-video::-webkit-media-controls-play-button {
    display: none !important;
}

.pip-lightbox-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* ================================
   LIGHTBOX CONTROLS - FIXED DESKTOP CLOSE
   ================================ */

.pip-lightbox-close {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    cursor: pointer !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    position: fixed !important;
    top: 30px !important;
    right: 30px !important;
    z-index: 9999999 !important;
    padding: 0 !important;
}

.pip-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5) !important;
}

.pip-lightbox-close:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

.pip-lightbox-close:active {
    transform: scale(0.95) !important;
}

.pip-lightbox-close span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    display: block !important;
    margin-top: -2px !important;
}

/* ================================
   VIDEO CONTROLS
   ================================ */

.pip-video-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 1000;
}

.pip-video-controls-right {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.pip-lightbox-close-mobile {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
}

.pip-lightbox-close-mobile:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.pip-lightbox-close-mobile:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

.pip-lightbox-close-mobile span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    display: block !important;
    margin-top: -2px !important;
}

.pip-share-btn,
.pip-mute-btn {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
}

.pip-share-btn:hover,
.pip-mute-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.pip-share-btn:focus,
.pip-mute-btn:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

.pip-share-btn svg,
.pip-mute-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    pointer-events: none;
}

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

.pip-product-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 0 0 12px 12px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.pip-product-card:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
}

.pip-product-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.pip-product-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

.pip-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pip-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.pip-product-price .woocommerce-Price-amount {
    color: inherit;
}

.pip-product-price del {
    display: none;
}

.pip-product-price ins {
    text-decoration: none;
}

/* ================================
   PRODUCT DETAILS VIEW
   ================================ */

.pip-product-view {
    position: relative;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transform: translate(-50%, 100%);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 420px;
    max-height: 95vh;
    width: 90%;
    height: 95vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 100000;
    display: none;
    opacity: 0;
}

.pip-product-view.active {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.pip-product-details {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ================================
   PRODUCT DETAILS HEADER
   ================================ */

.pip-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    position: relative;
    z-index: 100;
    border-bottom: 1px solid #f0f0f0;
    min-height: 60px;
    flex-shrink: 0;
}

.pip-details-header h2 {
    display: none !important;
}

.pip-back-btn,
.pip-details-close,
.pip-cart-btn {
    background: white !important;
    border: 2px solid #ddd !important;
    color: #333 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.pip-back-btn:hover,
.pip-details-close:hover,
.pip-cart-btn:hover {
    background: #f8f8f8 !important;
    border-color: #999 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

.pip-back-btn:focus,
.pip-details-close:focus,
.pip-cart-btn:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
}

.pip-back-btn svg,
.pip-cart-btn svg {
    width: 18px;
    height: 18px;
    stroke: #333;
    stroke-width: 2.5;
    pointer-events: none;
}

.pip-details-close {
    font-size: 18px !important;
}

/* ================================
   PRODUCT DETAILS CONTENT
   ================================ */

.pip-details-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pip-details-content::-webkit-scrollbar {
    display: none;
}

/* ================================
   GALLERY SECTION - FIXED FOR MOBILE PORTRAIT
   ================================ */

.pip-gallery-section {
    margin: 0 0 20px 0;
    padding: 0;
    background: white;
    position: relative;
}

.pip-gallery-slider {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f8f8;
}

.pip-gallery-wrapper {
    height: 100%;
}

.pip-gallery-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.pip-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    pointer-events: none;
    user-select: none;
}

/* Swiper Pagination */
.swiper-pagination {
    bottom: 10px !important;
    text-align: center;
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
    margin: 0 3px !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.swiper-pagination-bullet-active {
    background: white !important;
    width: 24px !important;
    border-radius: 4px !important;
}

.swiper-pagination-bullet:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ================================
   PRODUCT INFO SECTION
   ================================ */

.pip-info-section {
    padding: 0;
    background: white;
}

.pip-details-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.pip-details-price {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin-bottom: 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.pip-details-price .woocommerce-Price-amount {
    color: inherit;
}

.pip-details-price del {
    display: none;
}

/* ================================
   VARIATIONS
   ================================ */

.pip-variations {
    margin-bottom: 20px;
}

.pip-attribute-group {
    margin-bottom: 15px;
}

.pip-attribute-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pip-attribute-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pip-option-btn {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 45px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.pip-option-btn:hover {
    border-color: #333;
    color: #333;
}

.pip-option-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.pip-option-btn.selected,
.pip-option-btn[aria-checked="true"] {
    background: #000;
    color: white;
    border-color: #000;
}

/* ================================
   ADD TO CART BUTTON
   ================================ */

.pip-add-to-cart-form {
    display: block !important;
    margin-bottom: 20px;
}

.pip-add-to-cart-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #000 0%, #333 100%);
    color: white !important;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pip-add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.pip-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.pip-add-to-cart-btn:hover::before {
    left: 100%;
}

.pip-add-to-cart-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.pip-add-to-cart-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.1s ease;
}

.pip-add-to-cart-btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #ddd 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.8px;
    color: #666 !important;
}

.pip-add-to-cart-btn:disabled::before {
    display: none;
}

/* Loading state */
.pip-add-to-cart-btn.loading {
    color: white !important;
    pointer-events: none;
    padding-left: 50px;
}

.pip-add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: pip-spin 1s linear infinite;
}

/* ================================
   PRODUCT META
   ================================ */

.pip-product-meta {
    padding: 15px 0 0;
    margin-bottom: 0;
    border-top: 1px solid #f0f0f0;
}

.pip-meta-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.pip-meta-label {
    font-weight: 500;
    color: #666;
    min-width: 90px;
    font-style: normal;
}

.pip-meta-value {
    color: #666;
    font-style: normal;
}

.pip-meta-value.pip-in-stock {
    color: #28a745;
}

.pip-meta-value.pip-out-stock {
    color: #dc3545;
}

/* ================================
   NOTIFICATION
   ================================ */

.pip-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.pip-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ================================
   MOBILE RESPONSIVE STYLES
   ================================ */

/* Mobile device class for optimizations */
.pip-mobile-device .pip-video-wrapper,
.pip-mobile-device .pip-lightbox-video {
    will-change: transform;
}

/* MOBILE FIX - Enhanced touch targets */
.pip-mobile-device #pip-video-container {
    /* Ensure minimum touch target size */
    min-width: 44px;
    min-height: 44px;
}

.pip-mobile-device .pip-video-wrapper {
    /* Better touch handling */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    tap-highlight-color: rgba(0,0,0,0.1);
    cursor: pointer;
}

.pip-mobile-device #pip-video {
    /* Ensure video is properly clickable */
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Tablet styles */
@media (max-width: 768px) {
    #pip-video-container {
        bottom: 15px;
        right: 15px;
    }
    
    .pip-video-wrapper {
        width: 220px;
        height: 160px;
    }
    
    .pip-close-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
        top: 6px !important;
        right: 6px !important;
        border: 3px solid rgba(255, 255, 255, 0.4) !important;
        background: rgba(0, 0, 0, 0.9) !important;
    }
    
    .pip-close-btn span {
        font-size: 22px !important;
    }
    
    .pip-lightbox-close {
        display: none !important;
    }
    
    .pip-lightbox-close-mobile {
        display: flex !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 18px !important;
    }
    
    .pip-video-controls {
        top: 12px;
        left: 12px;
        right: 12px;
    }
    
    .pip-video-controls-right {
        gap: 6px;
    }
    
    .pip-share-btn,
    .pip-mute-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    
    .pip-share-btn svg,
    .pip-mute-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .pip-lightbox-content {
        max-width: 90vw;
        max-height: 95vh;
        margin: 0 10px;
    }
    
    .pip-product-card {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .pip-product-image {
        width: 50px;
        height: 50px;
    }
    
    .pip-product-name {
        font-size: 15px;
    }
    
    .pip-product-price {
        font-size: 17px;
    }
    
    .pip-product-view {
        max-width: 95%;
        max-height: 95vh;
        height: 95vh;
    }
    
    .pip-details-title {
        font-size: 16px;
    }
    
    .pip-details-price {
        font-size: 18px;
    }
    
    .pip-gallery-slider {
        height: 300px;
    }
    
    .pip-option-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 40px;
        border-radius: 18px;
    }
}

/* Mobile phone styles */
@media (max-width: 480px) {
    #pip-video-container {
        bottom: 10px;
        right: 10px;
    }
    
    .pip-video-wrapper {
        width: 180px;
        height: 130px;
    }
    
    .pip-close-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
        top: 5px !important;
        right: 5px !important;
        border: 3px solid rgba(255, 255, 255, 0.5) !important;
        background: rgba(0, 0, 0, 0.95) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
    }
    
    .pip-close-btn span {
        font-size: 24px !important;
        font-weight: 200 !important;
    }
    
    .pip-lightbox-close-mobile {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    .pip-video-controls {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    
    .pip-video-controls-right {
        gap: 5px;
    }
    
    .pip-share-btn,
    .pip-mute-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    .pip-share-btn svg,
    .pip-mute-btn svg {
        width: 15px;
        height: 15px;
    }
    
    .pip-product-card {
        padding: 12px 14px;
        gap: 8px;
    }
    
    .pip-product-image {
        width: 45px;
        height: 45px;
        border-radius: 8px;
    }
    
    .pip-product-name {
        font-size: 14px;
    }
    
    .pip-product-price {
        font-size: 16px;
    }
    
    .pip-product-view {
        max-width: 100%;
        max-height: 100%;
        height: 100vh;
        border-radius: 12px;
    }
    
    .pip-details-header {
        padding: 12px 16px;
    }
    
    .pip-details-content {
        padding: 0 16px 16px;
    }
    
    .pip-details-title {
        font-size: 15px;
    }
    
    .pip-details-price {
        font-size: 17px;
    }
    
    .pip-gallery-slider {
        height: 280px;
    }
    
    .pip-option-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 35px;
        border-radius: 16px;
    }
    
    .pip-add-to-cart-btn {
        padding: 14px 18px;
        font-size: 14px;
        border-radius: 22px;
        letter-spacing: 0.6px;
    }
    
    .pip-back-btn,
    .pip-cart-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    .pip-back-btn svg,
    .pip-cart-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ================================
   HIGH CONTRAST MODE SUPPORT
   ================================ */

@media (prefers-contrast: high) {
    .pip-product-card {
        border: 2px solid #000;
    }
    
    .pip-option-btn {
        border-width: 3px;
    }
    
    .pip-add-to-cart-btn {
        border: 2px solid #000;
    }
}

/* ================================
   REDUCED MOTION SUPPORT
   ================================ */

@media (prefers-reduced-motion: reduce) {
    #pip-video-container,
    .pip-lightbox-overlay,
    .pip-product-view,
    .pip-add-to-cart-btn,
    .pip-option-btn,
    .pip-notification {
        transition: none;
        animation: none;
    }
    
    .pip-spinner {
        animation: none;
        border-top-color: transparent;
    }
    
    #pip-video:hover {
        transform: none;
        filter: none;
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    #pip-video-container,
    .pip-lightbox-overlay,
    .pip-notification {
        display: none !important;
    }
}