/**
 * Jewelry Configurator v2 - Main Styles
 */

:root {
    --primary-color: #c38161;
    --primary-dark: #a0664a;
    --primary-light: #d4a088;
    --secondary-color: #f5ebe4;
    --text-color: #5a3d35;
    --text-light: #8c6b5d;
    --border-color: #e8ddd6;
    --border-light: #f0e6df;
    --error-color: #c44536;
    --success-color: #5a8f5c;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --gold-accent: #ba7a5b;
    --gold-light: #f8f2ed;
    --rose-gold: #b76e50;
    --champagne: #f7e7ce;
    --pearl: #fdfbf7;
    --velvet: #2d1810;
    --shadow-soft: 0 2px 12px rgba(90, 61, 53, 0.08);
    --shadow-medium: 0 4px 20px rgba(90, 61, 53, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

/* ===== MOBILE TOUCH IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Ensure all clickable elements have proper touch targets */
    .jewelry-configurator button,
    .jewelry-configurator a,
    .jewelry-configurator [onclick],
    .jewelry-configurator .charm-card,
    .jewelry-configurator .material-option,
    .jewelry-configurator .weave-card,
    .configurator-footer button,
    .configurator-footer a,
    .jewelry-configurator .selected-charm-item,
    .jewelry-configurator .remove-charm,
    .jewelry-configurator .btn-primary,
    .jewelry-configurator .btn-secondary,
    .charm-details-overlay button {
        -webkit-tap-highlight-color: rgba(195, 129, 97, 0.3);
        touch-action: manipulation;
        cursor: pointer;
        pointer-events: auto !important;
        position: relative;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .jewelry-configurator .charm-slot {
        -webkit-tap-highlight-color: rgba(195, 129, 97, 0.3);
        touch-action: manipulation;
        cursor: pointer;
        pointer-events: auto !important;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .jewelry-configurator button,
    .jewelry-configurator .btn-primary,
    .jewelry-configurator .btn-secondary,
    .configurator-footer button,
    .charm-details-overlay button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .jewelry-configurator .charm-slot {
        min-width: 36px;
        min-height: 36px;
    }
    
    .jewelry-configurator .remove-charm {
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure containers don't block clicks */
    .material-selection,
    .material-options,
    .weaves-selection,
    .weaves-grid,
    .charms-section,
    .charms-list,
    .step-container,
    .configurator-content,
    .configurator-preview-panel,
    .configurator-main {
        pointer-events: auto !important;
    }
    
    /* Prevent double-tap zoom on interactive elements */
    .jewelry-configurator {
        touch-action: pan-x pan-y;
    }
    
    /* Prevent text selection on cards when tapping */
    .charm-card,
    .weave-card,
    .material-option {
        -webkit-user-select: none;
        user-select: none;
    }
}

body.jewelry-configurator-page {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #fdfbf7 0%, #f8f2ed 50%, #faf6f2 100%);
    font-family: var(--font-body);
    position: relative;
    color: var(--text-color);
    min-height: 100vh;
    /* Ensure body doesn't block interactions */
    pointer-events: auto;
}

body.jewelry-configurator-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L35 25L55 30L35 35L30 55L25 35L5 30L25 25L30 5Z' fill='%23c38161' fill-opacity='0.02'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 20% 20%, rgba(195, 129, 97, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 80%, rgba(186, 122, 91, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.jewelry-configurator {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding-bottom: 100px; /* Space for fixed footer */
}

/* ===== PRELOADER ===== */
.jewelry-configurator-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fdfbf7 0%, #f8f2ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.jewelry-configurator-preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.jewelry-configurator-preloader-content {
    text-align: center;
}

.jewelry-configurator-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 25px;
}

.jewelry-configurator-spinner::before {
    content: '💎';
    font-size: 28px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-gem 1.5s ease-in-out infinite;
}

.jewelry-configurator-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-gem {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

.jewelry-configurator-preloader-text {
    color: var(--text-color);
    font-size: 15px;
    font-family: var(--font-family);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.price-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== PROGRESS ===== */
.configurator-progress {
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.progress-steps {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    position: relative;
    transition: transform 0.2s ease;
}


.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.progress-step.active .step-number {
    border-color: var(--primary-color);
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--rose-gold) 100%);
    box-shadow: 0 4px 15px rgba(195, 129, 97, 0.35);
}

.progress-step.completed .step-number {
    border-color: var(--success-color);
    color: white;
    background: var(--success-color);
}

.progress-step.completed .step-number::after {
    content: '✓';
    font-size: 18px;
}

.step-label {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    max-width: 80px;
}

.progress-step.active .step-label {
    color: var(--text-color);
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 15px 30px;
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-accent));
    transition: width 0.4s ease;
}

