  
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  /* background-color: #f5f5f5; */
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-areas: 
    "svg"
    "controls"
    "tshirt";
  /* gap: 20px;
  padding: 20px; */
}

/* PC用レイアウト（768px以上） */
@media (min-width: 768px) {
  body {
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: 
    "controls svg"
    "controls tshirt";
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* より大きな画面用の調整 */
@media (min-width: 1024px) {
  body {
    /* grid-template-columns: 350px 1fr; */
    gap: 30px;
    padding: 30px;
  }
}

.svg-container {
  grid-area: svg;
  background-color: #e8f4f8;
  border: 2px solid #4a90e2;
  border-radius: 10px;
  padding: 20px;
  margin-top: 90px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 24px;
  color: #4a90e2;
  font-weight: bold;
}

/* PC用レイアウト（768px以上） */
@media (min-width: 768px) {
  .svg-container {
    padding: 30px;
    margin-top: 100px;
  }
}

/* より大きな画面用の調整 */
@media (min-width: 1024px) {
  .svg-container {
    margin-top: 70px;
  }
}

.controls {
  grid-area: controls;
  background-color: #fff3cd;
  border: 2px solid #f39c12;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  font-size: 20px;
  color: #f39c12;
  font-weight: bold;
}

/* PC用レイアウト（768px以上） */
@media (min-width: 768px) {
  .controls {
    height: fit-content;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 70px;
  }
}

/* より大きな画面用の調整 */
@media (min-width: 1024px) {
  .controls {
    min-height: 500px;
    margin-top: 70px;
  }
}

.tshirt-container {
  grid-area: tshirt;
  background-color: #d4edda;
  border: 2px solid #28a745;
  margin-top: 30px;
  border-radius: 10px;
  padding: 20px;
  /* padding: 40px; */
  text-align: center;
  font-size: 20px;
  /* font-size: 24px; */
  color: #28a745;
  font-weight: bold;
}

/* PC用レイアウト（768px以上） */
@media (min-width: 768px) {
  .tshirt-container {
    margin-top: 0px;
    min-height: 200px;
    /* display: flex; */
    align-items: center;
    justify-content: center;
  }
}

/* より大きな画面用の調整 */
@media (min-width: 1024px) {
  .tshirt-container {
    min-height: 240px;
  }
}

.none {
  display: none;
}

.input-group {
  margin-bottom: 15px;
}
.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.input-group input, .input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
}

.slider:hover {
  opacity: 1;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn_open {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.btn_open:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* .svg-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
    position: relative;
} */

.svg-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}
/* PC用レイアウト（768px以上） */
@media (min-width: 768px) {
  .svg-wrapper {
    margin: 0 auto;
    width: 80%;
  }
}

/* より大きな画面用の調整 */
@media (min-width: 1024px) {
  .svg-wrapper {
    width: 70%;
  }
}

svg {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.draggable-text {
    cursor: move;
    user-select: none;
}

.draggable-text:hover {
    filter: drop-shadow(0 0 3px rgba(102, 126, 234, 0.7));
}

.draggable-background {
    cursor: move;
    user-select: none;
}

.draggable-background:hover {
    filter: drop-shadow(0 0 2px rgba(102, 126, 234, 0.5));
}

.download-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 10;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.download-btn:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.05);
}

.download-btn:active {
    transform: scale(0.95);
    background: rgba(80, 100, 200, 1);
}

.preset-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.preset-btn {
    padding: 8px 15px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
}

