/* * Premium Single Product Page Styles
 * 100% Strict Mobile Responsive, Borderless, Shadow-driven UI
 */

/* 1. ULTIMATE OVERFLOW PROTECTION */
body, html {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.product-page-wrapper {
    padding: 40px 0 80px;
    background-color: #f8fafc;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box !important;
    overflow: hidden; /* Stops any child from pushing out */
}

/* 2. STRICT CONTAINER SIZING */
.product-page-wrapper .container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #64748b;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    word-break: break-word;
}

.breadcrumb a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 600;
}

/* 3. LAYOUT GRID FOR DESKTOP */
.product-details-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

/* Card Styles */
.product-image-card,
.product-desc-card,
.checkout-action-card,
.seller-info-card {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05); 
    padding: 35px;
    margin-bottom: 30px;
    box-sizing: border-box !important; 
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important; /* Critical for long URLs in text */
}

/* Left Content */
.product-main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-image-card {
    padding: 20px;
}

.product-main-image {
    width: 100%;
    height: auto;
    max-height: 550px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.product-desc-card h2 {
    font-size: 1.6rem;
    color: var(--text-color, #334155);
    margin-bottom: 20px;
    padding-bottom: 15px;
    box-shadow: 0 2px 0 0 #f1f5f9; 
}

.product-description-text {
    color: #475569;
    line-height: 1.8;
    font-size: 1.05rem;
    word-wrap: break-word !important; 
    overflow-wrap: break-word !important; 
    word-break: break-all !important; /* Forces long strings to break */
}

/* Right Sidebar */
.product-sidebar {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Pricing Display */
.product-price-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color, #334155);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.license-type {
    font-size: 0.85rem;
    background: #eff6ff;
    color: var(--primary-color, #2563eb);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
}

/* Feature List */
.feature-list {
    list-style: none;
    margin: 0 0 30px 0;
    padding: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 500;
}

.feature-list li svg {
    width: 22px;
    height: 22px;
    stroke: #10b981;
    stroke-width: 2.5;
    fill: none;
    background: #dcfce7;
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0; 
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.btn-buy-now,
.btn-live-demo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box !important;
}

.btn-buy-now {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-live-demo {
    background: #ffffff;
    color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Seller Info */
.seller-info-card h3 {
    font-size: 1.2rem;
    color: var(--text-color, #334155);
    margin-bottom: 20px;
    box-shadow: 0 2px 0 0 #f1f5f9; 
    padding-bottom: 15px;
}

.seller-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    overflow: hidden;
}

.seller-avatar {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary-color, #2563eb), #8b5cf6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.seller-details {
    flex: 1;
    min-width: 0; /* Extremely important for text truncation */
}

.seller-name {
    font-weight: 800;
    color: var(--text-color, #334155);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.seller-badge {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 700;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

/* Override PHP inline borders */
div[style*="border-top"] {
    border: none !important;
    box-shadow: 0 -2px 0 0 #f1f5f9 !important;
}


/* ==========================================================================
   4. AGGRESSIVE MOBILE RESPONSIVENESS
   ========================================================================== */

/* Large Tablets & Small Laptops */
@media (max-width: 1024px) {
    .product-details-container {
        grid-template-columns: 1.5fr 1fr;
    }
}

/* Tablets & Mobile Devices */
@media (max-width: 768px) {
    /* Kill the grid completely on mobile, use flex */
    .product-details-container {
        display: flex !important; 
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }

    .product-main-content,
    .product-sidebar {
        width: 100% !important;
        max-width: 100vw !important;
        display: flex;
        flex-direction: column;
    }
    
    /* Rearrange order for mobile UI */
    .product-image-card { order: 1; margin-bottom: 20px !important; }
    .product-sidebar { order: 2; margin-bottom: 20px !important; }
    .product-desc-card { order: 3; margin-bottom: 20px !important; }

    /* Force all cards to fit the screen */
    .product-image-card,
    .product-desc-card,
    .checkout-action-card,
    .seller-info-card {
        padding: 20px 15px !important;
        border-radius: 12px;
        width: 100% !important; 
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .product-price-display {
        font-size: 2.2rem;
    }
}

/* Extra Small Phones */
@media (max-width: 480px) {
    .product-page-wrapper {
        padding: 15px 0 30px !important; 
    }
    
    .product-page-wrapper .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .checkout-action-card h1 {
        font-size: 1.4rem;
    }

    .product-price-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}