/* ===== MAIN CONTENT ===== */
.configurator-main {
    flex: 1;
    display: flex;
    gap: 25px;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Hide mobile text on desktop */
.btn-text-mobile {
    display: none;
}

/* Hide mobile step title on desktop */
.mobile-step-title {
    display: none;
}

/* ===== PREVIEW PANEL (Left Column) ===== */
.configurator-preview-panel {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: 120px;
    height: fit-content;
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
}

/* ===== SELECTED CHARMS PANEL (Middle Column) ===== */
.selected-charms-preview {
    flex: 0 0 20%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    padding: 18px;
    border-radius: var(--radius-lg);
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
}

.selected-charms-preview h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font-family);
}

.selected-charms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-charm-item {
    background: var(--gold-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selected-charm-item:hover {
    border-color: #c38161;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.selected-charm-item.highlighted {
    border-color: #c38161;
    transform: scale(1.02);
    border: 2px solid #c38161;
}

.selected-charm-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.selected-charm-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: transparent;
}

.selected-charm-metadata {
    display: flex;
    flex-direction: column;
    line-height: 20px;
}

.selected-charm-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.selected-charm-position {
    font-size: 11px;
    color: #666;
}

.selected-charm-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.remove-charm {
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.remove-charm:hover {
    color: var(--error-color);
}

/* ===== CONTENT PANEL (Right Column) ===== */
.configurator-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 1024px) {
    .configurator-main {
        flex-wrap: wrap;
    }

    .configurator-preview-panel {
        flex: 0 0 40%;
    }

    .selected-charms-preview {
        flex: 0 0 55%;
        order: 2;
    }

    .configurator-content {
        flex: 0 0 100%;
        order: 3;
    }
}

@media (max-width: 768px) {
    .configurator-main {
        flex-direction: column;
        gap: 15px;
    }

    .configurator-preview-panel,
    .selected-charms-preview,
    .configurator-content {
        flex: 0 0 100%;
        position: static !important;
        width: 100%;
        z-index: auto;
    }
    
    .configurator-preview-panel {
        top: auto;
    }
    
    .selected-charms-preview {
        top: auto;
    }

    .preview-wrapper {
        max-width: 280px;
        aspect-ratio: 3/4;
    }
    
    /* Charm slots na mobile - tylko mniejszy rozmiar, pozycje z JS */
    .preview-wrapper .charm-slot {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .preview-wrapper .charm-slot .charm-image {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }
    
    .preview-wrapper .charm-slot .slot-number {
        font-size: 10px;
        width: 16px;
        height: 16px;
    }

    .preview-info {
        padding: 12px;
    }

    .step-container h2 {
        font-size: 24px;
        margin-bottom: 15px;
        display: none;
        /* Hide on mobile */
    }

    /* Mobile step title at top of configurator-main */
    .mobile-step-title {
        display: block !important;
        order: -1;
        width: 100%;
        font-size: 23px;
        margin: 0 0 15px 0;
        padding: 0;
        color: var(--text-color);
        font-weight: 600;
        font-family: Raleway, sans-serif !important;
        text-align: left;
    }

    .selected-charms-preview {
        max-height: 300px;
    }
}

/* ===== PREVIEW ELEMENTS ===== */
.preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #fdfbf7 0%, #f5f0eb 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid var(--border-light);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: var(--radius-md);
}

.preview-image[src]:not([src=""]) {
    display: block !important;
}

.slots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.charm-slot {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.25s ease;
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(90, 61, 53, 0.15);
    z-index: 10;
    pointer-events: auto;
    overflow: visible;
}

.charm-slot:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 11;
}

.charm-slot.selected {
    background: white;
    color: #c38161;
    border-color: #c38161;
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 12;
    animation: pulse-selected 1.5s infinite;
}

@keyframes pulse-selected {
    0% {
        box-shadow: 0 0 0 3px rgba(195, 129, 97, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(195, 129, 97, 0.2);
    }

    100% {
        box-shadow: 0 0 0 3px rgba(195, 129, 97, 0.4);
    }
}

.charm-slot.highlighted {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 15;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 4px 12px rgba(212, 175, 55, 0.4);
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.2);
    }

    100% {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
    }
}

