/* Locked product: hide double-side toggle when viewing published locked products */
body.fpd-locked-product .fc-double-side-toggle { display: none !important; }
body.fpd-locked-product .fc-double-side-lock { display: none !important; }
/* FPD Product Details Interface - Designer 2 Inspired Styling */

/* ========================================
   CONTAINER & LAYOUT - WIDTH SYNC FIX
======================================== */

.fpd-product-details-container {
    margin: 20px 0 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e1e4e8;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    /* CRITICAL: Match Designer 2 container width exactly */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Force same width as Designer 2 enhanced container */
.single-product .fpd-product-details-container,
.single-product .d2-enhanced-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.fpd-product-details-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

/* ========================================
   HEADER SECTION
======================================== */

.fpd-product-details-header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 20px;
}

.fpd-product-details-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
}

.fpd-product-details-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 15px;
    font-weight: 500;
}

/* ========================================
   PRODUCT TYPE SELECTOR - INTEGRATED EXPANDABLE
======================================== */

.fpd-product-type-section {
    margin-bottom: 25px;
}

.fpd-product-type-section h4 {
    margin: 0 0 12px 0;
    color: #34495e;
    font-size: 16px;
    font-weight: 600;
}

/* Product type expandable content */
.fpd-product-type-content {
    padding-top: 15px;
}

