/* ==========================================================
   1. VARIABLES & RESET (RETRO THEME UPDATED)
   ========================================================== */
   @import url('https://fonts.googleapis.com/css2?family=Ingrid+Darling&family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@400;700&display=swap');

   :root {
       /* New Retro Color Palette from Image */
       --color-retro-blue: #ffb0d3;      /* สีฟ้าหม่นจากพื้นหลังรูป */
       --color-retro-pink: #b2232f;      /* สีชมพูจากตัวอักษร Retro Car Show */
       --color-dark-slate: #2D3436;      /* สีเทาเข้มเกือบดำสำหรับตัวหนังสือ */
       --color-white-soft: #F1F2F6;      /* สีขาวนวล */
       
       /* Mapping to existing variable names to minimize breakage */
       --color-sky-blue: var(--color-retro-pink); 
       --color-chocolate: var(--color-dark-slate);     
       --color-olive-martini: var(--color-retro-blue);      
       --color-white: var(--color-white-soft);
       --color-light-bg: var(--color-white-soft);      
       --color-alert-red: #D63031; 
       --color-gif-accent: var(--color-retro-pink); 
       
       /* Fonts */
       --font-heading: 'Old Standard TT', serif; 
       --font-body: 'Montserrat', sans-serif;
       --font-jasper: 'Ingrid Darling', cursive;    
   }
   
   body {
       background-color: var(--color-retro-blue); /* เปลี่ยนพื้นหลังเป็นสีฟ้า */
       color: var(--color-dark-slate);
       font-family: var(--font-body);
       margin: 0;
       padding: 0;
       text-align: center;
       min-height: 100vh;
       display: flex;
       flex-direction: column;
       align-items: center;
       justify-content: center;
       line-height: 1.6;
   }

   /* แก้ไขสีปุ่มเวลา Hover ให้เข้ากับธีมใหม่ */
   .primary-button:hover, .btn-primary:hover, .btn-affirmation:hover { 
       background-color: #D4A5A9 !important; /* ชมพูที่เข้มขึ้นเล็กน้อย */
       transform: translate(2px, 2px); 
       box-shadow: 2px 2px 0px var(--color-chocolate); 
   }
   
   /* ==========================================================
      2. GLOBAL DECORATIONS (Frames)
      ========================================================== */
   
   /* Top Frame */
   body::before {
       content: ''; 
       width: 100vw; 
       height: 19px; 
       background-image: url('star_icon.png'); 
       background-repeat: repeat-x; 
       background-size: auto 19px; 
       position: fixed; 
       top: 14px; 
       left: 0;
       z-index: 999; 
   }
   
   /* Bottom Frame */
   body::after {
       content: ''; 
       width: 100vw; 
       height: 19px; 
       background-image: url('star_icon.png'); 
       background-repeat: repeat-x;
       background-size: auto 19px; 
       position: fixed; 
       bottom: 14px; 
       left: 0;
       z-index: 999; 
   }
   
   /* ==========================================================
      3. TYPOGRAPHY
      ========================================================== */
   .logo-font { font-family: var(--font-heading); font-size: 3.5em; color: var(--color-chocolate); margin: 0; }
   .vintage-heading { font-family: var(--font-heading); font-size: 2.2em; color: var(--color-chocolate); font-weight: bold; }
   .accent-text { color: var(--color-sky-blue); font-weight: 700; }
   .body-text { max-width: 600px; margin: 15px auto; font-size: 1em; }
   .info-text { font-size: 0.9em; margin-top: 20px; color: #555; }
   
   .main-heading { 
       font-family: var(--font-jasper);
       font-size: 3.5em; 
       color: var(--color-chocolate); 
       margin-top: 0;
       line-height: 1.1;
   }
   
   .sub-heading {
       font-family: var(--font-body);
       font-size: 1.5em; 
       color: var(--color-sky-blue);
       margin-bottom: 20px;
   }
   
   /* Responsive headings */
   @media (max-width: 767px) {
       .main-heading {
           font-size: 2.5em;
       }
       
       .sub-heading {
           font-size: 1.2em;
       }
   }
   
   @media (max-width: 480px) {
       .main-heading {
           font-size: 2em;
       }
       
       .sub-heading {
           font-size: 1em;
       }
   }
   
   .tagline {
       max-width: 450px;
       margin: 15px auto 30px auto;
       font-size: 1.1em;
   }
   
   .section-tag-line { 
       font-family: var(--font-body); 
       font-size: 0.9em; 
       font-weight: 700;
       color: var(--color-sky-blue);
       margin-bottom: 5px;
   }
   
   /* ==========================================================
      4. COMPONENTS (Buttons & UI)
      ========================================================== */
   
   /* Base Button Styles */
   .primary-button, .secondary-button, .btn {
       padding: 15px 35px; 
       margin: 0; 
       cursor: pointer; 
       text-transform: uppercase; 
       border-radius: 999px; 
       transition: background-color 0.3s, transform 0.1s; 
       font-weight: 700; 
       font-family: var(--font-body); 
       border: 2px solid var(--color-chocolate);
       text-decoration: none; 
       display: inline-block; 
       text-align: center;
   }
   
   /* Primary Variant */
   .primary-button, .btn-primary { 
       background-color: var(--color-sky-blue); 
       color: var(--color-white); 
       box-shadow: 4px 4px 0px var(--color-chocolate); 
   }
   .primary-button:hover, .btn-primary:hover { 
       background-color: #490906; 
       transform: translate(2px, 2px); 
       box-shadow: 2px 2px 0px var(--color-chocolate); 
   }
   
   /* Secondary Variant */
   .secondary-button, .btn-secondary { 
       background-color: transparent; 
       color: var(--color-chocolate); 
       border-color: var(--color-chocolate); 
   }
   .secondary-button:hover, .btn-secondary:hover { 
       background-color: var(--color-olive-martini); 
   }
   
   /* Disabled State */
   .primary-button:disabled, .secondary-button:disabled, .btn:disabled { 
       opacity: 0.6; 
       cursor: not-allowed; 
       box-shadow: none; 
       transform: none; 
       pointer-events: none;
   }
   
   /* Small Buttons Group (Results Page) */
   #takeAnother, #shareStrip, #downloadStrip, #downloadVideo {
       background-color: var(--color-sky-blue) !important; 
       color: var(--color-chocolate) !important;          
       border: 1px solid var(--color-chocolate); 
       box-shadow: 2px 2px 0px var(--color-chocolate); 
       border-radius: 999px !important; 
       
       flex-grow: 1 !important;
       flex-basis: 90px !important; 
       max-width: 105px !important; 
       display: flex !important;
       align-items: center;
       justify-content: center;
       text-align: center;
       font-size: 0.7em !important; 
       padding: 8px 10px !important; 
       text-decoration: none;
       text-transform: uppercase;
   }
   
   #takeAnother:hover, #shareStrip:hover, #downloadStrip:hover, #downloadVideo:hover { 
       background-color: #490906 !important; 
       transform: translate(2px, 2px); 
       box-shadow: 2px 2px 0px var(--color-chocolate); 
   }
   
   /* Responsive button sizing */
   @media (max-width: 767px) {
       #takeAnother, #shareStrip, #downloadStrip, #downloadVideo {
           font-size: 0.65em !important;
           padding: 6px 8px !important;
           max-width: 90px !important;
       }
   }
   
   @media (max-width: 480px) {
       #takeAnother, #shareStrip, #downloadStrip, #downloadVideo {
           font-size: 0.6em !important;
           padding: 5px 6px !important;
           max-width: 80px !important;
           flex-basis: 70px !important;
       }
   }
   
   /* Affirmation Button */
   .btn-affirmation {
       font-size: 1em !important; 
       padding: 10px 20px !important; 
       width: auto;
       min-width: 250px;
       background-color: var(--color-sky-blue) !important; 
       color: var(--color-chocolate) !important;
       border: 1px solid var(--color-chocolate);
       box-shadow: 2px 2px 0px var(--color-chocolate);
       margin: 0 auto 5px auto !important; 
       border-radius: 999px !important; 
   }
   .btn-affirmation:hover {
       background-color: #490906 !important; 
       transform: translate(2px, 2px); 
       box-shadow: 2px 2px 0px var(--color-chocolate); 
   }
   
   /* ==========================================================
      5. SECTIONS & LAYOUTS
      ========================================================== */
   
   /* Session Containers */
   .session { 
       padding: 50px 20px; 
       width: 100%; 
       max-width: 900px; 
       display: none; 
       opacity: 0; 
       transition: opacity 0.5s ease; 
       box-sizing: border-box;
   }
   .session:not(#home) {
       margin-left: auto; 
       margin-right: auto;
       padding: 30px 20px;
   }
   .session.active { 
       display: block; 
       opacity: 1; 
   }
   
   /* Home Section */
   .home-layout-container {
       display: flex;
       flex-direction: column; 
       align-items: center;
       max-width: 1200px;
       margin: 0 auto;
       padding: 20px; 
       width: 100%;
       box-sizing: border-box; 
   }
   .home-content-box, .home-visual-box {
       width: 90%; 
       max-width: 500px;
       padding: 20px 0;
       text-align: center;
   }
   .photo-booth-mockup {
       border-radius: 15px;
       padding: 10px;
       max-width: 420px; 
       margin: 0 auto;
   }
   .booth-display-image {
       width: 100%;
       height: auto;
       display: block;
       margin-top: 10px; 
   }
   .mode-select-buttons {
       display: flex;
       flex-direction: column;
       gap: 10px;
       max-width: 300px;
       margin: 0 auto;
   }
   
   /* Filter Selection Section */
   #filterSelection .design-options-container {
       display: flex;
       flex-direction: row; 
       gap: 20px; 
       justify-content: center;
       max-width: 900px;
       margin: 30px auto;
   }
   #filterSelection .design-option {
       width: 33%; 
       max-width: 250px; 
       height: auto; 
       border-radius: 8px;
       background-color: var(--color-light-bg);
       padding: 15px;
       border: 3px solid var(--color-chocolate);
       box-shadow: 4px 4px 0px var(--color-chocolate); 
       display: flex;
       flex-direction: column;
       align-items: center;
       text-align: center;
       transition: all 0.2s ease;
   }
   #filterSelection .design-option:hover {
       transform: translateY(-3px); 
       box-shadow: 6px 6px 0px var(--color-chocolate); 
   }
   #filterSelection .design-option.active {
       border-color: var(--color-sky-blue); 
       box-shadow: 0 0 0 5px var(--color-sky-blue), 4px 4px 0px var(--color-chocolate);
       transform: none;
   }
   #filterSelection .design-option p {
       font-weight: 700;
       font-size: 1.1em;
       margin: 0;
       color: var(--color-chocolate);
   }
   .filter-preview-image {
       width: 100%;
       height: auto;
       border-radius: 4px;
       border: 1px solid var(--color-chocolate);
       margin-bottom: 10px;
       aspect-ratio: 2 / 3; 
       object-fit: cover;
   }
   
   /* Booth Section (Camera) */
   .content-box { 
       background-color: var(--color-light-bg); 
       border: 4px solid var(--color-chocolate); 
       padding: 40px 20px; 
       border-radius: 8px; 
       box-shadow: 8px 8px 0px rgba(1, 1, 1, 0.4); 
   }
   .type-selector-group { 
       margin-bottom: 20px; 
       border: 2px solid var(--color-chocolate); 
       padding: 15px; 
       border-radius: 8px; 
       background-color: var(--color-light-bg);
       max-width: 450px;
       margin-left: auto;
       margin-right: auto;
   }
   .strip-type-button {
       padding: 15px 25px;
       margin: 5px;
       cursor: pointer;
       border: 2px solid var(--color-chocolate);
       border-radius: 999px;
       font-weight: 700;
       background-color: transparent;
       color: var(--color-chocolate);
       transition: background-color 0.3s, color 0.3s;
   }
   .strip-type-button.selected {
       background-color: var(--color-sky-blue);
       color: var(--color-white);
       border-color: var(--color-chocolate);
   }
   .camera-container { 
       position: relative; 
       width: 90%; 
       /* Keep desktop max size logic, but let it scale down */
       max-width: 400px; 
       aspect-ratio: 3 / 2; 
       margin: 30px auto; 
       background-color: #000; 
       border: 6px solid var(--color-chocolate); 
       overflow: hidden; 
       box-shadow: 0 0 15px rgba(0, 0, 0, 0.7); 
       transition: aspect-ratio 0.5s ease, max-width 0.5s ease; 
   }
   .camera-container.aspect-3x2 { aspect-ratio: 3 / 2; max-width: 400px; } 
   .camera-container.aspect-1x1-5 { aspect-ratio: 1 / 1.5; max-width: 250px; } 
   
   #webcamVideo { 
       width: 100%; 
       height: 100%; 
       object-fit: cover; 
       transform: scaleX(-1); 
   } 
   .flash { 
       position: absolute; 
       top: 0; left: 0; 
       width: 100%; height: 100%; 
       background-color: #FFFFFF;    
       opacity: 0; 
       z-index: 11; 
       pointer-events: none; 
       transition: opacity 0.05s ease-out; 
   }
   .countdown-timer {
       position: absolute;
       top: 50%; left: 50%;
       transform: translate(-50%, -50%);
       font-size: 10em;
       font-family: var(--font-heading);
       color: var(--color-sky-blue);
       text-shadow: 0 0 15px rgba(0, 0, 0, 1);
       z-index: 10;
       display: none;
   }
   #cameraError {
       color: var(--color-alert-red);
       margin-top: 15px;
       font-weight: bold;
       display: none;
   }
   
   /* Results Section */
   .film-delivery-box { 
       margin: 30px auto; 
       background-color: var(--color-chocolate); 
       padding: 15px; 
       border-radius: 8px; 
       box-shadow: 0 0 25px rgba(0, 0, 0, 0.5); 
       display: flex; 
       flex-direction: column; 
       align-items: center; 
       transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease, max-width 0.3s ease;
       width: 90%;
       max-width: 600px;
   }
   
   /* Desktop - 4x6 landscape */
   @media (min-width: 1024px) {
       .film-delivery-box {
           max-width: 600px;
       }
   }
   
   /* Tablet */
   @media (min-width: 768px) and (max-width: 1023px) {
       .film-delivery-box {
           max-width: 500px;
       }
   }
   
   /* Mobile */
   @media (max-width: 767px) {
       .film-delivery-box {
           max-width: 95%;
           padding: 12px;
       }
   }
   .delivery-slot-header { 
       width: 100%; 
       padding: 10px 5px; 
       background-color: var(--color-light-bg);
       color: var(--color-chocolate); 
       font-weight: 700; 
       text-transform: uppercase; 
       text-align: center; 
       display: flex;
       flex-direction: column; 
       align-items: center; 
       justify-content: center; 
       min-height: 70px; 
       box-sizing: border-box;
   }
   .delivery-slot-header .main-text {
       font-size: 1.2em; 
       margin: 0;
       line-height: 1.1;
       white-space: normal; 
       word-break: break-word; 
       max-width: 90%; 
   }
   .delivery-slot-header .sub-text {
       font-size: 0.8em; 
       margin: 2px 0 0 0;
       line-height: 1;
       white-space: nowrap;
       overflow: hidden;
       text-overflow: ellipsis;
       max-width: 95%;
   }
   .delivery-slot-header .arrow {
       font-size: 1.1em; 
       margin-top: 5px;
   }
   
   .photo-strip-slot { 
       background-color: #111; 
       margin-top: 10px; 
       overflow: hidden; 
       position: relative; 
       border: 2px solid #999; 
       display: flex;
       align-items: center;
       justify-content: center;
       width: 100%;
       min-height: 250px;
   }
   .photo-strip-slot img {
       display: block;
       max-width: 100%;
       max-height: 60vh;
       width: auto;
       height: auto;
       object-fit: contain; 
       transform: translateY(-100%); 
       transition: transform 1.5s ease-out;
       position: relative;
   }
   
   /* Responsive slot heights */
   @media (min-width: 1024px) {
       .photo-strip-slot {
           min-height: 350px;
       }
       .photo-strip-slot img {
           max-height: 500px;
       }
   }
   
   @media (min-width: 768px) and (max-width: 1023px) {
       .photo-strip-slot {
           min-height: 300px;
       }
       .photo-strip-slot img {
           max-height: 450px;
       }
   }
   
   @media (max-width: 767px) {
       .photo-strip-slot {
           min-height: 200px;
       }
       .photo-strip-slot img {
           max-height: 400px;
       }
   }
   
   .affirmation-promo-box .affirmation-small-text {
       font-size: 0.8em;
       margin-top: 5px; 
   }
   #processStatus {
       color: var(--color-chocolate); 
       font-weight: 700; 
       font-size: 1.2em; 
       margin: 15px auto; 
       padding: 0; 
       border: none; 
       max-width: 450px; 
       display: none;
   }
   
   /* Overlays */
   #screenBlockerMessage {
       display: none !important; /* Disabled for Mobile Support */
   }
   
   .xmas-music-overlay {
       position: fixed;
       top: 0; left: 0;
       width: 100%; height: 100%;
       background-color: rgba(0, 0, 0, 0.9); 
       color: white;
       display: flex;
       justify-content: center;
       align-items: center;
       font-size: 1.5em;
       font-family: var(--font-body); 
       z-index: 9999; 
       cursor: pointer;
       transition: opacity 0.5s ease-out; 
   }
   
   /* ==========================================================
      6. MEDIA QUERIES
      ========================================================== */
   
   /* Desktop/Tablet */
   @media (min-width: 768px) {
       .home-layout-container {
           flex-direction: row; 
           justify-content: space-between;
           align-items: center; 
           padding: 100px 20px;
       }
       .home-content-box {
           width: 50%;
           max-width: none; 
           text-align: left;
           order: 0;
           padding-right: 40px; 
       }
       .home-visual-box {
           width: 50%;
           order: 1;
           text-align: right; 
           margin-bottom: 0;
       }
       .mode-select-buttons {
           margin: 0;
           flex-direction: row; 
           gap: 20px;
       }
       .photo-booth-mockup {
           margin-left: auto;
           margin-right: 0; 
       }
   }
   
   /* Mobile/Tablet Filter Adjustment */
   @media (max-width: 768px) {
       /* Keep filters horizontal on mobile */
       #filterSelection .design-options-container {
           flex-direction: row; 
           flex-wrap: nowrap;
           gap: 10px;
           overflow-x: auto; /* Just in case really small */
       }
       #filterSelection .design-option {
           width: 31%; /* Fit 3 items (33% * 3 approx) */
           max-width: 150px; 
           padding: 8px;
           margin: 0;
           flex-shrink: 0;
       }
       #filterSelection .design-option p {
           font-size: 0.9em; /* Smaller text */
       }
       .filter-preview-image {
           margin-bottom: 5px;
       }
       
       #filterSelection .main-heading {
           font-size: 2.5em; 
       }
   }
   
   /* Small Mobile */
   @media (max-width: 480px) {
       .main-heading { font-size: 2.5em; }
       .sub-heading { font-size: 1.2em; }
       .tagline {
           font-size: 1em; 
           margin-left: 15px; 
           margin-right: 15px;
       }
       .primary-button, .secondary-button, .btn {
           padding: 12px 25px; 
           font-size: 0.85em;
       }
       .photo-booth-mockup { max-width: 300px; }
       
       /* Scaling Camera Container for small screens */
       .camera-container.aspect-3x2 { width: 95%; max-width: 350px; } 
       .camera-container.aspect-1x1-5 { width: 60%; max-width: 200px; } 
       
       .delivery-slot-header .main-text { font-size: 0.9em; }
       .delivery-slot-header .sub-text, .delivery-slot-header .arrow { font-size: 0.7em; }
       
       #downloadStrip, #downloadVideo, #shareStrip, #takeAnother {
           font-size: 0.6em !important; 
           padding: 5px 6px !important;
           flex-basis: 70px !important; 
           max-width: 80px !important; 
       }
   }
   
   /* Specific Fix for Narrow Strip Box */
   @media (max-width: 180px) {
       .film-delivery-box .delivery-slot-header .main-text {
           font-size: 0.85em; 
           line-height: 1.1;
       }
       .film-delivery-box .delivery-slot-header .sub-text,
       .film-delivery-box .delivery-slot-header .arrow {
            font-size: 0.65em; 
            margin-top: 1px;
       }
       .delivery-slot-header { min-height: 60px; }
   }
   