.slot-number {
    position: absolute;
    background: #c38161;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    border: 1px solid #fcf8f4;
}

.slot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--success-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.preview-info {
    background: #FFF;
    padding: 18px;
    border-radius: 8px;

}

.preview-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

#product-name {
    font-weight: 700;
    color: #000;
    margin: 0 0 8px 0 !important;
    font-size: 16px;
    letter-spacing: 0.3px;
}

#product-description {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== CONTENT ELEMENTS ===== */
.configurator-error {
    background: #fee;
    color: var(--error-color);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--error-color);
}

/* ===== STEPS ===== */
.step-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-container.active {
    display: block;
}

.step-container.full-width {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
}

/* Summary step layout - keep preview panel visible */
.configurator-main.summary-active .configurator-preview-panel {
    flex: 0 0 30%;
}

.configurator-main.summary-active .configurator-content {
    flex: 1 1 calc(70% - 30px);
    min-width: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.step-container h2 {
    margin: 0 0 20px;
    font-size: 26px;
    color: var(--text-color);
    font-weight: 600;
    font-family: var(--font-family);
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 12px;
}

.step-container h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-accent));
    border-radius: 2px;
}

.step-instruction {
    color: var(--text-light);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ===== INSTRUCTION BOX ===== */
.step-instruction-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--gold-light) 0%, white 100%);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
}

.step-instruction-box .instruction-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.step-instruction-box .step-instruction {
    margin: 0;
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
}

/* ===== CHARMS PRELOADER ===== */
.charms-preloader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    grid-column: 1 / -1;
    color: #888;
    font-size: 14px;
}

.charms-preloader .preloader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e0d5cc;
    border-top-color: #ba7a5b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== MATERIAL SELECTION ===== */
.material-selection {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.material-description {
    color: #666;
    margin: 0;
}

.material-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
}

@media (max-width: 600px) {
    .material-options {
        gap: 12px;
        margin: 0;
    }
}

.material-option {
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    background: #FFF;
    position: relative;
    overflow: hidden;
    border: 3px solid #ddd;
    flex: 1;
}

@media (max-width: 768px) {
    .material-option {
        padding: 20px 15px;
        gap: 12px;
    }

    .material-option h3 {
        font-size: 16px;
    }
}

.material-option:hover {
    border-color: var(--primary-color);
}

.material-option.selected {
    border-color: var(--primary-color);
}

.material-preview {
    width: 100%;
    height: 80px;
    border-radius: 4px;
    order: -1;
}

.material-option h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

/* ===== CHARMS SECTION ===== */
.charms-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Hide charms section on mobile - shown only in popup */
@media (max-width: 768px) {
    .charms-section {
        display: none !important;
    }
}

.charms-filters {
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: end;
}

.category-dropdown-wrapper,
.search-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-dropdown-wrapper {
    flex: 0 0 200px;
}

.search-wrapper {
    flex: 1;
}

.category-select,
.charm-search {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.category-select:focus,
.charm-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

@media (max-width: 768px) {
    .charms-section {
        grid-template-columns: 1fr;
    }
}

.charms-filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.charms-filters h3 {
    margin: 0;
    font-size: 16px;
}

.categories-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-filter-btn {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: all 0.3s ease;
}

.category-filter-btn:hover {
    border-color: var(--primary-color);
}

.category-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.charms-gallery {
    display: flex;
    flex-direction: column;
}

.charms-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .charms-list {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px;
    }

    .charms-gallery-layout .charm-image {
        height: 90px;
    }

    .charms-gallery-layout .charm-info,
    .charm-card .charm-info {
        display: none;
    }

    .filter-row {
        flex-wrap: wrap;
    }

    .filter-row .category-dropdown-wrapper,
    .filter-row .search-wrapper {
        flex: 1 1 100%;
    }

    .configurator-progress {
        padding: 10px 0;
    }

    .progress-steps {
        padding: 0 24px;
        gap: 25px;
        justify-content: center;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
        margin-bottom: 4px;
    }

    .step-label {
        font-size: 9px;
        max-width: 55px;
    }

    .progress-connector {
        height: 2px;
    }

    .progress-line {
        display: none;
    }

    .material-preview {
        height: 50px !important;
        width: 50px !important;
    }

    .material-option h3 {
        font-size: 14px;
    }

    .charm-card .charm-info,
    .charm-card .charm-name {
        display: none !important;
    }

    .charm-slot {
        width: 44px;
        height: 44px;
        font-size: 11px;
        border-width: 2px;
    }

    .charm-slot .slot-number {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .charm-slot .charm-image {
        width: 36px;
        height: 36px;
    }

    .charm-card .charm-image {
        height: 100px !important;
    }
}

.charms-gallery-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin: 0;
}

