/* Modern Cart Styles for ConstruDepot - Elegant & Spacious Design */

body {
	background: #f8f9fa;
	margin: 0 !important;
	padding: 0 !important;
}

/* Remove any extra spacing from header */
body > div:first-of-type {
	margin-top: 0 !important;
}

/* Main Cart Layout */
.cart-main-wrapper {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px 20px 40px 20px;
}

.cart-grid {
	display: grid;
	grid-template-columns: 1fr 420px;
	gap: 40px;
	align-items: start;
	max-width: 1600px;
	margin: 0 auto;
}

/* Cart Title */
.cart-title {
	font-family: 'Poppins', sans-serif;
	font-size: 2.5rem;
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 32px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.cart-items-count {
	font-size: 1.5rem;
	color: #6b7280;
	font-weight: 400;
}

/* Cart Items Container */
.cart-items-container {
	background: white;
	border-radius: 16px;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Individual Cart Item */
.cart-item {
	display: grid;
	grid-template-columns: auto 120px 1fr auto auto auto;
	gap: 20px;
	padding: 24px 28px;
	border-bottom: 1px solid #e5e7eb;
	align-items: center;
	transition: background 0.2s ease;
	position: relative;
}

.cart-item:hover {
	background: #f9fafb;
}

.cart-item:last-child {
	border-bottom: none;
}

/* Delete Button - Icon Style */
.cart-item-remove {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #fef2f2;
	border: none;
	color: #ef4444;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.cart-item-remove:hover {
	background: #ef4444;
	color: white;
	transform: scale(1.05);
}

.cart-item-remove svg {
	width: 18px;
	height: 18px;
}

/* Product Image */
.cart-item-image {
	width: 100px;
	height: 100px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	flex-shrink: 0;
}

.cart-item-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Product Details */
.cart-item-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cart-item-name {
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.4;
	margin: 0;
}

.cart-item-name a {
	color: #1f2937;
	text-decoration: none;
	transition: color 0.2s ease;
}

.cart-item-name a:hover {
	color: #f7931d;
}

.cart-item-code {
	font-size: 12px;
	color: #9ca3af;
	margin: 0;
}

/* Quantity, Price, Total - Consistent Layout */
.cart-item-quantity,
.cart-item-price,
.cart-item-total {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	align-self: start;
}

.cart-item-total {
	align-items: flex-end;
}

.quantity-label,
.price-label,
.total-label {
	font-size: 11px;
	color: #6b7280;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.quantity-input {
	width: 70px;
	height: 42px;
	padding: 0 8px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	text-align: center;
	font-weight: 600;
	font-size: 16px;
	color: #1f2937;
	background: white;
	box-sizing: border-box;
}

.quantity-input:focus {
	outline: none;
	border-color: #f7931d;
	background: #f9fafb;
}

.price-amount {
	font-size: 17px;
	font-weight: 700;
	color: #1f2937;
	height: 42px;
	line-height: 42px;
}

.total-amount {
	font-size: 20px;
	font-weight: 700;
	color: #f7931d;
	height: 42px;
	line-height: 42px;
}

/* Order Summary Sidebar */
.order-summary {
	background: white;
	border-radius: 16px;
	padding: 32px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	position: sticky;
	top: 100px;
}

.summary-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 24px 0;
	padding-bottom: 16px;
	border-bottom: 2px solid #e5e7eb;
}

/* Summary Rows */
.summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	font-size: 15px;
}

.summary-label {
	color: #6b7280;
	font-weight: 500;
}

.summary-value {
	color: #1f2937;
	font-weight: 600;
}

.summary-value.positive {
	color: #10b981;
}

.summary-divider {
	height: 1px;
	background: #e5e7eb;
	margin: 16px 0;
}

/* Total Row */
.summary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 0 0 0;
	margin-top: 16px;
	border-top: 2px solid #e5e7eb;
}

.total-label-main {
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
}

.total-amount-main {
	font-size: 28px;
	font-weight: 700;
	color: #f7931d;
}

.items-count {
	font-size: 13px;
	color: #6b7280;
	margin-top: 4px;
	display: block;
}