/* --- à¸ªà¹ˆà¸§à¸™à¸‚à¸­à¸‡ Modal à¸—à¸µà¹ˆà¸›à¸£à¸±à¸šà¸›à¸£à¸¸à¸‡à¹ƒà¸«à¸¡à¹ˆ --- */
/* --- à¸›à¸£à¸±à¸šà¸›à¸£à¸¸à¸‡ Product Modal à¹ƒà¸«à¹‰à¹€à¸¥à¹‡à¸à¸¥à¸‡à¹à¸¥à¸°à¸›à¸´à¸”à¸‡à¹ˆà¸²à¸¢à¸‚à¸¶à¹‰à¸™ --- */
#productModal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* à¸žà¸·à¹‰à¸™à¸«à¸¥à¸±à¸‡à¸”à¸³à¹‚à¸›à¸£à¹ˆà¸‡à¹à¸ªà¸‡ */
    justify-content: center;
    align-items: center;
    padding: 20px; /* à¹€à¸§à¹‰à¸™à¸£à¸°à¸¢à¸°à¸‚à¸­à¸šà¹€à¸žà¸·à¹ˆà¸­à¹ƒà¸«à¹‰à¸à¸”à¸›à¸´à¸”à¸£à¸­à¸šà¹† à¹„à¸”à¹‰ */
}

