/**
 * Xceluk Designer - Frontend Styles
 * Mobile-first responsive design
 *
 * @package Xceluk_Designer
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --xd-primary: #0073aa;
    --xd-primary-dark: #005a87;
    --xd-primary-light: #e5f0fb;
    --xd-danger: #dc3232;
    --xd-success: #46b450;
    --xd-warning: #f0ad4e;
    --xd-text: #333;
    --xd-text-light: #666;
    --xd-border: #ddd;
    --xd-bg: #f5f5f5;
    --xd-white: #fff;
    --xd-radius: 8px;
    --xd-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --xd-shadow-lg: 0 -4px 20px rgba(0, 0, 0, 0.15);
    --xd-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --xd-header-height: 56px;
    --xd-footer-height: 72px;
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

.xceluk-designer-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    color: var(--xd-text);
    background: var(--xd-bg);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */

.xd-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--xd-header-height);
    background: var(--xd-white);
    border-bottom: 1px solid var(--xd-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    gap: 12px;
}

.xd-back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--xd-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.xd-product-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xd-pricing-btn {
    background: none;
    border: 1px solid var(--xd-primary);
    color: var(--xd-primary);
    padding: 6px 12px;
    border-radius: var(--xd-radius);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.xd-pricing-btn:hover {
    background: var(--xd-primary-light);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.xd-main {
    padding-top: var(--xd-header-height);
    padding-bottom: var(--xd-footer-height);
    min-height: 100vh;
}

/* ==========================================================================
   Canvas
   ========================================================================== */

.xd-canvas-wrapper {
    padding: 12px;
}

.xd-canvas-container {
    background: var(--xd-white);
    border-radius: var(--xd-radius);
    box-shadow: var(--xd-shadow);
    overflow: hidden;
    position: relative;
}

.xd-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* View tabs */
.xd-view-tabs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.xd-view-tab {
    padding: 8px 20px;
    background: var(--xd-white);
    border: 2px solid var(--xd-border);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--xd-transition);
    color: var(--xd-text-light);
}

.xd-view-tab.active {
    background: var(--xd-primary);
    border-color: var(--xd-primary);
    color: var(--xd-white);
}

.xd-view-tab:hover:not(.active) {
    border-color: var(--xd-primary);
    color: var(--xd-primary);
}

/* ==========================================================================
   Zone Chips
   ========================================================================== */

.xd-zone-chips {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.xd-zone-chips::-webkit-scrollbar {
    display: none;
}

.xd-zone-chip {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--xd-white);
    border: 2px solid var(--xd-border);
    border-radius: var(--xd-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--xd-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.xd-zone-chip.active {
    border-color: var(--xd-primary);
    background: var(--xd-primary-light);
    color: var(--xd-primary-dark);
}

.xd-zone-chip.has-content {
    border-color: var(--xd-success);
    background: #ecfdf5;
}

.xd-zone-chip .chip-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xd-border);
}

.xd-zone-chip.has-content .chip-indicator {
    background: var(--xd-success);
}

/* ==========================================================================
   Bottom Panel
   ========================================================================== */

.xd-bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--xd-white);
    border-radius: 16px 16px 0 0;
    box-shadow: var(--xd-shadow-lg);
    transform: translateY(100%);
    transition: transform var(--xd-transition);
    z-index: 200;
    max-height: 65vh;
    display: flex;
    flex-direction: column;
}

.xd-bottom-panel.active {
    transform: translateY(0);
}

.xd-panel-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
}

.xd-handle-bar {
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}

.xd-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
    border-bottom: 1px solid var(--xd-border);
}

.xd-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.xd-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--xd-text-light);
    cursor: pointer;
    padding: 4px 8px;
}

/* Panel tabs */
.xd-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--xd-border);
    padding: 0 12px;
}

.xd-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--xd-text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.xd-tab.active {
    color: var(--xd-primary);
    border-bottom-color: var(--xd-primary);
}

/* Panel content */
.xd-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
}

.xd-tab-content {
    display: none;
}

.xd-tab-content.active {
    display: block;
}

/* ==========================================================================
   Upload Zone
   ========================================================================== */

.xd-upload-zone {
    border: 2px dashed var(--xd-border);
    border-radius: var(--xd-radius);
    padding: 24px;
    text-align: center;
    color: var(--xd-text-light);
    transition: all 0.2s;
}

.xd-upload-zone.dragover {
    border-color: var(--xd-primary);
    background: var(--xd-primary-light);
}