.charms-gallery-layout .charm-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.charms-gallery-layout .charm-image {
    width: 100%;
    height: 140px;
    border-right: none;
    padding: 40px;
}

.charms-gallery-layout .charm-info {
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.charms-gallery-layout .btn-add-charm {
    grid-column: 2;
    grid-row: 2;
    margin: 0 12px 12px;
    align-self: end;
}

.charm-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background: white;
    position: relative;
    min-height: auto;
}

.charm-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.charm-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(195, 129, 97, 0.2);
}

.charm-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: var(--gold-light);
    padding: 0;
    transition: transform 0.3s ease;
    padding: 15px;
}

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

.charm-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border-light);
}

.charm-card h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

.charm-description {
    display: none;
}

.charm-price {
    display: none;
}

.btn-add-charm {
    display: none;
}

.btn-add-charm:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #8c4040 100%);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

/* ===== SUMMARY ===== */
.summary-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== SUMMARY GRID LAYOUT ===== */
.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-left,
.summary-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== SUMMARY SECTIONS ===== */
.summary-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.summary-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
    border-bottom: 1px solid #e8e8e8;
}

.summary-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PRODUCT CARD ===== */
.summary-product-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    align-items: center;
}

.summary-product-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.summary-product-details {
    flex: 1;
    min-width: 0;
}

.summary-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    line-height: 1.3;
    word-wrap: break-word;
}

.summary-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.material-badge {
    background: linear-gradient(135deg, #fef3e2 0%, #fdecd0 100%);
    color: #b8860b;
    border: 1px solid #f0d9a0;
}

/* ===== CHARMS SECTION ===== */
.summary-charms-section .charms-list-summary {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.summary-empty-charms {
    padding: 30px 16px;
    text-align: center;
    color: #666;
}

.summary-empty-charms p {
    margin: 0 0 14px 0;
    font-size: 13px;
    color: #888;
}

.btn-small {
    padding: 8px 18px;
    font-size: 12px;
    border-radius: 6px;
    background: var(--primary-color, #c9a050);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-small:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== CHARM SUMMARY ITEMS - COMPACT ===== */
.charm-summary-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: all 0.25s ease;
}

.charm-summary-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color, #c9a050);
}

.charm-summary-img-wrapper {
    position: relative;
    flex-shrink: 0;
}

.charm-summary-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 2px;
}

.charm-position-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: var(--primary-color, #c9a050);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.charm-summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.charm-summary-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.charm-summary-meta {
    font-size: 10px;
    color: #888;
}

.charm-summary-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color, #c9a050);
}

.btn-remove-charm {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    opacity: 0;
}

.charm-summary-item:hover .btn-remove-charm {
    opacity: 1;
}

.btn-remove-charm:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===== PRICING SECTION ===== */
.summary-pricing-section {
    margin-top: 0;
}

.summary-pricing-table {
    padding: 16px;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pricing-row:last-child {
    border-bottom: none;
}

.pricing-label {
    font-size: 13px;
    color: #555;
}

.pricing-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pricing-plus {
    color: #28a745;
}

/* ===== TOTAL ===== */
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color, #c9a050) 0%, #d4aa60 100%);
    color: #fff;
}

.total-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-value {
    font-size: 22px;
    font-weight: 800;
}