.modal-content {
    background-color: var(--color-sky-blue);
    padding: 15px;
    border-radius: 15px;
    max-width: 450px; /* à¸ˆà¸³à¸à¸±à¸”à¸„à¸§à¸²à¸¡à¸à¸§à¹‰à¸²à¸‡à¹„à¸¡à¹ˆà¹ƒà¸«à¹‰à¹ƒà¸«à¸à¹ˆà¹€à¸à¸´à¸™à¹„à¸› */
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.product-preview-img {
    width: 100%;
    height: auto;
    max-height: 60vh; /* à¸ˆà¸³à¸à¸±à¸”à¸„à¸§à¸²à¸¡à¸ªà¸¹à¸‡à¸ à¸²à¸žà¹„à¸¡à¹ˆà¹ƒà¸«à¹‰à¹€à¸à¸´à¸™ 60% à¸‚à¸­à¸‡à¸ˆà¸­ */
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* à¸›à¸¸à¹ˆà¸¡à¸›à¸´à¸” (X) à¸•à¸£à¸‡à¸¡à¸¸à¸¡à¸‚à¸§à¸² */
.close-modal {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    background: var(--color-chocolate);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10001;
}

/* à¸›à¸£à¸±à¸šà¹à¸•à¹ˆà¸‡à¸ªà¸³à¸«à¸£à¸±à¸šà¸¡à¸·à¸­à¸–à¸·à¸­à¹‚à¸”à¸¢à¹€à¸‰à¸žà¸²à¸° */
@media (max-width: 768px) {
    #productModal {
        padding: 40px 30px; /* à¹€à¸žà¸´à¹ˆà¸¡à¸žà¸·à¹‰à¸™à¸—à¸µà¹ˆà¸§à¹ˆà¸²à¸‡à¸£à¸­à¸šà¹† à¹ƒà¸«à¹‰à¹à¸•à¸°à¸›à¸´à¸”à¹„à¸”à¹‰à¸‡à¹ˆà¸²à¸¢à¸‚à¸¶à¹‰à¸™ */
    }
    .modal-content {
        padding: 12px;
        max-width: 90%; /* à¹ƒà¸«à¹‰à¸‚à¸™à¸²à¸” Modal à¹€à¸¥à¹‡à¸à¸¥à¸‡à¸à¸§à¹ˆà¸²à¸ˆà¸­à¹€à¸¥à¹‡à¸à¸™à¹‰à¸­à¸¢ */
    }
    .product-preview-img {
        max-height: 50vh; /* à¸¥à¸”à¸„à¸§à¸²à¸¡à¸ªà¸¹à¸‡à¸ à¸²à¸žà¹ƒà¸™à¸¡à¸·à¸­à¸–à¸·à¸­à¸¥à¸‡à¸­à¸µà¸ */
    }
}

/* --- à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¹ˆà¸™à¸›à¸¸à¹ˆà¸¡ (Wiggle) --- */
@keyframes wiggleBtn {
    0% { transform: scale(1); }
    5% { transform: scale(0.95) rotate(-1deg); }
    10% { transform: scale(1.05) rotate(1deg); }
    15% { transform: scale(1.05) rotate(-1deg); }
    20% { transform: scale(1.05) rotate(1deg); }
    25% { transform: scale(1) rotate(0); }
    100% { transform: scale(1); }
}

/* à¹ƒà¸ªà¹ˆ Class à¸™à¸µà¹‰à¸—à¸µà¹ˆà¸›à¸¸à¹ˆà¸¡à¹ƒà¸™à¸«à¸™à¹‰à¸²à¸ªà¸¸à¸”à¸—à¹‰à¸²à¸¢ */
.btn-affirmation {
    animation: wiggleBtn 3s infinite ease-in-out;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-affirmation:hover {
    transform: scale(1.1);
}
/* --- ส่วนปุ่มเลือกสไตล์ (Design Selector) --- */

/* จัดกลุ่มปุ่มให้อยู่ตรงกลางและมีระยะห่าง */
.design-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    padding: 10px;
}

/* ตัวปุ่ม: ทำให้ดูเหมือนปุ่ม 3D ที่กดได้จริง */
.design-option {
    padding: 12px 22px;
    border: 2px solid #000;
    border-radius: 50px; /* ทรงวงรี */
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease; /* ให้ตอบสนองไวๆ */
    
    /* เงาสีดำหนาๆ ด้านล่างและขวา ทำให้ดูเหมือนปุ่มลอยออกมา */
    box-shadow: 4px 4px 0px #000; 
    
    text-transform: uppercase;
    user-select: none;
    position: relative;
}

/* เมื่อเอาเมาส์ไปวาง: ปุ่มจะลอยขึ้นเล็กน้อยและเงาหนาขึ้น */
.design-option:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000;
    background: #f9f9f9;
}

