/*
  Simple House - Dark Elegant Version (Fixed Grid)
*/

ul, nav, body, h1, h2, h4, h6, p, figure {
  margin: 0;
  padding: 0;
}

a, button { transition: all 0.3s ease; }

/* Bootstrap grid system Fix */
html {
  box-sizing: border-box;
  -ms-overflow-style: scrollbar;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  background-color: #1c1c1c;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}

/* Column Widths */
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 15px; }

@media (min-width: 576px) {
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; padding: 15px; }
}

@media (min-width: 768px) {
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; padding: 15px; }
}

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; padding: 15px; } /* ৪টি আইটেম নিশ্চিত করে */
}

/* Elegant Buttons */
.tm-btn {
  display: inline-block;
  font-size: 1rem;
  padding: 12px 35px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  border: 0;
}

.tm-btn-default { border: 1px solid #d4af37; background: transparent; color: #d4af37; }
.tm-btn-default:hover { color: #121212; background: #d4af37; }

.tm-btn-success { background-color: #27ae60; color: white; }

/* Body & General */
body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 17px;
  background-color: #0f0f0f;
  color: #e0e0e0;
  overflow-x: hidden;
}

p, address { color: #aaaaaa; line-height: 1.8; }

/* Header Section */
.placeholder { width: 100%; min-height: 460px; background-color: #1a1a1a; position: relative; }
.tm-header { position: absolute; bottom: 0; left: 0; width: 100%; z-index: 1000; background: linear-gradient(transparent, rgba(0,0,0,0.8)); }
.tm-header-inner { padding: 40px 50px; }
.tm-site-title { font-size: 2.5rem; font-weight: 700; color: #d4af37; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }

/* Navigation */
.tm-nav-ul { display: flex; list-style: none; justify-content: flex-end; }
.tm-nav-li { padding: 0 20px; }
.tm-nav-link { color: white; text-decoration: none; font-weight: 600; }
.tm-nav-link.active, .tm-nav-link:hover { color: #d4af37; border-bottom: 2px solid #d4af37; }

/* Gallery Layout (Main Fix) */
.tm-gallery { width: 100%; margin-bottom: 80px; }

.tm-gallery-page {
  display: flex;
  flex-wrap: wrap;
  width: 100%; /* আইটেমগুলোকে ছড়াতে সাহায্য করবে */
  margin: 0 auto;
}

/* Product Card */
.tm-gallery-item {
  background: #252525;
  border-radius: 15px;
  transition: 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #333;
}

.tm-gallery-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  border-color: #d4af37;
}

.tm-gallery-img { width: 100%; height: auto; }
.tm-gallery-item figcaption { padding: 20px; }
.tm-gallery-title { font-size: 1.2rem; font-weight: 600; color: #d4af37; margin-bottom: 10px; }
.tm-gallery-price { font-size: 1.1rem; color: #2ecc71; font-weight: 700; }

/* Paging Links */
.tm-paging-links { text-align: center; margin-bottom: 40px; }
.tm-paging-item { list-style: none; display: inline-block; border: 1px solid #d4af37; margin: 7px; border-radius: 5px; }
.tm-paging-link { padding: 10px 30px; color: #d4af37; text-decoration: none; display: block; }
.tm-paging-link.active, .tm-paging-link:hover { background-color: #d4af37; color: #121212; }

/* History Section */
.tm-container-inner { padding: 30px 15px; max-width: 1120px; margin: 0 auto; }
.tm-history-inner { background: #252525; padding: 30px; border-radius: 20px; display: flex; align-items: center; }

/* Footer */
.tm-footer { border-top: 1px solid #333; padding: 30px; text-align: center; color: #777; margin-top: 50px; }

/* ১. দামের নিচের অতিরিক্ত গ্যাপ কমানো (মূল সমস্যা এখানে) */
.tm-gallery-price {
  font-size: 1.25rem;
  color: #2ecc71;
  font-weight: 700;
  margin-bottom: 15px; /* ৬০ পিক্সেল থেকে কমিয়ে ১৫ পিক্সেল করা হয়েছে */
  display: block;
}

/* ২. প্রোডাক্ট কার্ডের সাইজ এবং মার্জিন ঠিক করা */
.tm-gallery-item {
  background: #252525;
  border-radius: 15px;
  transition: 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto; /* ফিক্সড হাইট সরিয়ে অটো করা হয়েছে */
  margin-bottom: 30px; /* নিচের রো থেকে দূরত্ব */
  border: 1px solid #333;
}

/* ৩. ইমেজের নিচের গ্যাপ কমানো */
.tm-gallery-img {
  width: 100%;
  height: 200px; /* সব ছবি সমান দেখানোর জন্য */
  object-fit: cover;
  margin-bottom: 0; 
}

/* ৪. ডেসক্রিপশনের গ্যাপ ঠিক করা */
.tm-gallery-description {
  margin-bottom: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #aaa;
}

/* ৫. ফিগার এবং ক্যাপশনের প্যাডিং */
.tm-gallery-item figure {
  margin: 0;
}

.tm-gallery-item figcaption {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 576px) {
  .tm-gallery-item {
    max-width: 100%; /* মোবাইলে কার্ড পুরো জায়গা নেবে */
    margin-left: 10px;
    margin-right: 10px;
  }
}

/* ১. স্বাগতম টেক্সট এবং বর্ণনা সেন্টার করা */
.tm-welcome-section {
  margin: 60px auto;
  max-width: 800px; /* বর্ণনা পড়ার সুবিধার জন্য একটু বাড়ানো হয়েছে */
  text-align: center; /* সব লেখা মাঝখানে থাকবে */
  padding: 0 15px;
}

.tm-section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 20px;
  display: block;
  text-align: center;
}

/* ২. গ্যালারি কন্টেইনার ফিক্স (প্রোডাক্টগুলো মাঝখানে রাখার জন্য) */
.tm-gallery-page {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* কার্ডগুলোকে একদম মাঝখানে সাজাবে */
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* ৩. প্রোডাক্ট কার্ডের সাইজ ছোট এবং সেন্টার করা */
.tm-gallery-item {
  flex: 0 0 260px; /* কার্ডের উইডথ কিছুটা কমানো হয়েছে (২৮০ থেকে ২৬০) */
  max-width: 260px;
  background: #252525;
  border-radius: 15px;
  margin: 15px; /* সব দিকে সমান গ্যাপ দিয়ে মাঝখানে রাখা */
  transition: 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #333;
  text-align: left; /* কার্ডের ভেতরের লেখা বামে থাকবে */
}

.tm-gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border-color: #d4af37;
}

/* ৪. ইমেজের সাইজ এবং ফিটিং */
.tm-gallery-img {
  width: 100%;
  height: 180px; /* ইমেজের উচ্চতা কিছুটা কমানো হয়েছে */
  object-fit: cover;
}

/* ৫. টেক্সট এবং গ্যাপ অ্যাডজাস্টমেন্ট */
.tm-gallery-item figcaption {
  padding: 15px;
}

.tm-gallery-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #d4af37;
  margin-bottom: 8px;
}

.tm-gallery-description {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #aaa;
}

.tm-gallery-price {
  font-size: 1.1rem;
  color: #2ecc71;
  font-weight: 700;
  margin-bottom: 5px;
}

/* ৬. বুটস্ট্র্যাপ রো ফিক্স (অতিরিক্ত বাম মার্জিন দূর করা) */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* কলামগুলো মাঝখানে থাকবে */
  margin-left: 0;
  margin-right: 0;
}