.xd-upload-zone svg {
    color: #ccc;
    margin-bottom: 8px;
}

.xd-upload-zone p {
    margin: 4px 0;
    font-size: 14px;
}

.xd-upload-or {
    display: block;
    margin: 8px 0;
    font-size: 12px;
    color: #999;
}

.xd-upload-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--xd-primary);
    color: var(--xd-white);
    border-radius: var(--xd-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.xd-upload-hint {
    font-size: 11px !important;
    color: #999 !important;
    margin-top: 8px !important;
}

/* Upload progress */
.xd-upload-progress {
    margin-top: 12px;
    text-align: center;
}

.xd-progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.xd-progress-fill {
    height: 100%;
    background: var(--xd-primary);
    transition: width 0.3s;
    width: 0%;
}

/* Quality warning */
.xd-quality-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--xd-radius);
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #856404;
}

/* ==========================================================================
   Logo Grid
   ========================================================================== */

.xd-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.xd-logo-item {
    aspect-ratio: 1;
    background: var(--xd-bg);
    border: 2px solid transparent;
    border-radius: var(--xd-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.xd-logo-item:hover {
    border-color: var(--xd-primary);
    transform: scale(1.05);
}

.xd-logo-item.selected {
    border-color: var(--xd-success);
    box-shadow: 0 0 0 2px rgba(70, 180, 80, 0.3);
}

.xd-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.xd-logo-item .logo-name {
    font-size: 10px;
    color: var(--xd-text-light);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search bar */
.xd-search-bar {
    margin-bottom: 12px;
}

.xd-search-bar input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--xd-border);
    border-radius: var(--xd-radius);
    font-size: 14px;
    outline: none;
}

.xd-search-bar input:focus {
    border-color: var(--xd-primary);
}

/* Login prompt */
.xd-login-prompt {
    text-align: center;
    padding: 24px;
}

.xd-login-prompt p {
    margin-bottom: 12px;
    color: var(--xd-text-light);
}

/* ==========================================================================
   Print Method Selector
   ========================================================================== */

.xd-print-method {
    padding: 12px 16px;
    border-top: 1px solid var(--xd-border);
}

.xd-print-method label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--xd-text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.xd-method-buttons {
    display: flex;
    gap: 8px;
}

.xd-method-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--xd-border);
    border-radius: var(--xd-radius);
    background: var(--xd-white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.xd-method-btn.active {
    border-color: var(--xd-primary);
    background: var(--xd-primary-light);
    color: var(--xd-primary-dark);
}

.xd-method-btn .method-price {
    display: block;
    font-size: 11px;
    color: var(--xd-text-light);
    margin-top: 2px;
}

/* Zone actions */
.xd-zone-actions {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--xd-border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.xd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--xd-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.xd-btn-primary:hover:not(:disabled) {
    background: var(--xd-primary-dark);
}

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

.xd-btn-outline {
    background: transparent;
    border: 2px solid var(--xd-primary);
    color: var(--xd-primary);
}

.xd-btn-danger {
    background: transparent;
    border: 1px solid var(--xd-danger);
    color: var(--xd-danger);
    font-size: 13px;
    padding: 8px 16px;
}

.xd-btn-danger:hover {
    background: #fef2f2;
}

/* ==========================================================================
   Footer Summary
   ========================================================================== */

.xd-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--xd-footer-height);
    background: var(--xd-white);
    border-top: 1px solid var(--xd-border);
    z-index: 150;
    padding: 0 16px;
    display: flex;
    align-items: center;
}

.xd-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.xd-summary-info {
    display: flex;
    flex-direction: column;
}

.xd-positions-count {
    font-size: 13px;
    color: var(--xd-text-light);
}

.xd-price-per-item {
    font-size: 16px;
    font-weight: 700;
    color: var(--xd-text);
}

.xd-add-to-cart {
    padding: 14px 32px;
    font-size: 16px;
}

/* ==========================================================================
   Pricing Modal
   ========================================================================== */

.xd-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.xd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.xd-modal-content {
    position: relative;
    background: var(--xd-white);
    border-radius: var(--xd-radius);
    box-shadow: var(--xd-shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
}

.xd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--xd-border);
}

.xd-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.xd-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--xd-text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.xd-modal-body {
    padding: 20px;
}

/* Pricing table */
.xd-pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.xd-pricing-table th {
    background: var(--xd-bg);
    padding: 10px 12px;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--xd-text-light);
    border-bottom: 2px solid var(--xd-border);
}

.xd-pricing-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.xd-pricing-table tr:last-child td {
    border-bottom: none;
}