/* เมื่อปุ่มถูกเลือก (Active): ปุ่มจะจมลงไปแนบพื้น เงาหายไป */
.design-option.active {
    background: #000;
    color: #fff;
    transform: translate(4px, 4px); /* ขยับลงมาเท่ากับขนาดเงา */
    box-shadow: 0px 0px 0px #000; /* เงาหายไปเหมือนโดนกดจม */
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* พื้นหลังดำโปร่งแสง */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: popUp 0.3s ease-out;
}

@keyframes popUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #333;
}

.modal-title { font-family: 'Old Standard TT', serif; margin-bottom: 10px; }
.btn-confirm { margin-top: 20px; display: block; text-decoration: none; }
/* กล่องพื้นหลัง */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px; /* กันไม่ให้ชิดขอบจอเกินไป */
}

/* ตัวกล่อง Modal - ปรับให้เล็กลง */
.modal-content {
    background: white;
    padding: 25px 20px;
    border-radius: 15px;
    width: 85%;      /* ขนาดเล็กกว่าความกว้างจอ */
    max-width: 320px; /* จำกัดความกว้างสูงสุดไม่ให้ใหญ่เกินไป */
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ปุ่มปิด (X) - แก้ให้เห็นชัดและกดง่าย */
.close-modal-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background: #000;    /* พื้นหลังสีดำ */
    color: #fff;        /* ตัว X สีขาว */
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ปรับขนาดตัวหนังสือใน Modal ให้กระทัดรัด */
.modal-title {
    font-size: 1.2rem;
    margin-top: 5px;
    margin-bottom: 5px;
    font-family: 'Old Standard TT', serif;
}

.btn-confirm {
    margin-top: 15px;
    display: inline-block; /* เปลี่ยนจาก block หรือ inline เป็น inline-block */
    width: auto;           /* ให้กว้างตามเนื้อหา หรือใช้ 100% ถ้าอยากให้เต็มกล่อง */
    min-width: 180px;      /* กำหนดขนาดขั้นต่ำให้ดูสวย */
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    text-decoration: none;
    
    /* บังคับให้อยู่ตรงกลาง */
    margin-left: auto;
    margin-right: auto;
}

/* และเพื่อให้ชัวร์ว่าเนื้อหาใน Modal ทั้งหมดอยู่ตรงกลางเสมอ */
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* จัดลูกทุกตัว (รูป, ข้อความ, ปุ่ม) ให้อยู่กึ่งกลางแนวตั้ง */
    text-align: center;
    /* ...โค้ดส่วนอื่นคงเดิม... */
}


