/* =========================
   Root Variables & Base
   ========================= */
:root {
    --primary-color: #386641;
    --secondary-color: #6a994e;
    --light-background: #f4f7f6;
    --dark-background: #1a1a1a;
    --light-text: #333;
    --dark-text: #eee;
    --card-light-bg: #fff;
    --card-dark-bg: #2a2a2a;
    --font-family: 'Roboto', sans-serif;
    --transition-speed: 0.3s;
    --error-color: #d9534f;
}

/* =========================
   Global Styles
   ========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-background);
    color: var(--light-text);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

/* =========================
   Dark Mode
   ========================= */
body.dark-mode {
    background-color: var(--dark-background);
    color: var(--dark-text);
}

body.dark-mode .card,
body.dark-mode .order-summary,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode .thank-you-box,
body.dark-mode .order form,
body.dark-mode .thank-you-details-container {
    background-color: var(--card-dark-bg);
    color: var(--dark-text);
    border-color: #444;
}

body.dark-mode .thank-you-page-body {
    background-color: var(--dark-background);
    color: var(--dark-text);
}

body.dark-mode .thank-you-details-container h3,
body.dark-mode .order-summary .grand-total-row,
body.dark-mode .sticky-nav ul li a.active,
body.dark-mode .sticky-nav ul li a:hover {
    color: var(--secondary-color);
}

/* =========================
   Header & Navigation
   ========================= */
header {
    text-align: center;
    padding: 20px 15px;
    background-color: var(--primary-color);
    color: #fff;
}

header .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header .dark-light-toggle {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
}

header .header-content h1 {
    font-size: 2rem;
    margin: 15px 0 10px;
}

header .header-content p {
    font-size: 1.2rem;
}

.sticky-nav {
    position: sticky;
    top: 0;
    background-color: var(--card-light-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}
body.dark-mode .sticky-nav { background-color: var(--card-dark-bg); }

.sticky-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

.sticky-nav ul li a {
    color: var(--primary-color);
    font-weight: 500;
    padding: 5px 10px;
    margin: 0 5px;
    transition: color var(--transition-speed);
    white-space: nowrap;
}

.sticky-nav ul li a.active,
.sticky-nav ul li a:hover {
    color: var(--secondary-color);
}

/* =========================
   Container & Sections
   ========================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

section {
    padding: 40px 0;
}

section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* =========================
   Product Grid & Details
   ========================= */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.product-showcase { flex: 1 1 400px; text-align: center; }
.details { flex: 1 1 400px; }

.product-showcase img#mainImage {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
}

.thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border var(--transition-speed);
}
.thumbnails img:hover { border: 2px solid var(--secondary-color); }

.details h2 { text-align: left; }
.details p { margin-bottom: 15px; }

.button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    transition: background-color var(--transition-speed);
}
.button:hover { background-color: var(--primary-color); }

.variant-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.variant-option {
    text-align: center;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    transition: border var(--transition-speed), background-color var(--transition-speed);
}

.variant-option.active {
    border-color: var(--secondary-color);
    background-color: #f0f9f0;
}
body.dark-mode .variant-option.active { background-color: #333; }
.variant-option img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto;
}

/* =========================
   Product Prices
   ========================= */
.price-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.price-offer-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#offerPrice {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#regularPrice {
    font-size: 1.1rem;
    color: #777;
    text-decoration: line-through;
}

body.dark-mode #regularPrice {
    color: #bbb;
}

.free-delivery-flash {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    background-color: #ff6347; /* Tomato color */
    padding: 5px 10px;
    border-radius: 5px;
    animation: flashEffect 1.5s infinite ease-in-out;
    white-space: nowrap; /* Prevent text from wrapping */
}

