/**
 * WooCommerce Image Cropper - Frontend Styles (INLINE VERSION)
 * Version: 3.0.0
 */
/*temp*/
.cropper-info, .crop-actions, .crop-save-status, .cropper-controls-column {
    display: none!important;
}
/* Układ w pionie, ładne odstępy */
.cropper-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}


/* Elementy w osobnych wierszach */
.cropper-image-column,
.cropper-info,
.woo-cropper-compression-controls {
  flex: 0 1 100%;
}

/* Panel kompresji — bufor nad kolejną sekcją i nad overlayem croppera */
.woo-cropper-compression-controls {
  position: relative;
  z-index: 10;
  margin-top: 12px;
  margin-bottom: 20px;
}

/* Nie przycinaj panelu przez rodziców */
#crop-image-wrapper,
.cropper-image-column,
.cropper-layout {
  overflow: visible !important;
}

/* (opcjonalnie) ogranicz maks. szerokość kolumny obrazu */
.cropper-image-column {
  max-width: 900px; /* dopasuj do designu, np. 720–960px */
  margin: 0 auto;
}
/*-------------*/
#crop-image-wrapper { position: relative; }

/* overlay + spinner */
.wc-initial-loader{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.65); backdrop-filter: blur(2px);
  z-index:20; pointer-events:none; /* nie blokuj klików */
  opacity:0; transform: translateY(4px); transition: .18s ease;
}
.wc-initial-loader.is-active{ opacity:1; transform: none; }

.wc-spin{
  width: 36px; height: 36px;
  border: 3px solid rgba(0,0,0,.15); border-top-color:#007cba;
  border-radius: 50%; animation: wc-spin .9s linear infinite;
}

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



/* tylko w obszarze croppera */
#crop-image-wrapper,
#crop-image-wrapper .cropper-container,
#crop-image-wrapper .cropper-container img,
#crop-image-wrapper .cropper-canvas,
#crop-image-wrapper .cropper-view-box {
  -webkit-touch-callout: none; /* iOS Safari: menu po long-press */
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;     /* Chrome/Safari: przeciąganie obrazka */
  touch-action: none;          /* gesty domyślne poza Cropperem */
}









/* Główny kontener kadrowania - widoczny bezpośrednio na stronie */
.woo-cropper-main-container {
    margin: 30px 0;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.woo-cropper-main-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Nagłówek */
.cropper-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.cropper-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cropper-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Layout dwukolumnowy */
.cropper-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Lewa kolumna - obraz */
.cropper-image-column {
    flex: 1;
    min-width: 0;
}

#crop-image-wrapper {
    width: 100%;
    max-height: 500px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
    position: relative;
}

#crop-image {
    max-width: 100%;
    display: block;
    height: auto;
}

.cropper-info {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
}

.crop-dimensions {
    display: block;
}

/* Prawa kolumna - kontrolki */
.cropper-controls-column {
    width: 300px;
    flex-shrink: 0;
}

/* Podgląd */
.crop-preview-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.crop-preview-box h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

#crop-preview-container {
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#crop-preview-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
    max-height:150px;
}

/* Akcje */
.crop-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.crop-actions .button {
    flex: 1;
    padding: 10px 15px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #333;
    text-align: center;
}

.crop-actions .button:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

/* Status zapisu */
.crop-save-status {
    text-align: center;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#crop-status {
    color: #4CAF50;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Cropper.js Customization */
.cropper-container {
    font-size: 0;
    line-height: 0;
    position: relative;
    user-select: none;
    max-height: 500px;
}

.cropper-crop-box {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    outline: 2px solid #39f;
    outline-color: rgba(51, 153, 255, 0.75);
}

.cropper-view-box {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
    outline: 1px solid #39f;
    outline-color: rgba(51, 153, 255, 0.75);
}

/* Linie siatki dla bryt 100cm - BEZ ETYKIET */
.cropper-grid-line {
    position: absolute;
    display: block;
    opacity: 0.8;
    background-color: #ff0000 !important;
    width: 2px !important;
    height: 100%;
    top: 0;
    pointer-events: none;
    z-index: 10;
}

/* Usuń etykiety */
.grid-line-label {
    display: none !important;
}

/* Ciemny overlay (modal) poza obszarem kadrowania */
.cropper-modal {
    background-color: #000;
    opacity: 0.6 !important; /* Mocniejsze przyciemnienie */
}

/* Ukryj uchwyty do zmiany rozmiaru crop boxa */
.cropper-crop-box .cropper-line,
.cropper-crop-box .cropper-point {
    display: none !important;
}

/* Zostaw tylko możliwość przesuwania */
.cropper-crop-box {
    cursor: move !important;
}

/* Popraw widoczność crop boxa */
.cropper-crop-box {
    outline: 2px solid #39f;
    outline-color: rgba(51, 153, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Powiadomienia */
.woo-cropper-notification {
    display: none;
    animation: slideInRight 0.3s;
}

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

/* Responsywność */
@media (max-width: 768px) {
    .cropper-layout {
        flex-direction: column;
    }
    
    .cropper-controls-column {
        width: 100%;
    }
    
    .crop-actions {
        flex-direction: column;
    }
    
    .crop-actions .button {
        width: 100%;
    }
    
    #crop-image-wrapper {
        max-height: 300px;
    }
}

/* Integracja z WooCommerce */
.woocommerce div.product form.cart .woo-cropper-main-container {
    clear: both;
    margin-top: 30px;
}

/* Integracja z TM Extra Product Options */
.tm-extra-product-options .woo-cropper-main-container {
    margin-top: 20px;
}

/* Ukryj kontener jeśli nie ma obrazu */
.woo-cropper-main-container.hidden {
    display: none;
}

/* Style dla stanów ładowania */
.cropper-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.cropper-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dostosowanie do motywu */
.woo-cropper-main-container .button {
    text-decoration: none;
}

.woo-cropper-main-container .button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Wyłącz zoom w obszarze kadrowania */
.cropper-container {
    touch-action: none;
}

.cropper-canvas,
.cropper-crop-box,
.cropper-drag-box {
    touch-action: none;
}