/* New: Product cards grid (consistent with Designer 2 cards) */
.fpd-product-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.fpd-product-card {
    background: #ffffff;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 70px;
    max-height: 70px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.fpd-product-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.fpd-product-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.fpd-product-card.selected .fpd-product-card-name {
    color: #ffffff;
}

.fpd-product-card.selected .fpd-product-card-icon {
    color: #ffffff;
}

.fpd-product-card-icon {
    font-size: 20px;
    color: #667eea;
}

.fpd-product-card-name {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
    margin: 0;
}

/* ========================================
   SIZE SELECTOR - INTEGRATED EXPANDABLE
======================================== */

.fpd-size-section {
    margin-bottom: 25px;
}

.fpd-size-section h4 {
    margin: 0 0 12px 0;
    color: #34495e;
    font-size: 16px;
    font-weight: 600;
}

/* Size expandable content */
.fpd-size-content {
    padding-top: 15px;
}

.fpd-size-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.fpd-size-button {
    padding: 12px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpd-size-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.fpd-size-button.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* ========================================
   COLOR SELECTOR
======================================== */

.fpd-color-section {
    margin-bottom: 25px;
}

.fpd-color-section h4 {
    margin: 0 0 12px 0;
    color: #34495e;
    font-size: 16px;
    font-weight: 600;
}

/* Color expandable content */
.fpd-color-content {
    padding-top: 15px;
}

/* ========================================
   UNIFIED EXPANDABLE SECTIONS GRID
======================================== */

/* Main unified sections grid within product details container */
.fpd-product-details-container .fpd-info-sections-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 20px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

/* Individual section styling within unified grid */
.fpd-product-details-container .fpd-info-section {
    background: transparent;
    margin-bottom: 0;
}

.fpd-product-details-container .fpd-info-item {
    background: white;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.fpd-product-details-container .fpd-info-item:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.fpd-product-details-container .fpd-info-question {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    background: white;
}

.fpd-product-details-container .fpd-info-question:hover {
    background-color: #f8f9fa;
}

.fpd-product-details-container .fpd-info-question h5 {
    margin: 0;
    font-size: 16px;
    color: #34495e;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpd-product-details-container .fpd-info-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    transition: transform 0.3s ease;
    user-select: none;
}

.fpd-product-details-container .fpd-info-item.active .fpd-info-toggle {
    transform: rotate(45deg);
}

.fpd-product-details-container .fpd-info-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background-color: #f8f9fa;
}

.fpd-product-details-container .fpd-info-item.active .fpd-info-answer {
    max-height: 600px;
    padding: 0 20px 20px 20px;
}

/* Content styling for different section types */
.fpd-product-details-container .fpd-product-type-content,
.fpd-product-details-container .fpd-size-content,
.fpd-product-details-container .fpd-color-content,
.fpd-product-details-container .fpd-specs-content,
.fpd-product-details-container .fpd-policy-content,
.fpd-product-details-container .fpd-care-content,
.fpd-product-details-container .fpd-certificates-content,
.fpd-product-details-container .fpd-pricing-content {
    padding-top: 15px;
}

/* Ensure product cards grid works within expandable section */
.fpd-product-details-container .fpd-product-type-content .fpd-product-cards-grid {
    margin-bottom: 0;
}

/* Ensure size buttons work within expandable section */
.fpd-product-details-container .fpd-size-content .fpd-size-buttons {
    margin-bottom: 15px;
}

/* Size clarification image styling */
.fpd-size-clarification {
    margin-top: 15px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fpd-size-clarification.show {
    opacity: 1;
    transform: translateY(0);
}

.fpd-size-clarification-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fpd-size-clarification-img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.fpd-size-clarification-img:hover {
    transform: scale(1.05);
}

/* Ensure color buttons work within expandable section */
.fpd-product-details-container .fpd-color-content .fpd-color-buttons {
    margin-bottom: 0;
}

/* Spec items styling */
.fpd-product-details-container .fpd-spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.fpd-product-details-container .fpd-spec-item strong {
    color: #333;
    font-weight: 600;
}

.fpd-product-details-container .fpd-spec-item span {
    color: #666;
}

.fpd-product-details-container .fpd-design-features {
    margin-top: 5px;
}

.fpd-product-details-container .fpd-feature-item {
    color: #666;
    margin-bottom: 3px;
    font-size: 0.95rem;
}

/* Policy links styling */
.fpd-product-details-container .fpd-policy-link-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.fpd-product-details-container .fpd-policy-link-item i {
    color: #667eea;
    font-size: 1.2rem;
    margin-top: 2px;
}

.fpd-product-details-container .fpd-policy-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.fpd-product-details-container .fpd-policy-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.fpd-product-details-container .fpd-policy-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.fpd-product-details-container .fpd-policy-note i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Care instructions styling */
.fpd-product-details-container .fpd-care-instruction {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
}

.fpd-product-details-container .fpd-care-instruction i {
    color: #FF9800;
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Certificates styling */
.fpd-product-details-container .fpd-certificates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.fpd-product-details-container .fpd-certificate-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fpd-product-details-container .fpd-certificate-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.fpd-product-details-container .fpd-certificate-image {
    max-width: 100%;
    height: 80px;
    object-fit: contain;
    object-position: center;
}

.fpd-product-details-container .fpd-certificates-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.fpd-product-details-container .fpd-certificates-note i {
    color: #4CAF50;
    font-size: 1.2rem;
}

/* Pricing styling */
.fpd-product-details-container .fpd-pricing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.fpd-product-details-container .fpd-pricing-item i {
    color: #4CAF50;
    font-size: 1.2rem;
}

.fpd-product-details-container .fpd-pricing-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.fpd-product-details-container .fpd-pricing-note i {
    color: #667eea;
    font-size: 1.2rem;
}

.fpd-color-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
}

.fpd-color-button {
    padding: 12px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: column;
}

.fpd-color-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.fpd-color-button.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.fpd-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 4px;
}

.fpd-color-button.active .fpd-color-preview {
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ========================================
   BULK ORDER SECTION
======================================== */

.fpd-bulk-order-section {
    margin-bottom: 25px;
}

/* Style the FPD bulk form when it appears */
#fpd-bulk-add-form-placement .fpd-bulk-add-form {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove the hiding of first row - let FPD work naturally */
/* We'll handle the logic differently in JavaScript */

#fpd-bulk-add-form-placement .fpd-bulk-add-form input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

#fpd-bulk-add-form-placement .fpd-bulk-add-form input[type="number"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#fpd-bulk-add-form-placement .fpd-bulk-add-form label {
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    display: block !important;
}

.fpd-bulk-help-added {
    font-size: 13px !important;
    color: #6c757d !important;
    font-style: italic !important;
    margin-top: 8px !important;
    line-height: 1.4 !important;
}

/* ========================================
   SELECTION CONFIRMATION SECTION
======================================== */

.fpd-selection-confirmation {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    border: 2px solid #4caf50;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fpd-slideInSuccess 0.4s ease-out;
}

.fpd-confirmation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
}

.fpd-confirmation-text {
    flex: 1;
    color: #2e7d32;
    font-size: 15px;
    font-weight: 500;
}

.fpd-confirmation-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.fpd-confirmation-text span {
    color: #388e3c;
    font-weight: 600;
}

@keyframes fpd-slideInSuccess {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   BULK ORDER HEADER
======================================== */

.fpd-bulk-order-header {
    margin-bottom: 15px;
    padding: 5px 16px 1px 16px; /* Top: 5px, Right/Left: 16px, Bottom: 1px to account for internal bottom margins */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px !important; /* Match color button roundness */
}

.fpd-bulk-order-header h4 {
    /* Hide legacy "Your selection" title; we will restyle FPD title instead */
    display: none !important;
}

.fpd-bulk-help-text {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
}

/* Make the FPD Bulk Order title look like the old header */
.fpd-bulk-order-header .fpd-bulk-variations .fpd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px; /* Reduced from 8px to 4px for more compact initial state */
}

/* Ensure FPD internal containers use consistent border-radius */
.fpd-bulk-order-header .fpd-container,
.fpd-bulk-order-header .fpd-bulk-variations,
.fpd-bulk-order-header .fpd-variations-list,
.fpd-bulk-order-header .fpd-head {
    border-radius: 0 !important; /* Keep containers square for clean nesting */
}

.fpd-bulk-order-header .fpd-row,
.fpd-bulk-order-header .fpd-row select,
.fpd-bulk-order-header .fpd-row input {
    border-radius: 6px !important; /* Subtle rounding for form elements */
}

/* ⚔️ SAMURAI FIX: Ensure all bulk order row select elements have proper vertical alignment */
.fpd-bulk-order-header .fpd-row select,
#fpd-bulk-add-form-placement .fpd-row select,
#fpd-bulk-add-form-placement select {
    display: flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* ⚔️ SAMURAI FIX: Ensure bulk order input elements also align properly */
.fpd-bulk-order-header .fpd-row input[type="number"],
#fpd-bulk-add-form-placement .fpd-row input[type="number"],
#fpd-bulk-add-form-placement input[type="number"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.fpd-bulk-order-header .fpd-bulk-variations .fpd-head span,
.fpd-bulk-order-header .fpd-bulk-variations .fpd-head .fpd-headline {
    margin: 0 0 4px 0 !important; /* Reduced from 8px to 4px for more compact spacing */
    color: #495057 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    display: block !important;
}

/* Match Size/Color selects rounding to the quantity input */
.fpd-bulk-order-header .fpd-variations-list .fpd-row select {
    border-radius: var(--fpd-border-radius, 6px) !important;
    border: 2px solid #e1e4e8 !important;
    background: #ffffff !important;
    /* ⚔️ SAMURAI FIX: Center placeholder text vertically in bulk order rows */
    display: flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
}

/* ========================================
   PRICE SECTION (now inside 3×1 grid)
======================================== */

.fpd-price-section {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.fpd-price-section .price {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #667eea !important;
    display: inline-flex !important;
    align-items: center !important;
}

.fpd-price-section .price .woocommerce-Price-amount {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #667eea !important;
}

.fpd-price-section .price del {
    color: #95a5a6 !important;
    margin-right: 10px !important;
    font-size: 20px !important;
}

.fpd-price-section .price ins {
    text-decoration: none !important;
}

/* ========================================
   ADD TO CART SECTION
======================================== */

.fpd-add-to-cart-section {
    margin-top: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ⚔️ SAMURAI GRID REWORK: Create a 1×3 horizontal grid for Wishlist+Create (20%) | Price (20%) | Add to Cart (60%) */
.fpd-add-to-cart-section .fpd-buttons-grid {
    display: grid;
    grid-template-columns: 20% 20% 60%;
    gap: 12px;
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 900px;
    margin: 25px auto 0 auto;
    min-height: 48px;
    padding-right: 28px !important; /* Match the right padding of info containers */
}

/* Ensure all grid items have consistent height and alignment */
.fpd-add-to-cart-section .fpd-buttons-grid > * {
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile responsive: Center Add to Cart button on screens < 767px */
@media (max-width: 767px) {
    .fpd-add-to-cart-section .fpd-buttons-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-right: 0 !important; /* Remove right padding on mobile */
        margin: 25px 0 0 0;
        align-items: center;
        justify-content: center;
    }

    /* Center the Add to Cart button on mobile */
    .fpd-add-to-cart-section .fpd-buttons-grid .fpd-add-to-cart-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto !important;
        justify-self: center !important;
        align-self: center !important;
        order: 3; /* Put Add to Cart at the bottom */
    }

    /* Center the price section on mobile */
    .fpd-add-to-cart-section .fpd-price-section {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
        order: 2; /* Put price in the middle */
    }

    /* Center the left buttons group on mobile */
    .fpd-add-to-cart-section .fpd-buttons-left-group {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 auto !important;
        order: 1; /* Put buttons at the top */
    }

    /* Mobile Add to Cart button styling */
    .fpd-add-to-cart-section .fpd-add-to-cart-button {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        padding: 12px 20px !important;
        margin: 0 auto !important;
    }

    /* Mobile wishlist wrapper styling */
    .fpd-add-to-cart-section .fpd-buttons-left-group .qwfw-add-to-wishlist-wrapper.qwfw--single {
        width: 48px !important;
        height: 48px !important;
        align-self: center !important;
        justify-self: center !important;
    }
}

/* Left buttons group container - wishlist + create product (fits in 20%) */
.fpd-add-to-cart-section .fpd-buttons-left-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    height: 48px !important;
}

/* Ensure individual button containers in left group maintain their size */
.fpd-add-to-cart-section .fpd-buttons-left-group > * {
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* Ensure price section is centered */
.fpd-add-to-cart-section .fpd-price-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 48px !important;
    text-align: center !important;
}

/* Special styling for the Add to Cart button container - now has 60% of the space */
.fpd-add-to-cart-section .fpd-buttons-grid .fpd-add-to-cart-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Style the Add to Cart button to show text with icon - full width centered in 60% container */
.fpd-add-to-cart-section .fpd-add-to-cart-button {
    background: linear-gradient(135deg, #2b6bc7 0%, #cf3a74 50%, #e53143 75%, #ff6b35 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    padding: 12px 24px !important; /* Increased horizontal padding for better spacing */
    white-space: nowrap;
    height: 48px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important; /* Space between icon and text */
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(43, 107, 199, 0.3) !important;
}

.fpd-add-to-cart-section .fpd-add-to-cart-button:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 32px rgba(43, 107, 199, 0.4) !important;
}

.fpd-add-to-cart-section .fpd-add-to-cart-button:active:not(:disabled) {
    transform: translateY(-1px) !important;
}

.fpd-add-to-cart-section .fpd-add-to-cart-button:disabled,
.fpd-add-to-cart-section .fpd-add-to-cart-button.disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Style the Add to Cart button text */
.fpd-add-to-cart-section .fpd-add-to-cart-text {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

/* Style wishlist wrapper to match Add to Cart button height and alignment */
/* Ultra-specific selector to override theme's #qodef-woo-page.qodef--single .entry-summary rule */
#qodef-woo-page.qodef--single .entry-summary .fpd-add-to-cart-section .fpd-buttons-grid .qwfw-add-to-wishlist-wrapper.qwfw--single,
.fpd-add-to-cart-section .fpd-buttons-grid .qwfw-add-to-wishlist-wrapper.qwfw--single,
.fpd-add-to-cart-section .fpd-buttons-left-group .qwfw-add-to-wishlist-wrapper.qwfw--single {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;
    width: 48px !important;
    box-sizing: border-box !important;
    margin: 0 !important; /* Override theme's 50px top margin */
    position: static !important; /* Override theme's relative positioning */
    align-self: center !important; /* Force center alignment in grid */
    justify-self: center !important; /* Center in grid cell */
    vertical-align: middle !important; /* Additional alignment override */
    flex-shrink: 0 !important;
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist:hover {
    background: #ffffff !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist.qwfw--added {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist .qwfw-m-icon {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    width: 28px;
    height: 28px;
    position: relative;
}

/* Override wishlist plugin default SVG styles */
.fpd-add-to-cart-section .qwfw-add-to-wishlist .qwfw-m-icon svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    fill: transparent !important;
    stroke: rgba(102, 126, 234, 1) !important;
    stroke-width: 2px !important;
    transition: fill 0.2s ease-out, stroke 0.2s ease-out;
    overflow: visible;
    display: block;
}

/* Override any inline SVG attributes and plugin defaults */
.fpd-add-to-cart-section .qwfw-add-to-wishlist .qwfw-m-icon svg,
.fpd-add-to-cart-section .qwfw-add-to-wishlist .qwfw-m-icon svg * {
    fill: transparent !important;
    stroke: rgba(102, 126, 234, 1) !important;
}

/* Override plugin hover styles with specific red color */
.fpd-add-to-cart-section .qwfw-add-to-wishlist:hover .qwfw-m-icon svg,
.fpd-add-to-cart-section .qwfw-add-to-wishlist:hover .qwfw-m-icon svg *,
.fpd-add-to-cart-section .qwfw-add-to-wishlist:hover .qwfw-shortcode .qwfw-m-icon svg,
.fpd-add-to-cart-section .qwfw-add-to-wishlist:hover .qwfw-shortcode .qwfw-m-icon svg * {
    fill: #ec274f !important;
    stroke: none !important;
    stroke-width: 0 !important;
    color: transparent !important; /* Override any color variables */
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist.qwfw--added .qwfw-m-icon svg {
    fill: #ffffff !important;
    stroke: none !important;
}

.fpd-add-to-cart-section .qwfw-add-to-wishlist:disabled .qwfw-m-icon svg,
.fpd-add-to-cart-section .qwfw-add-to-wishlist:disabled .qwfw-m-icon svg * {
    opacity: 0.5;
    stroke: rgba(102, 126, 234, 0.5) !important;
    stroke-width: 2px !important;
    fill: transparent !important;
    stroke-width: 2px !important;
}

/* White circular background behind wishlist icon to match design */
.fpd-add-to-cart-section .qwfw-add-to-wishlist .qwfw-m-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

/* Create Product Button Styling - SAMURAI MATCH: Exact copy of Wishlist button styling */
.fpd-add-to-cart-section .fpd-create-product-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    background: #ffffff;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative; /* enable centered white icon background */
}

/* White circular background behind create product icon to match wishlist */
.fpd-add-to-cart-section .fpd-create-product-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px !important;
    height: 32px !important;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.fpd-add-to-cart-section .fpd-create-product-button:hover:not(:disabled) {
    background: #ffffff;
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

.fpd-add-to-cart-section .fpd-create-product-button.fpd-create-product-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.fpd-add-to-cart-section .fpd-create-product-button:disabled {
    background: #ffffff;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.fpd-add-to-cart-section .fpd-create-product-button:disabled i {
    opacity: 0.5;
    -webkit-text-stroke: 1px rgba(102, 126, 234, 0.5);
}

.fpd-add-to-cart-section .fpd-create-product-button i {
    font-size: 20px;
    line-height: 1;
    position: relative; /* above the white circle */
    z-index: 1;
    color: transparent; /* outlined state by default */
    -webkit-text-stroke: 2px rgba(102, 126, 234, 1);
    transition: color 0.2s ease-out, -webkit-text-stroke 0.2s ease-out;
    overflow: visible;
    display: block;
}

/* Fill icon on hover to mirror wishlist behavior */
.fpd-add-to-cart-section .fpd-create-product-button:hover i {
    color: #000000;
    -webkit-text-stroke: 0;
}

/* Keep icon filled when active (after creation flow), matching wishlist added state */
.fpd-add-to-cart-section .fpd-create-product-button.fpd-create-product-active i {
    color: #ffffff;
    -webkit-text-stroke: 0;
}

/* Create Product Popup Styling */
.fpd-create-product-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.fpd-create-product-popup {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fpd-popup-header {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    color: white;
    padding: 20px 24px;
    position: relative;
}

.fpd-popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.fpd-popup-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.fpd-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fpd-popup-content {
    padding: 24px;
}

.fpd-popup-content p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #333;
    white-space: pre-line;
}

.fpd-popup-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d97706;
    font-weight: 500;
}

.fpd-popup-warning i {
    font-size: 18px;
    color: #f59e0b;
}

.fpd-popup-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.fpd-popup-cancel,
.fpd-popup-confirm {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.fpd-popup-cancel {
    background: #f3f4f6;
    color: #374151;
}

.fpd-popup-cancel:hover {
    background: #e5e7eb;
}

.fpd-popup-confirm {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    color: white;
}

.fpd-popup-confirm:hover {
    background: linear-gradient(135deg, #e67c00 0%, #e55a2b 100%);
    transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fpd-create-product-popup {
        width: 95%;
        margin: 20px;
    }
    
    .fpd-popup-actions {
        flex-direction: column;
    }
    
    .fpd-popup-cancel,
    .fpd-popup-confirm {
        width: 100%;
        text-align: center;
    }
}

/* Locked Product Styling */
.fpd-locked-product-notice {
    background: linear-gradient(135deg, #fff8f0 0%, #fff2e6 100%);
    border: 2px solid rgba(255, 140, 0, 0.2);
    border-radius: 16px;
    padding: 32px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.1);
}

.locked-notice-content i {
    font-size: 48px;
    color: #ff8c00;
    margin-bottom: 16px;
    display: block;
}

.locked-notice-content h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.locked-notice-content p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.locked-product-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.locked-product-info .product-type {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpd-product-card.locked {
    position: relative;
    opacity: 0.8;
}

.fpd-product-card.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.product-locked-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

/* Keep the selection status centered below the buttons */
.fpd-add-to-cart-section .fpd-selection-status {
    text-align: center;
    width: 100%;
}

/* Add to Cart button styling handled by the specific selector above */

/* Ensure the container itself also compacts to the icon size */
.fpd-add-to-cart-section .fpd-buttons-grid .fpd-add-to-cart-container {
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.fpd-selection-status {
    margin-top: 12px;
    padding: 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    border-radius: 0;
    display: inline-block;
    min-width: 200px;
    transition: all 0.3s ease;
}

.fpd-selection-status.error {
    background: none;
    border: none;
    color: #d32f2f;
}

.fpd-selection-status.success {
    background: none;
    border: none;
    color: #2e7d32;
}

/* ========================================
   LOADING STATES
======================================== */

.fpd-loading {
    position: relative;
    overflow: hidden;
}

.fpd-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: fpd-shimmer 1.5s infinite;
}

@keyframes fpd-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 768px) {
    .fpd-product-details-container {
        margin: 15px 0 20px 0;
        padding: 20px;
        border-radius: 12px;
    }
    
    .fpd-product-details-header h3 {
        font-size: 20px;
    }
    
    .fpd-size-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .fpd-color-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .fpd-bulk-order-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    /* ⚔️ SAMURAI GRID REWORK: Mobile responsive for 3×1 grid */
    .fpd-add-to-cart-section .fpd-buttons-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 100%;
        margin-top: 20px;
    }
    
    .fpd-add-to-cart-section .fpd-buttons-grid > * {
        max-width: 100% !important;
        min-width: 200px !important;
    }
    
    .fpd-price-section .price {
        font-size: 20px !important;
    }
    
    .fpd-price-section .price .woocommerce-Price-amount {
        font-size: 20px !important;
    }
    
    .fpd-add-to-cart-section .fpd-buttons-grid .fpd-add-to-cart-container .fpd-add-to-cart-button {
        width: 100% !important;
        padding: 14px 24px !important;
        font-size: 15px !important;
        min-width: 200px !important;
    }
}

/* ⚔️ SAMURAI GRID REWORK: Tablet responsive (2×2 grid for better balance) */
@media (max-width: 1024px) and (min-width: 769px) {
    .fpd-add-to-cart-section .fpd-buttons-grid {
        max-width: 600px;
        gap: 18px;
    }
    
    .fpd-add-to-cart-section .fpd-buttons-grid > * {
        max-width: 180px !important;
    }
}

@media (max-width: 480px) {
    .fpd-size-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fpd-color-buttons {
        grid-template-columns: 1fr;
    }
    
    .fpd-product-details-container {
        padding: 16px;
        margin: 10px 0 15px 0;
    }
}

/* -----------------------------------------------------
   DIY Mobile: eliminate ghost/duplicate empty containers
   Root cause: plugin CSS enforces min-height and margins
   on .fpd-product-designer-wrapper and .d2-enhanced-container
   even when they are empty on mobile, rendering a blank box.
   ----------------------------------------------------- */
@media (max-width: 768px) {
    /* Remove enforced minimum height to avoid blank rounded box */
    .single-product .fpd-product-designer-wrapper {
        min-height: 0 !important;
    }

    /* Hide any FPD wrapper that has no meaningful child content */
    .single-product .fpd-product-designer-wrapper:empty,
    .single-product .fpd-product-designer-wrapper:not(:has(.fpd-container, #fancy-product-designer, .fpd-main-wrapper)) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* Also hide empty Designer-2 containers (generator) when they end up empty */
    .single-product .d2-enhanced-container:empty,
    .single-product .d2-enhanced-container:not(:has(*)) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}

/* ========================================
   HIDE WOOCOMMERCE ELEMENTS
======================================== */

.fpd-product-details-active .product_meta,
.fpd-product-details-active .posted_in,
.fpd-product-details-active .tagged_in,
.fpd-product-details-active .woocommerce-product-details__short-description + .quantity {
    display: none !important;
}

.fpd-product-details-active .single_add_to_cart_button {
    display: none !important;
}

/* Show our custom add to cart instead */
.fpd-product-details-active .fpd-add-to-cart-section {
    display: block;
}

/* ========================================
   PRICE DISPLAY FIXES
======================================== */

/* ⚔️ SAMURAI ZERO PRICE FIX: Style price placeholder */
.fpd-dynamic-price-placeholder {
    color: #888 !important;
    font-style: italic;
    font-size: 0.9em;
}

/* Ensure price section is always visible */
.fpd-price-section .price {
    display: inline-block !important;
    visibility: visible !important;
    min-height: 24px;
}

/* Price update animation */
.fpd-price-updated {
    animation: fpd-priceUpdate 0.3s ease-in-out;
}

@keyframes fpd-priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #667eea; }
    100% { transform: scale(1); }
}

/* ⚔️ SAMURAI ANTI-FLICKER: Price calculating state */
.fpd-price-calculating {
    color: #888 !important;
    font-style: italic;
    animation: fpd-priceCalculating 1.5s infinite;
}

@keyframes fpd-priceCalculating {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========================================
   ANIMATIONS & INTERACTIONS
======================================== */

.fpd-fade-in {
    animation: fpd-fadeIn 0.5s ease-in-out;
}

@keyframes fpd-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fpd-pulse {
    animation: fpd-pulse 1s infinite;
}

@keyframes fpd-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
} 

/* ========================================
   DIY GENERATOR: NOTICE TWEAKS
   Hide the close (X) button only for success notice
   to keep the confirmation clean after generation
======================================== */
#openai-generator-feedback .d2-feedback.success .d2-notice-close {
	display: none !important;
}

/* ========================================
   FIRST ROW PLACEMENT (MOVED TO YOUR SELECTION)
   Match exact bulk row styling - no container styling
======================================== */

#fpd-first-row-placement { display: none !important; }

#fpd-first-row-placement {
    margin: 10px 0;
    /* No background, border, or padding - match bulk rows exactly */
}

#fpd-first-row-placement .fpd-first-row-moved {
    /* Match exact FPD bulk row styling */
    display: flex !important;
    flex-flow: row nowrap !important;
    gap: 10px !important;
    height: 40px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

#fpd-first-row-placement .fpd-first-row-moved select {
    /* Match exact FPD bulk select styling */
    flex: 1 !important;
    font-size: 16px !important;
    padding: 8px 12px !important;
    height: 100% !important;
    min-height: 40px !important;
    border: 1px solid var(--fpd-border-color, #ddd) !important;
    border-radius: 0 !important;
    background: white !important;
    /* ⚔️ SAMURAI FIX: Center text vertically in first row selects */
    display: flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

#fpd-first-row-placement .fpd-first-row-moved input[type="number"] {
    /* Match exact FPD bulk input styling */
    width: 50px !important;
    height: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    text-align: center !important;
    border: 1px solid var(--fpd-border-color, #ddd) !important;
    border-radius: 0 !important;
    background: white !important;
    font-size: 16px !important;
    padding: 8px 12px !important;
    /* ⚔️ SAMURAI FIX: Center text vertically in first row inputs */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

/* Remove custom focus styles to match bulk rows */
#fpd-first-row-placement .fpd-first-row-moved select:focus,
#fpd-first-row-placement .fpd-first-row-moved input[type="number"]:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: var(--fpd-border-color, #ddd) !important;
}

/* Remove label styling - let it inherit */
#fpd-first-row-placement .fpd-first-row-moved label {
    /* Reset to inherit bulk row styling */
    color: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    margin: inherit !important;
    min-width: inherit !important;
}

/* ⚔️ BIDIRECTIONAL SYNC: Visual feedback for product sync */
.fpd-synced {
    position: relative;
}

.fpd-synced::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    opacity: 0.15;
    border-radius: 12px;
    animation: fpd-sync-pulse 0.6s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes fpd-sync-pulse {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.15;
        transform: scale(1);
    }
}

/* ========================================
   LOCKED PRODUCT VIEWER STYLES
======================================== */

/* ⚔️ SAMURAI CONSISTENCY: Match FPD container structure exactly */
.fpd-locked-product-viewer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
    z-index: 5;
    border-radius: 16px;
    overflow: hidden;
}