/* ===== SUMMARY ACTIONS ===== */
.summary-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary-outline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-outline:hover {
    border-color: var(--primary-color, #c9a050);
    color: var(--primary-color, #c9a050);
    background: #fef9f0;
}

/* ===== RESPONSIVE SUMMARY ===== */
@media (max-width: 600px) {
    .summary-content {
        padding: 12px;
    }

    .summary-section-header {
        padding: 12px 14px;
    }

    .summary-section-header h4 {
        font-size: 12px;
    }

    .summary-product-card {
        padding: 12px;
        gap: 12px;
    }

    .summary-product-img {
        width: 60px;
        height: 60px;
    }

    .summary-product-name {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .summary-charms-section .charms-list-summary {
        padding: 12px;
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
    }

    .charm-summary-item {
        width: 100%;
    }

    .total-value {
        font-size: 20px;
    }
}

/* ===== LEGACY CLASSES - KEEP FOR COMPATIBILITY ===== */
.summary-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Legacy styles removed - now using new summary design */

/* Old breakdown styles removed - using new pricing table design */

.footer-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-price {
    font-size: 18px;
    font-weight: bold;
}

.footer-price .price-value {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 800;
}

/* ===== BUTTONS STYLING ===== */
.btn-primary,
.btn-secondary,
.btn-back,
.btn-next,
.btn-large {
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Mobile touch targets */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-back,
    .btn-next,
    button,
    a.btn-secondary,
    a.btn-primary {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(195, 129, 97, 0.2);
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--rose-gold) 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 15px rgba(195, 129, 97, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--gold-light);
    border-color: var(--primary-color);
}

.charm-details-remove {
    background: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

.charm-details-remove:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

.btn-back {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-back:hover {
    background: var(--gold-light);
    border-color: var(--primary-color);
}

.btn-next {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--rose-gold) 100%);
    color: white;
    border: none;
}

.btn-next:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 15px rgba(195, 129, 97, 0.35);
}

.btn-large {
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
}

.step-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.configurator-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2147483647; /* Maximum z-index to be above cookie popups */
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 20px rgba(90, 61, 53, 0.08);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: auto !important;
    -webkit-transform: translateZ(0); /* Force GPU layer */
    transform: translateZ(0);
}

.configurator-footer * {
    pointer-events: auto !important;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 600px) {
    .configurator-footer {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
        z-index: 2147483647 !important; /* Maximum z-index - above cookie popups */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .configurator-footer button,
    .configurator-footer a {
        position: relative;
        z-index: 1;
        min-height: 44px;
        touch-action: manipulation;
        pointer-events: auto !important;
    }

    .footer-left {
        flex: 1;
        min-width: auto;
        gap: 8px;
    }

    .footer-left .btn-text {
        display: none;
    }

    .btn-text-mobile {
        display: none;
    }

    #back-to-product-btn .btn-text-mobile {
        display: inline;
    }

    #back-to-product-btn .btn-text-desktop {
        display: none;
    }

    .footer-left .btn-icon {
        font-size: 16px;
    }

    .footer-left button {
        padding: 6px 8px;
        font-size: 11px;
    }

    #back-to-product-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: auto;
    }

    .footer-price {
        font-size: 11px;
        order: -1;
        width: 100%;
        text-align: center;
        padding-bottom: 6px;
        border-bottom: 1px solid #eee;
    }

    .footer-price .price-value {
        font-size: 14px;
        font-weight: bold;
    }

    .footer-right {
        display: flex;
        gap: 6px;
        flex: 1;
        justify-content: flex-end;
    }

    .footer-right button {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .footer-right .btn-text {
        display: none;
    }

    #footer-back-btn .btn-text {
        display: inline;
    }

    .footer-right .btn-icon {
        font-size: 18px;
    }

    .step-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .step-buttons button {
        width: 100%;
    }
}

/* ===== CART DISPLAY - LUXURY JEWELRY STYLE ===== */
.jewelry-cart-item {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.jewelry-cart-item .jewelry-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2) !important;
    border-radius: 12px !important;
    padding: 4px 10px !important;
    font-weight: 600 !important;
}