/* ==========================================================
   FRAME SELECTION SECTION (NEW)
   ========================================================== */

.frame-preview-container {
    max-width: 90%;
    width: 100%;
    margin: 20px auto;
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* เพิ่มเพื่อรองรับ overlay */
}

.photo-strip-preview {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative; /* เพิ่มเพื่อรองรับ overlay */
}

/* Responsive image sizing based on strip type */
.photo-strip-preview img {
    max-width: 100%;
    max-height: 70vh; /* จำกัดความสูงไม่ให้เกินหน้าจอ */
    height: auto;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* Desktop - larger screens */
@media (min-width: 1024px) {
    .frame-preview-container {
        max-width: 600px;
    }
    
    .photo-strip-preview img {
        max-height: 500px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .frame-preview-container {
        max-width: 500px;
    }
    
    .photo-strip-preview img {
        max-height: 450px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .frame-preview-container {
        max-width: 95%;
        padding: 10px;
    }
    
    .photo-strip-preview img {
        max-height: 400px;
    }
}

/* Frame Number Buttons Grid */
.frame-options-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
}

.frame-number-button {
    cursor: pointer;
    border: 3px solid var(--color-chocolate);
    border-radius: 12px;
    padding: 20px 15px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: var(--font-body);
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-chocolate);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-number-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background-color: var(--color-olive-martini);
    border-color: var(--color-sky-blue);
}

.frame-number-button.active {
    border-color: var(--color-sky-blue);
    background-color: var(--color-sky-blue);
    color: var(--color-white);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Desktop - 5 columns */
@media (min-width: 1024px) {
    .frame-options-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
        max-width: 650px;
    }
    
    .frame-number-button {
        font-size: 1.6em;
        padding: 22px 15px;
        min-height: 75px;
    }
}

/* Tablet - 5 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .frame-options-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        max-width: 550px;
    }
    
    .frame-number-button {
        font-size: 1.4em;
        padding: 18px 12px;
        min-height: 65px;
    }
}

/* Mobile - 5 columns */
@media (max-width: 767px) {
    .frame-options-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 0 10px;
        max-width: 100%;
    }
    
    .frame-number-button {
        padding: 12px 8px;
        font-size: 1.1em;
        min-height: 50px;
        border-width: 2px;
    }
}