.background-selector {
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.background-selector h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.background-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bg-thumbnail {
    width: 80px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    position: relative;
    overflow: hidden;
}

.bg-thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.bg-thumbnail.active {
    border-color: #667eea;
    border-width: 3px;
}

.bg-thumbnail svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bg-thumbnail.no-arrow {
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* .tshirt-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
    margin-top: 30px;
} */

.tshirt-controls h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.color-selection {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    justify-content: center;
}

.color-group {
  border: 1px dotted #999;
}

.color-group h4 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.color-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.color-option:hover {
    background-color: #f8f9fa;
}

.color-option input[type="radio"] {
    margin: 0;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

/*T-shirt and print colors*/
.tp_color_black {
  background-color: #000;
}

.tp_color_white {
  background-color: #fff;
}

.tp_color_navy {
  background-color: #1e3a8a;
}

.tp_color_red {
  background-color: #dc2626;
}

.tp_color_blue {
  background-color: #004ffa;
}

.tp_color_goldyellow {
  background-color: #ffd700;
}

.b1s { border:1px solid #ddd !important;}

.tshirt-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tshirt-mockup {
    position: relative;
    width: 300px;
    height: 350px;
    margin: 0 auto;
}

.tshirt-mockup img {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.print-area {
    position: absolute;
    top: 25%;
    left: 65%;
    transform: translateX(-50%);
    width: 80%;
    z-index: 2;
    pointer-events: none; /* Prevent interaction with T-shirt preview */
}

.tshirt-text {
    font-family: "brush-atf", sans-serif;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -.05em;
}

/* @media (max-width: 768px) {
    .color-selection {
        flex-direction: column;
        gap: 20px;
    }
    
    .tshirt-mockup {
        width: 250px;
        height: 300px;
    }
} */

@media (max-width: 768px) {
    /* .header h1 {
        font-size: 2rem;
    } */
    
    /* .controls {
        padding: 20px;
    } */
    
    /* .svg-container {
        padding: 20px;
        position: relative;
        margin-bottom: 20px;
    } */
    
    .download-btn {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
        width: 100%;
        font-size: 18px;
        padding: 15px 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .preset-buttons {
        justify-content: center;
    }
}

/* SVG styles */
.cls-1 { fill: #231815; }
.cls-2 { stroke-width: 4.54px; }
.cls-2, .cls-3 { stroke: #000; }
.cls-2, .cls-3, .cls-4 { fill: none; }
.cls-2, .cls-5 { stroke-miterlimit: 10; }
.cls-3 {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 18px;
}
.cls-5 {
    font-family: "brush-atf", sans-serif;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -.05em;
}
.cls-4 {
    stroke: #fff;
    stroke-width: 7.2px;
}
/*SVG styles end*/

#advancedSettings {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
#advancedSettings.show {
  max-height: 2000px;
  opacity: 1;
}

@media (min-width: 769px) {
  .layout-wrapper {
    display: flex;
    gap: 20px;
  }
  /* .svg-container {
    flex: 1;
  } */
  /* .controls {
    max-width: 300px;
    flex-shrink: 0;
  } */
}

#arrowXSlider, #arrowYSlider {
    display: none; /* 完全に非表示 */
}

/* または無効化スタイル */
#arrowXSlider, #arrowYSlider {
    pointer-events: none;
    opacity: 0.3;
    cursor: not-allowed;
}

.save {
  /* grid-area: svg; */
  background-color: #e8f4f8;
  border: 2px solid #4a90e2;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  /* text-align: center; */
  font-size: 16px;
  color: #333;
  /* font-weight: bold; */
}

.bgEE_p30_mt30_mb30{
  background-color: #eee;
  border: 2px solid #4a90e2;
  border-radius: 10px;
  padding: 30px;
  margin-top: 30px;
  margin-bottom: 30px;
  font-size: 16px;
  color: #333;
  text-align: left;
}

.bgEE_p30_mt30_mb30 p {
  padding: 10px 0px 10px 0px;
}

.product-container {
  display: grid;       /* ✨ グリッドレイアウトを適用 */
  gap: 20px;           /* 要素間の隙間 */
  align-items: start;  /* 上端揃えにする */
  max-width: 800px;
  margin: auto;
  padding: 20px;
  /* background-color: #fff; */
  /* border: 1px solid #ddd; */
  border-radius: 8px;
}

/* --- PC表示のスタイル (画面幅が768px以上の場合) --- */
@media (min-width: 768px) {
  .product-container {
    /* ✨ 2列レイアウトに設定 */
    /* 左列(画像)を300px、右列(テキスト)を残りの幅に */
    grid-template-columns: 300px 1fr;
    gap: 0px;
  }
}

.product-image img {
  margin: 0 auto;
  width: 70%;         /* 親要素に対して100%の幅 */
  height: auto;        /* 高さは自動調整 */
  display: block;      /* 画像下の余白をなくす */
  border: 2px solid #4a90e2;
  border-radius: 10px;
}

.product-description {
  text-align: left;
}

.product-description h2 {
  margin-top: 0;
}