/* Action Buttons */
.summary-actions {
	margin-top: 28px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.btn-checkout-main {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: white;
	padding: 18px 24px;
	border-radius: 12px;
	border: none;
	font-weight: 700;
	font-size: 16px;
	width: 100%;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-checkout-main:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-checkout-main:disabled {
	background: #d1d5db;
	cursor: not-allowed;
	box-shadow: none;
}

.btn-continue-shopping {
	background: transparent;
	color: #6b7280;
	padding: 14px 24px;
	border-radius: 12px;
	border: 2px solid #e5e7eb;
	font-weight: 600;
	font-size: 15px;
	width: 100%;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
}

.btn-continue-shopping:hover {
	border-color: #f7931d;
	color: #f7931d;
	background: #fff5f0;
}

/* Empty Cart */
.empty-cart-wrapper {
	background: white;
	border-radius: 16px;
	padding: 80px 40px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-cart-icon {
	margin-bottom: 24px;
	opacity: 0.3;
}

.empty-cart-title {
	font-size: 1.75rem;
	color: #1f2937;
	margin-bottom: 12px;
	font-weight: 700;
}

.empty-cart-text {
	color: #6b7280;
	font-size: 1rem;
	margin-bottom: 32px;
}

.empty-cart-text a {
	color: #f7931d;
	font-weight: 600;
	text-decoration: none;
}

.empty-cart-text a:hover {
	text-decoration: underline;
}

/* Alerts */
.alert-modern {
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.alert-warning {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	border: 1px solid #fbbf24;
	color: #92400e;
}

.alert-info {
	background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
	border: 1px solid #60a5fa;
	color: #1e40af;
}

/* Override Bootstrap Table Styles */
.table-responsive {
	display: block !important;
	width: 100% !important;
	overflow-x: visible !important;
	-webkit-overflow-scrolling: touch !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.table-responsive table,
.table-responsive thead,
.table-responsive tbody,
.table-responsive tr,
.table-responsive th,
.table-responsive td {
	display: none !important;
}

/* Quantity Warning */
small[id^="mensaje_cantidad_"] {
	color: #dc2626 !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	margin-top: 4px !important;
	display: block !important;
}

/* Modal Improvements */
.modal-content {
	border-radius: 20px !important;
	border: none !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
	overflow: hidden !important;
}

.modal-header {
	background: linear-gradient(135deg, #f7931d 0%, #ffab4a 100%) !important;
	color: white !important;
	padding: 24px 32px !important;
	border-bottom: none !important;
}

.modal-header .modal-title {
	font-weight: 700 !important;
	color: white !important;
	font-size: 1.5rem !important;
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
}

.modal-header .close {
	color: white !important;
	opacity: 1 !important;
	text-shadow: none !important;
	font-size: 2rem !important;
}

.modal-body {
	padding: 32px !important;
}

.modal-footer {
	padding: 20px 32px !important;
	border-top: 1px solid #e5e7eb !important;
	background: #f9fafb !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.cart-grid {
		grid-template-columns: 1fr 350px;
		gap: 24px;
	}
}

@media (max-width: 992px) {
	.cart-grid {
		grid-template-columns: 1fr;
	}

	.order-summary {
		position: static;
		margin-top: 24px;
	}

	.cart-item {
		grid-template-columns: auto 90px 1fr;
		gap: 16px;
		padding: 20px;
	}

	.cart-item-image {
		width: 90px;
		height: 90px;
	}

	.cart-item-quantity,
	.cart-item-price,
	.cart-item-total {
		grid-column: span 1;
	}
}

@media (max-width: 768px) {
	.cart-title {
		font-size: 1.5rem;
		gap: 10px;
	}

	.cart-title svg {
		width: 26px;
		height: 26px;
	}

	.cart-items-count {
		font-size: 1rem;
	}

	.cart-main-wrapper {
		padding: 16px 12px;
	}

	.cart-items-container {
		border-radius: 12px;
	}

	/* Diseño móvil - Grid de 3 columnas x 3 filas */
	.cart-item {
		display: grid;
		grid-template-columns: 75px 1fr auto;
		grid-template-rows: auto auto auto;
		gap: 8px 12px;
		padding: 16px;
		position: relative;
	}

	/* Botón eliminar - arriba a la derecha */
	.cart-item-remove {
		grid-column: 3;
		grid-row: 1;
		width: 32px;
		height: 32px;
	}

	.cart-item-remove svg {
		width: 16px;
		height: 16px;
	}

	/* Imagen - ocupa 2 filas a la izquierda */
	.cart-item-image {
		grid-column: 1;
		grid-row: 1 / 3;
		width: 75px;
		height: 75px;
		padding: 6px;
		border-radius: 8px;
		align-self: start;
	}

	/* Detalles del producto */
	.cart-item-details {
		grid-column: 2;
		grid-row: 1;
	}

	.cart-item-name {
		font-size: 14px;
		line-height: 1.35;
	}

	.cart-item-code {
		font-size: 11px;
	}

	/* Fila 3: Cantidad | Precio Unit | Total */
	.cart-item-quantity,
	.cart-item-price,
	.cart-item-total {
		grid-row: 3;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		padding: 0;
	}

	.cart-item-quantity {
		grid-column: 1;
		align-items: center;
	}

	.cart-item-price {
		grid-column: 2;
		align-items: center;
	}

	.cart-item-total {
		grid-column: 3;
		align-items: center;
	}

	.quantity-label,
	.price-label,
	.total-label {
		font-size: 9px;
		margin-bottom: 2px;
		color: #9ca3af;
		text-transform: uppercase;
	}

	.quantity-input {
		width: 50px;
		padding: 6px 4px;
		font-size: 14px;
		border: 1px solid #e5e7eb;
		border-radius: 6px;
		text-align: center;
	}

	.price-amount {
		font-size: 13px;
		white-space: nowrap;
	}

	.total-amount {
		font-size: 15px;
		white-space: nowrap;
	}

	/* Order Summary móvil */
	.order-summary {
		border-radius: 12px;
		padding: 20px 16px;
		margin-top: 16px;
	}

	.summary-title {
		font-size: 1.1rem;
		margin-bottom: 16px;
		padding-bottom: 12px;
	}

	.summary-row {
		padding: 8px 0;
		font-size: 14px;
	}

	.summary-total {
		padding: 14px 0 0 0;
		margin-top: 10px;
	}

	.total-label-main {
		font-size: 15px;
	}

	.total-amount-main {
		font-size: 20px;
	}

	.items-count {
		font-size: 11px;
	}

	/* Botones móvil */
	.summary-actions {
		margin-top: 16px;
		gap: 10px;
	}

	.btn-checkout-main {
		padding: 14px 16px;
		font-size: 14px;
		border-radius: 10px;
	}

	.btn-continue-shopping {
		padding: 12px 16px;
		font-size: 13px;
		border-radius: 10px;
	}

	/* Carrito vacío móvil */
	.empty-cart-wrapper {
		padding: 50px 20px;
		border-radius: 12px;
	}

	.empty-cart-icon svg {
		width: 70px;
		height: 70px;
	}

	.empty-cart-title {
		font-size: 1.2rem;
	}

	.empty-cart-text {
		font-size: 14px;
	}

	/* Alert móvil */
	.alert-warning-modern {
		padding: 12px 14px;
		font-size: 13px;
		border-radius: 10px;
		margin-bottom: 16px;
	}

	.alert-warning-modern svg {
		width: 20px;
		height: 20px;
		flex-shrink: 0;
	}
}

/* Pantallas muy pequeñas */
@media (max-width: 400px) {
	.cart-main-wrapper {
		padding: 12px 8px;
	}

	.cart-item {
		padding: 14px 12px;
		gap: 10px 12px;
	}

	.cart-item-image {
		width: 70px;
		height: 70px;
	}

	.cart-item-name {
		font-size: 13px;
	}

	.quantity-input {
		width: 50px;
	}

	.price-amount {
		font-size: 13px;
	}

	.total-amount {
		font-size: 15px;
	}

	.order-summary {
		padding: 16px 12px;
	}
}