.xd-pricing-table .qty-col {
    text-align: left;
    font-weight: 600;
}

/* ==========================================================================
   Product Page Button
   ========================================================================== */

.xd-product-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--xd-primary);
    color: var(--xd-white);
    border: none;
    border-radius: var(--xd-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.xd-product-customize-btn:hover {
    background: var(--xd-primary-dark);
    color: var(--xd-white);
}

.xd-product-pricing-link {
    display: inline-block;
    margin-left: 12px;
    font-size: 13px;
    color: var(--xd-primary);
    cursor: pointer;
}

/* Session logos heading */
.xd-session-logos h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--xd-text-light);
    margin: 16px 0 8px;
}

/* Loading state */
.xd-loading {
    text-align: center;
    color: var(--xd-text-light);
    padding: 20px;
}

/* ==========================================================================
   Desktop (768px+)
   ========================================================================== */

@media (min-width: 768px) {
    .xd-main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .xd-canvas-wrapper {
        max-width: 700px;
        width: 100%;
    }

    .xd-zone-chips {
        justify-content: center;
        max-width: 700px;
        margin: 0 auto;
    }

    .xd-bottom-panel {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        max-width: 500px;
        border-radius: 16px 16px 0 0;
    }

    .xd-bottom-panel.active {
        transform: translateX(-50%) translateY(0);
    }

    .xd-logo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ==========================================================================
   Large Desktop (1200px+)
   ========================================================================== */

@media (min-width: 1200px) {
    .xd-canvas-wrapper {
        max-width: 800px;
    }

    .xd-bottom-panel {
        max-width: 550px;
    }
}

/* ==========================================================================
   Free Delivery Bar (Cart)
   ========================================================================== */

.xd-delivery-bar {
    background: var(--xd-white);
    border: 1px solid var(--xd-border);
    border-radius: var(--xd-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.xd-delivery-bar p {
    margin: 0 0 8px;
    font-size: 14px;
}

.xd-delivery-bar strong {
    color: var(--xd-primary);
}

.xd-delivery-bar.qualified {
    border-color: var(--xd-success);
    background: #ecfdf5;
}

.xd-delivery-bar.qualified strong {
    color: var(--xd-success);
}

.xd-delivery-track {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.xd-delivery-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--xd-primary), var(--xd-success));
    border-radius: 4px;
    transition: width var(--xd-transition);
}

/* ==========================================================================
   Cart Design Display
   ========================================================================== */

.xd-cart-design-card {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafb;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.xd-cart-design-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
}

.xd-cart-design-header svg {
    flex-shrink: 0;
}

.xd-cart-thumbs {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.xd-cart-thumb-item {
    text-align: center;
}

.xd-cart-thumb-img {
    width: 72px;
    height: 72px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.xd-cart-thumb-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.xd-cart-thumb-label {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}

/* Position badges inline with thumbnail labels */
.xd-cart-thumb-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}

.xd-cart-pos-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 3px;
    background: #e0f2fe;
    color: #0369a1;
}

.xd-cart-pos-badge--embroidery {
    background: #fce7f3;
    color: #be185d;
}

/* Position rows */
.xd-cart-pos-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.xd-cart-pos-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.xd-cart-pos-size {
    font-size: 11px;
    color: #64748b;
}

.xd-cart-surcharge {
    font-size: 12px;
    color: #475569;
    padding: 6px 0 4px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}

.xd-cart-surcharge strong {
    color: #0f172a;
}

/* Edit Design button - high specificity for Xceluk theme */
.xceluk-cart-card__info .xd-cart-edit-btn,
.woocommerce-cart-form .xd-cart-edit-btn,
.mini-cart-dropdown .xd-cart-edit-btn,
a.xd-cart-edit-btn,
.xd-cart-edit-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-top: 6px !important;
    padding: 6px 14px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: #0073aa !important;
    border: none !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    line-height: 1.4 !important;
    letter-spacing: 0.02em !important;
}

.woocommerce-cart-form td.product-name .xd-cart-edit-btn:hover,
td.product-name a.xd-cart-edit-btn:hover,
a.xd-cart-edit-btn:hover,
.xd-cart-edit-btn:hover {
    background: #005a87 !important;
    color: #fff !important;
    text-decoration: none !important;
}

.woocommerce-cart-form td.product-name .xd-cart-edit-btn:visited,
td.product-name a.xd-cart-edit-btn:visited,
a.xd-cart-edit-btn:visited,
.xd-cart-edit-btn:visited {
    color: #fff !important;
}

