/* ====================================================
   Main Content & Product Grid Layout
==================================================== */

.content-wrapper {
    display: flex;
    align-items: flex-start;
    padding-left: 15px;
    width: 100%;
    min-height: 100vh;
}

/* ===== Main Area ===== */
.main-content {
    flex-grow: 1;
    min-height: 100vh;
    padding: 15px;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: var(--grid-gap, 16px);
    padding: 0 var(--grid-padding, 16px);
    box-sizing: border-box;
    max-width: calc(var(--grid-columns) * 320px);
    margin: 0 auto;
    justify-content: center;
    transition: all 0.3s ease;
}

.grid-view .product-card {
    aspect-ratio: var(--card-aspect-ratio, 1/2);
    transition: aspect-ratio 0.3s, margin 0.3s;
}

.row-view {
    display: flex;
    flex-direction: column;
}

.row-view .product-card {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--header-bg);
    border-radius: 8px;
}

/* Hide column toggle button on small screens */
@media (max-width: 1366px) {
    #toggle-columns-btn {
        display: none !important;
    }
}

@media (max-width: 900px) {
    #toggle-columns-btn {
        display: none !important;
    }
	.card img,
    .card-img-top {
        height: 75px !important;  /* or try 100px–130px for best fit */
        max-width: 100%;
        object-fit: contain !important;
        margin-bottom: 6px;
        display: block;
    }
	.card-body {
        font-size: 0.6em; /* Slightly smaller font for iPad/tablet */
        padding: 6px;
    }
	.barcode-canvas {
        width: 90px !important;    /* Try 90, 100, 110, etc. for best fit */
        height: 28px !important;   /* Keeps it proportional */
        display: block;
        margin: 10px auto 12px;
    }
}



/* ====================================================
   Product Card Styles
==================================================== */
.product-container {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, 1fr);
	pointer-events: auto;
}

.product-card {
	position: relative;
	transition: all 0.3s;
	width: 300px;
}

.product-card:hover {
	transform: scale(1.05);
	cursor: pointer;
}

.card {
	height: 100%;
	display: flex;
	flex-direction: column;
	background-color: var(--card-bg);
	color: var(--text-color);
}

.card img {
	object-fit: cover;
	height: 250px;
	width: 100%;
}

.card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.card-price {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px;
	line-height: 1.2;
}

.card-price span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100px;
}


/* Flip Card Styles */
.flip-card {
    perspective: 1000px;
    width: auto;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    display: flex;
}

.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid #ddd;
    border-radius: 8px;
    flex-shrink: 0;
    top: 0;
    left: 0;
}

.flip-card-back {
    transform: rotateY(180deg);
    background-color: var(--card-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* ====================================================
   Store Info Scroll Areas
==================================================== */
.store-info-container,
.store-info-wrapper {
	overflow-y: auto;
	scrollbar-width: thin;
}

.store-info-container {
	max-height: 150px;
	-webkit-overflow-scrolling: touch;
}

.store-info-wrapper {
	position: relative;
	width: 100%;
	max-height: 200px;
	display: flex;
	flex-direction: column;
}

.store-info-item {
	background-color: var(--card-bg);
	padding: 8px;
	border-radius: 5px;
	border: 1px solid var(--header-bg);
	color: var(--text-color);
}

.store-info-container::-webkit-scrollbar,
.store-info-wrapper::-webkit-scrollbar {
	width: 6px;
}

.store-info-container::-webkit-scrollbar-thumb,
.store-info-wrapper::-webkit-scrollbar-thumb {
	background-color: #888;
	border-radius: 3px;
}

.store-info-container::-webkit-scrollbar-thumb:hover,
.store-info-wrapper::-webkit-scrollbar-thumb:hover {
	background-color: #555;
}

/* ====================================================
   Miscellaneous Main Area Styles
==================================================== */
.notification {
    background-color: #28a745;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 10px;
    opacity: 1;
    transition: opacity 0.5s, transform 0.5s;
    transform: translateX(0);
}

.notification.error {
    background-color: #dc3545;
}

.notification.hide {
    opacity: 0;
    transform: translateX(50px);
}
@media (max-width: 767px) {
	#cart-notification {
		font-size: 0.75rem;
		padding: 8px 10px;
		max-width: 90vw;
		white-space: nowrap;
		z-index: 1001;
	}
}