/* Small mobile - 5 columns (smaller) */
@media (max-width: 480px) {
    .frame-options-grid {
        gap: 6px;
    }
    
    .frame-number-button {
        padding: 10px 5px;
        font-size: 0.95em;
        min-height: 45px;
    }
}

/* Extra small mobile */
@media (max-width: 360px) {
    .frame-number-button {
        padding: 8px 4px;
        font-size: 0.85em;
        min-height: 40px;
    }
}


/* ==========================================================
   FINAL RESULTS SECTION (NEW)
   ========================================================== */

#finalPhotoDisplay {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    position: relative;
}

#finalPhotoDisplay img {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    object-fit: contain;
}

/* Responsive adjustments for final photo */
@media (min-width: 1024px) {
    #finalPhotoDisplay {
        min-height: 350px;
    }
    #finalPhotoDisplay img {
        max-height: 500px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #finalPhotoDisplay {
        min-height: 300px;
    }
    #finalPhotoDisplay img {
        max-height: 450px;
    }
}

@media (max-width: 767px) {
    #finalPhotoDisplay {
        min-height: 200px;
    }
    #finalPhotoDisplay img {
        max-height: 400px;
    }
}
/* ==========================================================
   IMAGE PROTECTION & WATERMARK
   ========================================================== */

/* ป้องกันการ select และ copy รูปภาพ */
.photo-strip-preview,
#finalPhotoDisplay,
.photo-strip-preview img,
#finalPhotoDisplay img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: auto;
}