.xd-cart-edit-btn svg {
    opacity: 0.85;
    fill: currentColor !important;
}

/* Mobile: card design improvements */
@media (max-width: 767px) {
    .xd-cart-design-card {
        padding: 10px;
        margin-top: 10px;
        border-radius: 8px;
    }

    /* Thumbnails: 64px for readability */
    .xd-cart-thumb-img {
        width: 64px;
        height: 64px;
    }

    .xd-cart-thumbs {
        gap: 10px;
    }

    /* Edit Design button: full-width mobile touch target */
    .xd-cart-edit-btn,
    a.xd-cart-edit-btn,
    .xceluk-cart-card__info .xd-cart-edit-btn {
        padding: 10px 18px !important;
        font-size: 12px !important;
        min-height: 44px !important;
        border-radius: 8px !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .xd-cart-edit-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Surcharge text */
    .xd-cart-surcharge {
        font-size: 13px;
        padding: 8px 0 6px;
    }

    /* Position badges - larger for mobile readability */
    .xd-cart-pos-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Very small screens */
@media (max-width: 374px) {
    .xd-cart-thumb-img {
        width: 56px;
        height: 56px;
    }
}

/* ==========================================================================
   Cart Page Layout - Whitespace Reduction & Column Widths (Flatsome)
   ========================================================================== */

/* Hide "Home > Cart" breadcrumb on cart page - redundant with Cart heading */
.woocommerce-cart nav.breadcrumbs,
.woocommerce-cart .breadcrumbs,
.woocommerce-cart .woocommerce-breadcrumb,
.woocommerce-cart nav[aria-label="Breadcrumb"],
.woocommerce-cart .breadcrumb-row,
.woocommerce-cart .page-title-inner .breadcrumbs {
    display: none !important;
}

/* Reduce the "Cart" page heading margin */
.woocommerce-cart .entry__header,
.woocommerce-cart header.entry__header {
    margin-bottom: 0.25rem !important;
}

.woocommerce-cart .entry-title {
    margin-bottom: 0.25rem !important;
    font-size: 1.4em !important;
}

/* Tighten the checkout progress breadcrumb ("Cart / Checkout / Confirmation") */
.woocommerce-cart .checkout-progress,
.woocommerce-cart .checkout-page-title {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

/* Bigger breadcrumb text */
.checkout-breadcrumbs {
    font-size: 15px !important;
}

.checkout-breadcrumbs a,
.checkout-breadcrumbs .current {
    font-size: 15px !important;
}

/* Remove excess spacing around the cart content */
.woocommerce-cart .entry_content,
.woocommerce-cart .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.woocommerce-cart .woocommerce {
    margin-top: 0 !important;
}

.woocommerce-cart .row-large {
    margin-top: 0 !important;
}

.woocommerce-cart table.shop_table {
    margin-top: 0 !important;
}

/* --- Cart table column widths --- */
/* Narrow the remove (×) column */
.woocommerce-cart table.shop_table .product-remove {
    width: 30px !important;
    min-width: 30px !important;
    padding: 8px 4px !important;
}

/* Widen the product thumbnail column */
.woocommerce-cart table.shop_table .product-thumbnail {
    width: 90px !important;
    min-width: 90px !important;
    padding: 8px !important;
}

.woocommerce-cart table.shop_table .product-thumbnail img {
    width: 80px !important;
    max-width: 80px !important;
}

/* Give product name more room */
.woocommerce-cart table.shop_table .product-name {
    padding: 8px 12px !important;
}

/* ==========================================================================
   Bundle Product Page - Wider Quantity Input
   ========================================================================== */

#bundle_quantity,
.bundle-package-form input[name="quantity"],
.wc-bundle-package-form input[name="quantity"] {
    width: 105px !important;
    min-width: 105px !important;
}

/* ==========================================================================
   Text Tool Panel
   ========================================================================== */

.xd-text-tool {
    padding: 4px 0;
}

.xd-text-input-wrap {
    margin-bottom: 12px;
}

.xd-text-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--xd-border);
    border-radius: var(--xd-radius);
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.xd-text-input:focus {
    border-color: var(--xd-primary);
}

.xd-text-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.xd-text-field {
    flex: 1;
}

.xd-text-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--xd-text-light);
    margin-bottom: 4px;
}

.xd-font-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--xd-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--xd-white);
    cursor: pointer;
}

.xd-text-font-field {
    flex: 2;
}