.jewelry-config-details {
    background: linear-gradient(135deg, var(--gold-light) 0%, rgba(250, 245, 240, 0.5) 100%) !important;
    padding: 12px !important;
    border-left: 3px solid var(--gold-accent) !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

.jewelry-cart-charms-list {
    gap: 10px !important;
}

.jewelry-cart-charms-list>div {
    background: white !important;
    padding: 10px !important;
    border-left: 3px solid var(--primary-color) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

.jewelry-cart-charms-list>div:hover {
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15) !important;
    transform: translateX(2px) !important;
}

.jewelry-cart-charms-list img {
    border-radius: 6px !important;
    padding: 4px !important;
    background: linear-gradient(135deg, var(--gold-light) 0%, #faf5f0 100%) !important;
    width: 50px !important;
    height: 50px !important;
}

/* ===== CART STYLING - WooCommerce Blocks ===== */
/* Miniaturka główna produktu w koszyku - BEZ ramki */
.wc-block-cart-item__image img {
    border-radius: 8px !important;
}

/* Poprawienie listy details */
.wc-block-components-product-details__item {
    padding: 10px 12px !important;
    margin-bottom: 6px !important;
    background: white !important;
    border-radius: 6px !important;
    border-left: 3px solid #ba7a5b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.wc-block-components-product-details__item:last-child {
    margin-bottom: 0 !important;
}

.wc-block-components-product-details__name {
    color: #000 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
}

.wc-block-components-product-details__value {
    color: #555 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

/* Ensure images inside product details value are not clipped */
.wc-block-components-product-details__value img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* Hide technical fields */
li[class*="__test"] {
    display: none !important;
}

/* Preview image in cart */
.jewelry-cart-preview-container {
    display: flex;
    justify-content: flex-start;
    overflow: visible !important;
    width: 100% !important;
}

.jewelry-cart-preview-img {
    max-width: 340px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    border-radius: 12px;
    background: white;
    opacity: 1 !important;
}

.jewelry-cart-preview-img.loaded {
    opacity: 1;
}

/* Hide the label for preview image item */
.wc-block-components-product-details__item:has(.jewelry-cart-preview-container) .wc-block-components-product-details__name {
    display: none !important;
}

.wc-block-components-product-details__item:has(.jewelry-cart-preview-container) {
    border-left: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Charm row in cart - FORCE image first position */
.jewelry-cart-charm-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center !important;
    overflow: visible !important;
}

.jewelry-cart-charm-img {
    width: 48px !important;
    height: auto !important;
    min-width: 48px !important;
    max-height: 60px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    border: 1px solid #e5dad0 !important;
    background: white !important;
    order: -999 !important;
    flex-shrink: 0 !important;
    padding: 2px !important;
    opacity: 1 !important;
}

.jewelry-cart-charm-img.loaded {
    opacity: 1;
}

/* Hide 'Charm #X' label for charm items */
.wc-block-components-product-details__item:has(.jewelry-cart-charm-row) .wc-block-components-product-details__name {
    display: none !important;
}

.jewelry-cart-charm-info {
    order: 999 !important;
    /* Force info to be LAST */
    flex: 1 !important;
}

.jewelry-cart-charm-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 1px dashed #d3c4b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}

.jewelry-cart-charm-info .name {
    font-weight: 600;
    color: #8c4f3c;
    display: block;
}

.jewelry-cart-charm-info .meta {
    font-size: 12px;
    color: #a07a62;
    display: block;
}

.jewelry-cart-charm-info .price {
    font-size: 13px;
    color: #c38161;
    font-weight: 600;
}

#slots-container .charm-image {
    border-radius: 50%;
}

.charm-slot.has-charm .slot-number {
    z-index: 3 !important;
    left: 73% !important;
    top: 60% !important;
}

/* ===== LOADING OVERLAY ===== */
.configurator-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CHARM DETAILS POPUP ===== */
.charm-details-overlay {
    z-index: 10000 !important;
}

/* Mobile: popup wyżej żeby nie był zasłonięty przez footer */
@media (max-width: 768px) {
    .charm-details-overlay {
        top: 40% !important;
        transform: translate(-50%, -50%) !important;
    }
}

.charm-details-overlay button {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(195, 129, 97, 0.3);
    cursor: pointer;
}

.charm-details-backdrop {
    touch-action: manipulation;
}

.charm-details-modal {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.charm-details-close {
    cursor: pointer;
    transition: color 0.2s ease;
}

.charm-details-close:hover {
    color: var(--primary-color) !important;
}

/* ===== LOADING OVERLAY ===== */

.loading-content {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content h3 {
    margin: 0 0 10px;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
}

.loading-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== PRODUCT SELECTION PAGE ===== */
.selection-main {
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
}

.selection-content {
    width: 100%;
}

.selection-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0 30px;
}

.selection-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #FFF;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.selection-tab:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.selection-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #FFF;
}

.selection-tab .tab-icon {
    font-size: 20px;
}

.selection-section {
    display: none;
}

.selection-section.active {
    display: block;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.selection-grid.three-columns {
    grid-template-columns: repeat(3, 1fr);
}

.selection-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 10px;
}

.jewelry-product-item {
    background: #FFF;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.jewelry-product-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.jewelry-product-item .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9f9f9;
}

.product-image-link {
    display: block;
    text-decoration: none;
}

.jewelry-product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.jewelry-product-item .product-info {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.jewelry-product-item .product-type {
    flex-shrink: 0;
}

.jewelry-product-item.charms-category-item .product-info {
    justify-content: space-between;
}

.jewelry-product-item .product-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.jewelry-product-item .product-type {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
    width: 100%;
}

.jewelry-product-item .product-price {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.jewelry-product-item .product-price strong {
    color: var(--text-color);
    font-size: 18px;
}

.jewelry-product-item .product-slots {
    color: #999;
    font-size: 13px;
    margin-bottom: 15px;
}

.jewelry-product-item .product-btn {
    display: inline-block;
    width: 100%;
    text-decoration: none;
    text-align: center;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
}

@media (max-width: 992px) {
    .selection-grid.three-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .selection-tabs {
        flex-direction: column;
    }

    .selection-tab {
        width: 100%;
        justify-content: center;
    }

    .selection-grid,
    .selection-grid.three-columns {
        grid-template-columns: 1fr;
    }

    .charm-image {
        padding: 4px !important;
    }
}

/* Cart Preview Image */
.jewelry-cart-preview-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    background: white;
}

.jewelry-cart-preview-img:not(.loaded) {
    opacity: 0.5;
    filter: blur(2px);
}

.jewelry-cart-preview-img.loaded {
    opacity: 1;
    filter: none;
}

/* Checkout Order Summary - same style as cart */
.wc-block-components-order-summary-item .wc-block-components-product-image img.jewelry-cart-preview-img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    background: white !important;
}

.wc-block-components-order-summary .jewelry-cart-preview-img.loaded {
    opacity: 1 !important;
}

/* Weaves Grid */
.weaves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .weaves-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .weaves-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.weave-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid #ddd;
    transition: border-color 0.2s ease;
    background: white;
    padding: 0;
    text-align: center;
}

.weave-card:hover {
    border-color: var(--primary-color);
}

.weave-card.selected {
    border-color: var(--primary-color);
}

.weave-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: var(--gold-light);
    padding: 8px 0;
    transition: transform 0.3s ease;
}

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