/* ป้องกันการคลิกขวาและ drag ใน frame selection section */
#frameSelection {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#frameSelection .frame-preview-container,
#frameSelection .photo-strip-preview,
#frameSelection .photo-strip-preview img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    -webkit-touch-callout: none !important; /* ป้องกันใน iOS */
}

/* ป้องกันการ long-press บน mobile */
#frameSelection img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    pointer-events: none !important;
}
/* ==========================================================
   SAMPLE GALLERY SECTION (NEW - Static Grid)
   ========================================================== */

.sample-gallery-section {
    max-width: 1000px;
    margin: 40px auto 20px auto;
    padding: 30px 20px;
    text-align: center;
}

.gallery-heading {
    font-family: var(--font-body);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-chocolate);
    margin: 0 0 10px 0;
}

.gallery-subtitle {
    font-size: 1em;
    color: var(--color-sky-blue);
    margin: 0 0 30px 0;
    font-weight: 600;
}

.sample-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 0 auto 25px auto;
    max-width: 900px;
}

.sample-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    aspect-ratio: 2/3;
}

.sample-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.sample-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.sample-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 15px 10px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sample-item:hover .sample-overlay {
    opacity: 1;
}

.sample-label {
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-cta {
    margin-top: 20px;
}

.gallery-description {
    margin: 20px auto;
}

.gallery-description p {
    font-size: 1em;
    max-width: 550px;
    margin: 25px auto 20px auto;
    line-height: 1.6;
    color: var(--color-chocolate);
}

.payment-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    display: inline-block;
}