.xd-text-size-field {
    flex: 0 0 auto;
    min-width: 100px;
}

.xd-size-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--xd-border);
    border-radius: 6px;
    overflow: hidden;
}

.xd-size-btn {
    width: 32px;
    height: 32px;
    background: var(--xd-bg);
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--xd-text);
    line-height: 1;
}

.xd-size-btn:hover {
    background: var(--xd-primary-light);
    color: var(--xd-primary);
}

.xd-size-controls span {
    font-size: 14px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.xd-text-color-field {
    flex: 0 0 auto;
}

.xd-color-input {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--xd-border);
    border-radius: 6px;
    cursor: pointer;
    background: var(--xd-white);
}

/* Style buttons */
.xd-text-styles {
    gap: 8px;
}

.xd-style-btn {
    padding: 8px 14px;
    border: 2px solid var(--xd-border);
    border-radius: 6px;
    background: var(--xd-white);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    color: var(--xd-text);
}

.xd-style-btn:hover {
    border-color: var(--xd-primary);
    color: var(--xd-primary);
}

.xd-style-btn.active {
    border-color: var(--xd-primary);
    background: var(--xd-primary-light);
    color: var(--xd-primary-dark);
}

/* Curve controls */
.xd-curve-controls {
    align-items: center;
    gap: 8px;
}

.xd-curve-controls label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--xd-text-light);
    white-space: nowrap;
}

.xd-range-input {
    flex: 1;
    height: 4px;
    accent-color: var(--xd-primary);
}

.xd-curve-controls span {
    font-size: 12px;
    color: var(--xd-text-light);
    min-width: 30px;
    text-align: right;
}

/* Text preview */
.xd-text-preview {
    background: var(--xd-bg);
    border: 1px solid var(--xd-border);
    border-radius: var(--xd-radius);
    padding: 16px;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.xd-text-preview span {
    max-width: 100%;
    word-break: break-word;
}

/* Add text button */
.xd-text-add-btn {
    width: 100%;
    padding: 12px;
}

/* Logo item name (shown below thumbnail) */
.xd-logo-item-name {
    display: block;
    font-size: 10px;
    color: var(--xd-text-light);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Dragover state for upload */
.xd-upload-zone.xd-dragover {
    border-color: var(--xd-primary);
    background: var(--xd-primary-light);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

/* Focus visible styles for keyboard navigation */
.xceluk-designer-page *:focus-visible {
    outline: 2px solid var(--xd-primary);
    outline-offset: 2px;
}

.xd-zone-chip:focus-visible {
    outline: 3px solid var(--xd-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.2);
}

.xd-view-tab:focus-visible {
    outline: 3px solid var(--xd-primary);
    outline-offset: 2px;
}

.xd-tab:focus-visible {
    outline: 2px solid var(--xd-primary);
    outline-offset: -2px;
}

.xd-method-btn:focus-visible {
    outline: 3px solid var(--xd-primary);
    outline-offset: 2px;
}

.xd-logo-item:focus-visible {
    outline: 3px solid var(--xd-primary);
    outline-offset: 2px;
    transform: scale(1.05);
}

.xd-btn:focus-visible {
    outline: 3px solid var(--xd-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.25);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .xd-bottom-panel,
    .xd-view-tab,
    .xd-zone-chip,
    .xd-method-btn,
    .xd-logo-item,
    .xd-btn,
    .xd-progress-fill,
    .xd-delivery-fill {
        transition: none !important;
    }

    .xd-logo-item:hover {
        transform: none;
    }
}

/* ==========================================================================
   Touch Optimisations
   ========================================================================== */

/* Prevent accidental zooming on double-tap */
.xceluk-designer-page {
    touch-action: manipulation;
}

/* Canvas container needs pan/zoom for pinch */
.xd-canvas-container {
    touch-action: none;
}

/* Ensure tap targets are at least 44px (WCAG 2.5.5) */
.xd-zone-chip {
    min-height: 44px;
}

.xd-tab {
    min-height: 44px;
}

.xd-method-btn {
    min-height: 44px;
}

.xd-panel-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xd-modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Panel handle area - larger hit area for swipe */
.xd-panel-handle {
    min-height: 28px;
    touch-action: none;
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (forced-colors: active) {
    .xd-zone-chip.has-content .chip-indicator {
        background: Highlight;
    }

    .xd-zone-chip.active {
        border-color: Highlight;
    }

    .xd-btn-primary {
        border: 2px solid ButtonText;
    }

    .xd-progress-fill {
        background: Highlight;
    }
}