@keyframes flashEffect {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* =========================
   Features & Specifications
   ========================= */
.specifications ul,
.features ul,
.usecases-list {
    list-style: none;
    padding-left: 0;
}

.features li, .specifications li {
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
body.dark-mode .features li, body.dark-mode .specifications li { background: var(--card-dark-bg); }

.usecases-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.usecase-item {
    display: flex;
    gap: 15px;
    align-items: center;
}
.usecase-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

/* =========================
   Carousel / Testimonials
   ========================= */
.carousel-container {
    position: relative;
    overflow: hidden;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 10px;
}
.carousel-slide-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* =========================
   Order Form
   ========================= */
.order form {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--card-light-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order .form-group {
    margin-bottom: 20px;
}

.order .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.order input[type="text"],
.order input[type="email"],
.order input[type="tel"],
.order textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.order textarea { resize: vertical; min-height: 100px; }

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.product-item label { font-weight: bold; }

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-control .quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #555;
    cursor: pointer;
}

body.dark-mode .quantity-control .quantity-btn {
    background-color: #444;
    border-color: #555;
    color: #ddd;
}


.quantity-control input[type="number"] {
    width: 60px;
    text-align: center;
    border: 1px solid #ccc;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 8px;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-control .minus-btn { border-radius: 5px 0 0 5px; }
.quantity-control .plus-btn { border-radius: 0 5px 5px 0; }

.error-message {
    color: var(--error-color);
    font-size: 0.9em;
    margin-top: 5px;
    min-height: 1em; /* Prevent layout shift */
}

.order button[type="submit"] {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 18px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
}
.order button[type="submit"]:hover { background-color: var(--secondary-color); }

.order-summary {
    margin: 20px 0;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eee;
}
body.dark-mode .order-summary { background-color: #333; border-color: #444; }

.order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}
.order-summary .grand-total-row {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
}
body.dark-mode .order-summary .grand-total-row { border-top-color: #444; }

/* =========================
   Thank You Page
   ========================= */
.thank-you-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.thank-you-container {
    background-color: var(--card-light-bg);
    padding: 0; /* Changed from 40px to 0 */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
    overflow: hidden; /* Ensures the header corners are clipped */
}

body.dark-mode .thank-you-container {
    background-color: var(--card-dark-bg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.thank-you-header {
    background-color: var(--primary-color);
    padding: 30px 20px;
}

.thank-you-logo {
    margin: 0 auto;
    width: 150px;
}

.thank-you-container h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px; /* Added margin */
    padding: 0 40px; /* Added padding */
}

.thank-you-container h1 .fas {
    font-size: 1.5em;
    margin-right: 15px;
    color: var(--secondary-color);
}

.thank-you-container .intro-message {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    padding: 0 40px; /* Added padding */
}
body.dark-mode .thank-you-container .intro-message {
    color: #bbb;
}

.thank-you-details-container {
    text-align: left;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    margin: 0 40px 30px; /* Adjusted margin */
}

.thank-you-details-container h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.thank-you-details-container .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1rem;
    border-bottom: 1px dashed #eee;
}

body.dark-mode .thank-you-details-container .detail-item {
    border-bottom-color: #444;
}

.thank-you-details-container .detail-item:last-child {
    border-bottom: none;
}

.thank-you-details-container .detail-item span:first-child {
    font-weight: bold;
    color: #555;
}
body.dark-mode .thank-you-details-container .detail-item span:first-child {
    color: #bbb;
}

.order-items-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.order-items-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.total-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    border-top: 2px solid var(--secondary-color);
    padding-top: 15px;
    margin-top: 15px;
}

body.dark-mode .total-amount {
    color: var(--secondary-color);
    border-top-color: var(--primary-color);
}

.thank-you-container .button {
    margin: 0 40px 40px; /* Adjusted margin */
    width: auto;
    padding: 15px 30px;
    font-size: 1.1rem;
    display: inline-block;
}

/* =========================
   Footer
   ========================= */
.site-footer {
    background-color: var(--primary-color);
    color: #f0f0f0;
    padding: 40px 20px 20px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column { flex: 1 1 220px; }
.footer-column h3 { margin-bottom: 15px; color: #fff; }
.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column a { color: #f0f0f0; transition: color var(--transition-speed); }
.footer-column a:hover { color: var(--secondary-color); }

.footer-social a {
    margin-right: 15px;
    font-size: 22px;
    color: #fff;
}

.footer-contact li { display: flex; align-items: center; gap: 10px; }

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #4a7c59;
    font-size: 0.9rem;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 768px) {
    header .header-content h1 { font-size: 1.8rem; }
    .product-grid { flex-direction: column; }
    .footer-container { flex-direction: column; text-align: center; }
    .footer-social { justify-content: center; display: flex; }
    .footer-contact li { justify-content: center; }
}

@media (max-width: 480px) {
    .product-item {
        flex-direction: column;
        align-items: flex-start;
    }
}