/* Add the purple gradient top line like FPD container */
.fpd-locked-product-viewer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    z-index: 10;
}

/* Match FPD main bar exactly */
.fpd-locked-main-bar {
    background: white !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 10px 10px 0 10px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 75px;
    border-radius: 16px 16px 0 0;
}

.fpd-locked-navigation {
    background: transparent !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100%;
    height: 100%;
}

/* Style the badge to match FPD navigation items */
.fpd-locked-navigation .product-locked-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.25) !important;
    min-height: 40px !important;
    border: 1px solid #667eea !important;
}

/* Lower the badge by 10px for visual balance (requested) */
body.fpd-locked-product .fpd-locked-navigation .product-locked-badge {
    margin-top: 10px !important;
}

.fpd-locked-navigation .product-locked-badge i {
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

/* Canvas area that matches FPD container dimensions */
.fpd-locked-canvas-area {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 0 0 16px 16px;
    min-height: 500px;
}

.locked-product-image-container {
    position: absolute;
    /* Bring image slightly higher to balance top/bottom spacing */
    top: 47%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 90%;
    height: 90%;
    max-width: none;
    cursor: pointer;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

/* Composite thumbnails in locked viewer */
.fpd-locked-product-viewer .composite-thumbnail {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.fpd-locked-product-viewer .garment-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.fpd-locked-product-viewer .printing-area-clip {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.fpd-locked-product-viewer .design-overlay {
    position: absolute;
    transform-origin: center center;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    pointer-events: none;
    z-index: 2;
}

/* Back composite starts hidden */
.fpd-locked-product-viewer .back-composite {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Front composite is visible by default */
.fpd-locked-product-viewer .front-composite {
    position: relative;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Image protection overlay */
.fpd-locked-product-viewer .gallery-item-image-protection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Legacy badge styling (now handled in navigation) */

/* Mobile responsive */
@media (max-width: 768px) {
    .fpd-locked-canvas-area {
        min-height: 400px;
    }
    
    .locked-product-image-container {
        height: 90%;
    }
    
    .fpd-locked-navigation .product-locked-badge {
        font-size: 13px !important;
        padding: 8px 12px !important;
        gap: 6px !important;
    }
    
    .fpd-locked-main-bar {
        min-height: 60px;
        padding: 0 5px !important;
    }
}

/* ⚔️ SAMURAI FIX: Early locked product detection styles to prevent UI flash */
.fpd-locked-product-loading .fpd-create-product-container {
    display: none !important;
}

/* Ensure smooth transition when locked product view is initialized */
.fpd-locked-product-loading .fpd-product-designer-wrapper {
    opacity: 0.3;
    pointer-events: none;
}

/* Show loading state for locked products */
.fpd-locked-product-loading .fpd-product-details-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpd-locked-product-loading .fpd-product-details-container::after {
    content: 'Loading locked product...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    font-size: 16px;
    color: #333;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ======================================== 