.weave-info {
    padding: 14px;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border-light);
}

.weave-info h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 600;
}

.weave-info p {
    margin: 0;
    font-size: 11px;
    color: var(--text-light);
    height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.weave-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-soft);
}

.weave-card:hover .weave-selector {
    opacity: 1;
}

.weave-card.selected .weave-selector {
    opacity: 1;
    background: var(--primary-color);
    color: white;
}

.weave-selector::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}


@media only screen and (max-width: 768px) {
    .material-options {
        margin: 0 !important;
    }

    #weaves-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

input#charm-search {
    border-color: #c07c5d;
}

/* ===== MOBILE CHARM POPUP STYLES ===== */
@media (max-width: 768px) {
    .mobile-charm-popup-backdrop {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-charm-popup {
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    }
    
    .mobile-charm-popup .mobile-popup-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-charms-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-charm-card {
        -webkit-tap-highlight-color: rgba(195, 129, 97, 0.3);
        touch-action: manipulation;
    }
    
    .mobile-charm-card:active {
        transform: scale(0.95);
        border-color: var(--primary-color);
    }
    
    .mobile-category-select,
    .mobile-charm-search {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    .current-charm-section .remove-current-charm {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* ============================================
   OIL CARDS (Olejek - for Brelok/Keychain)
   ============================================ */

.oil-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid #ddd;
    transition: border-color 0.2s ease;
    background: white;
    padding: 0;
    text-align: center;
}

.oil-card:hover {
    border-color: var(--primary-color);
}

.oil-card.selected {
    border-color: var(--primary-color);
}

.oil-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: var(--gold-light);
    padding: 8px 0;
    transition: transform 0.3s ease;
}

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

.oil-info {
    padding: 14px;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border-light);
}

.oil-info h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 600;
}

.oil-info p {
    margin: 0;
    font-size: 11px;
    color: var(--text-light);
    height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.oil-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-soft);
}

.oil-card:hover .oil-selector {
    opacity: 1;
}

.oil-card.selected .oil-selector {
    opacity: 1;
    background: var(--primary-color);
    color: white;
}

.oil-selector::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}