/*
 * ========================================
 * ✅ Master Stylesheet for giffme.com
 * ✨ Consolidated & Refined by Gemini
 * ========================================
 */

/* --- 1. Global Variables & Base Styles --- */
:root {
	--primary-color: #005a5a;
	--secondary-color: #004d4d;
	--secondary-color-darker: #003838;
	--accent-color: #e67e00;
	--accent-color-darker: #d67400;
	--text-color: #0b2c5c;
	--background-light: #e0f2f2;
	--background-dark: #335c5b;
	--border-color: #008080;
	--white-color: #fff;
	--font-family-primary: 'Segoe UI', Roboto, Arial, sans-serif;
	--base-font-size: 18px;
	--line-height-base: 1.6;
	--line-height-heading: 1.3;
	--spacing-md: 16px;
	--spacing-lg: 24px;
	--border-radius-base: 8px;
	--transition-speed: 0.4s;
	--shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
	--shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
}

*, *::before, *::after {
	box-sizing: border-box;
}

html, body {
	overflow-x: hidden;
}

body {
	font-family: var(--font-family-primary);
	color: var(--text-color);
	font-size: var(--base-font-size);
	line-height: var(--line-height-base);
	background-color: var(--white-color);
	margin: 0;
	padding: 0;
}

a {
	color: var(--primary-color);
	text-decoration: underline; /* Accessibility improvement */
	transition: color var(--transition-speed) ease;
}

a:hover {
	color: var(--accent-color);
	text-decoration: none;
}

img {
	max-width: 100%;
	height: auto;
	object-fit: cover;
	border-radius: var(--border-radius-base);
}

/* --- 2. Typography --- */
h1, h2, h3 {
	line-height: var(--line-height-heading);
	color: var(--primary-color);
	margin-bottom: var(--spacing-md);
}
h1 { font-size: calc(var(--base-font-size) + 18px); }
h2 { font-size: calc(var(--base-font-size) + 10px); }
h3 { font-size: calc(var(--base-font-size) + 4px); }

/* --- 3. Main Layout Structure --- */
#mainWrapper {
	width: 100%;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

header {
	color: var(--border-color);
	text-align: center;
	padding: var(--spacing-lg);
	box-shadow: var(--shadow-light);
	margin-bottom: var(--spacing-md);
}

#offer {
	background-color: #d0cfcf;
	color: var(--text-color);
	padding: var(--spacing-md);
	text-align: center;
	margin-bottom: var(--spacing-lg);
	border-radius: var(--border-radius-base);
	word-wrap: break-word;
}

#content {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-lg);
	padding: 0 var(--spacing-md) var(--spacing-lg);
	width: 100%;
	flex: 1; /* Ensures content pushes footer down */
}

#content .sidebar {
	flex: 0 0 250px;
	padding: var(--spacing-lg);
	background-color: #d0cfcf;
	border-radius: var(--border-radius-base);
	box-shadow: var(--shadow-light);
}

#content .mainContent {
	flex: 1;
	min-width: 0; /* Prevents flex item from overflowing */
	word-wrap: break-word;
}

.productRow {
	color: #400080;
	padding: var(--spacing-md);
	background-color: var(--background-light);
	border-radius: var(--border-radius-base);
	margin-bottom: var(--spacing-lg);
	box-shadow: var(--shadow-light);
}

footer {
	background-color: var(--background-dark);
	font-size: calc(var(--base-font-size) - 4px);
	line-height: var(--line-height-base);
	padding: var(--spacing-lg);
	text-align: center;
	color: var(--white-color);
	margin-top: auto;
}

/* --- 4. Components & Utilities --- */
.tcenter { text-align: center; }
.twhite, .twhite a { color: var(--white-color); }
.tblue2 { color: var(--text-color); text-align: justify; }
.s7, .s7s { color: var(--primary-color); font-weight: 700; }

.sidebar #menubar .menu ul {
	padding-left: 0;
	margin: 0;
}
.sidebar #menubar .menu ul li {
	list-style-type: none;
	margin-bottom: 8px;
}
.sidebar #menubar .menu ul li a {
	display: block;
	cursor: pointer;
	background-color: var(--secondary-color);
	color: var(--white-color);
	border-radius: var(--border-radius-base);
	padding: 12px 18px;
	text-align: center;
	text-decoration: none; /* Buttons should not be underlined */
	transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}
.sidebar #menubar .menu ul li a:hover {
	background-color: var(--secondary-color-darker);
	transform: translateY(-2px);
}

/* --- 5. Hamburger Menu & Overlay --- */
#hamburger-menu {
    display: none; /* ซ่อนเป็นค่าเริ่มต้นสำหรับจอใหญ่ */
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background-color: rgba(0, 128, 128, 0.9);
    border: none;
    border-radius: var(--border-radius-base);
    cursor: pointer;
    padding: 10px;
    box-shadow: var(--shadow-medium);
}
#hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--white-color);
    margin: 5px 0;
    border-radius: 3px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
#hamburger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#hamburger-menu.active span:nth-child(2) { opacity: 0; }
#hamburger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}
#menu-overlay.active { display: block; }


/* --- 6. Cookie Banner --- */
.cookie-container {
    position: fixed;
    bottom: -200px; /* Start off-screen */
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--secondary-color);
    color: var(--white-color);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-medium);
    transition: bottom var(--transition-speed) ease-in-out;
    border-radius: var(--border-radius-base);
    z-index: 1000;
}
.cookie-container.active { bottom: 16px; }
.cookie-container p { margin: 0; font-size: 14px; }
.cookie-container a { color: #f0c48a; }
.cookie-buttons { display: flex; gap: 10px; }
.cookie-btn {
    background: var(--primary-color);
    border: 0;
    color: var(--white-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-base);
    cursor: pointer;
    transition: background-color var(--transition-speed);
}
.cookie-btn:hover { background-color: var(--secondary-color-darker); }


/* --- 7. Responsive Design --- */
@media screen and (max-width: 768px) {
    #content {
        flex-direction: column;
        padding: 0 12px 12px;
    }

    /* แสดงปุ่ม hamburger บนจอเล็ก */
    #hamburger-menu { display: block; }

    /* กำหนดสไตล์ให้ sidebar เป็นเมนูเลื่อนออกด้านข้าง */
    #content .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        max-width: 80%;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out;
        overflow-y: auto;
        border-radius: 0;
    }
    #content .sidebar.active { transform: translateX(0); }

    #content .mainContent {
        width: 100%;
        padding: 0;
    }
    
    footer div {
		width: 100%;
		text-align: center;
		margin-bottom: var(--spacing-md);
	}
}

@media screen and (max-width: 550px) {
	h1 { font-size: calc(var(--base-font-size) + 8px); }
	h2 { font-size: calc(var(--base-font-size) + 4px); }

    .cookie-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cookie-container p { margin-bottom: 12px; }
}