/* Tablet - 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .sample-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 600px;
    }
    
    .gallery-heading {
        font-size: 1.6em;
    }
}

/* Mobile - 2 columns */
@media (max-width: 767px) {
    .sample-gallery-section {
        padding: 20px 15px;
        margin: 30px auto 15px auto;
    }
    
    .sample-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }
    
    .gallery-heading {
        font-size: 1.4em;
    }
    
    .gallery-subtitle {
        font-size: 0.9em;
        margin-bottom: 20px;
    }
    
    .sample-overlay {
        opacity: 1; /* Always show on mobile */
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    }
    
    .sample-label {
        font-size: 0.65em;
    }
}

@media (max-width: 480px) {
    .sample-gallery-grid {
        gap: 8px;
    }
    
    .gallery-heading {
        font-size: 1.2em;
    }
    
    .sample-label {
        font-size: 0.6em;
    }
}

/* ==========================================================
   LIGHTBOX MODAL FOR SAMPLE GALLERY
   ========================================================== */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

@keyframes zoomIn {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--color-retro-pink);
    transform: scale(1.1);
}

.lightbox-caption {
    margin: 20px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 10px 0;
    font-size: 1.1em;
    font-weight: 600;
}

/* Responsive lightbox */
@media (max-width: 767px) {
    .lightbox-modal {
        padding-top: 40px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 80vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }
    
    .lightbox-caption {
        font-size: 0.95em;
        width: 90%;
    }
}

@media (max-width: 480px) {
    .lightbox-close {
        top: 5px;
        right: 15px;
        font-size: 35px;
    }
    
    .lightbox-caption {
        font-size: 0.85em;
    }
}

/* Make sample items clickable */
.sample-item {
    cursor: pointer;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    aspect-ratio: 2/3;
}

.sample-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.sample-item:hover::after {
    opacity: 0.9;
}
